From cbbd53eda55fbdf65f22b5f57c7dbc4b1ea594fd Mon Sep 17 00:00:00 2001 From: alexke-dev <65682333+alexke-dev@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:28:02 -0700 Subject: Remove Print Driver Samples (#1017) * Remove print driver samples. Add README.md to redirect consumers to Print Support App (PSA) development guide. * Remove en-us from URL. --- .../C++/CUSTOMDRV.HLP | Bin 5955 -> 0 bytes .../C++/PSUIRep/Features.cpp | 2858 ------------------- .../C++/PSUIRep/Features.h | 236 -- .../C++/PSUIRep/Helper.cpp | 457 ---- .../C++/PSUIRep/Helper.h | 214 -- .../C++/PSUIRep/OEMUI.rc | 260 -- .../C++/PSUIRep/PSUIREP.vcxproj | 1066 -------- .../C++/PSUIRep/PSUIREP.vcxproj.Filters | 397 --- .../C++/PSUIRep/StringUtils.cpp | 315 --- .../C++/PSUIRep/StringUtils.h | 23 - .../C++/PSUIRep/debug.cpp | 405 --- .../C++/PSUIRep/debug.h | 166 -- .../C++/PSUIRep/devmode.cpp | 193 -- .../C++/PSUIRep/devmode.h | 56 - .../C++/PSUIRep/dllentry.cpp | 49 - .../C++/PSUIRep/globals.cpp | 24 - .../C++/PSUIRep/globals.h | 31 - .../C++/PSUIRep/intrface.cpp | 709 ----- .../C++/PSUIRep/intrface.h | 220 -- .../C++/PSUIRep/oemui.cpp | 1042 ------- .../C++/PSUIRep/oemui.h | 33 - .../C++/PSUIRep/precomp.h | 55 - .../C++/PSUIRep/precompsrc.cpp | 1 - .../C++/PSUIRep/psuirep.def | 3 - .../C++/PSUIRep/resource.h | 92 - .../C++/PTPCPlPr/install/ptpcplpr.gpd | 763 ------ .../C++/PTPCPlPr/install/ptpcplpr.inf | Bin 4590 -> 0 bytes .../C++/PTPCPlPr/install/ptpcplpr.ini | 3 - .../C++/PTPCPlPr/src/PTPCPLPR.vcxproj | 904 ------ .../C++/PTPCPlPr/src/PTPCPLPR.vcxproj.Filters | 272 -- .../C++/PTPCPlPr/src/debug.hxx | 82 - .../C++/PTPCPlPr/src/dllentry.cxx | 48 - .../C++/PTPCPlPr/src/globals.cxx | 21 - .../C++/PTPCPlPr/src/globals.hxx | 25 - .../C++/PTPCPlPr/src/intrface.cxx | 493 ---- .../C++/PTPCPlPr/src/intrface.hxx | 178 -- .../C++/PTPCPlPr/src/oem.hxx | 26 - .../C++/PTPCPlPr/src/oemptprovider.cxx | 1145 -------- .../C++/PTPCPlPr/src/oemptprovider.hxx | 143 - .../C++/PTPCPlPr/src/precomp.hxx | 49 - .../C++/PTPCPlPr/src/precompsrc.cpp | 1 - .../C++/PTPCPlPr/src/printschema.cxx | 64 - .../C++/PTPCPlPr/src/printschema.hxx | 74 - .../C++/PTPCPlPr/src/ptpcplpr.def | 3 - .../C++/PTPCPlPr/src/ptpcplpr.rc | 24 - .../C++/PTPCPlPr/src/xmlhandler.cxx | 1612 ----------- .../C++/PTPCPlPr/src/xmlhandler.hxx | 162 -- .../C++/SyncSet/SYNCSET.vcxproj | 1066 -------- .../C++/SyncSet/SYNCSET.vcxproj.Filters | 272 -- .../C++/SyncSet/SyncSet.def | 3 - .../C++/SyncSet/debug.cpp | 405 --- .../C++/SyncSet/debug.h | 166 -- .../C++/SyncSet/devmode.cpp | 214 -- .../C++/SyncSet/devmode.h | 57 - .../C++/SyncSet/dllentry.cpp | 49 - .../C++/SyncSet/globals.cpp | 26 - .../C++/SyncSet/globals.h | 22 - .../C++/SyncSet/intrface.cpp | 612 ----- .../C++/SyncSet/intrface.h | 192 -- .../C++/SyncSet/oem.h | 24 - .../C++/SyncSet/oemui.cpp | 1099 -------- .../C++/SyncSet/oemui.h | 74 - .../C++/SyncSet/oemui.rc | 175 -- .../C++/SyncSet/precomp.h | 53 - .../C++/SyncSet/precompsrc.cpp | 1 - .../C++/SyncSet/resource.h | 28 - .../C++/ThemeUI/OEMUI.rc | 169 -- .../C++/ThemeUI/ThemeUI.Manifest | 22 - .../C++/ThemeUI/ThemeUISmpl.vcxproj | 1120 -------- .../C++/ThemeUI/ThemeUISmpl.vcxproj.Filters | 327 --- .../C++/ThemeUI/debug.h | 82 - .../C++/ThemeUI/devmode.cpp | 187 -- .../C++/ThemeUI/devmode.h | 55 - .../C++/ThemeUI/dllentry.cpp | 66 - .../C++/ThemeUI/fusutils.cpp | 118 - .../C++/ThemeUI/fusutils.h | 18 - .../C++/ThemeUI/globals.cpp | 29 - .../C++/ThemeUI/globals.h | 21 - .../C++/ThemeUI/intrface.cpp | 575 ---- .../C++/ThemeUI/intrface.h | 179 -- .../C++/ThemeUI/oem.h | 22 - .../C++/ThemeUI/oemui.cpp | 756 ----- .../C++/ThemeUI/oemui.h | 45 - .../C++/ThemeUI/precomp.h | 61 - .../C++/ThemeUI/precompsrc.cpp | 1 - .../C++/ThemeUI/resource.h | 24 - .../C++/ThemeUI/themeuismpl.def | 3 - .../C++/WMarkPS.ini | 4 - .../C++/WMarkUni.ini | 5 - .../C++/bitmap.gpd | 509 ---- .../C++/bitmap.inf | Bin 4860 -> 0 bytes .../C++/bitmap.ini | 5 - .../C++/bitmap/bitmap.def | 4 - .../C++/bitmap/bitmap.h | 81 - .../C++/bitmap/bitmap.rc | 110 - .../C++/bitmap/bitmap.vcxproj | 1090 -------- .../C++/bitmap/bitmap.vcxproj.Filters | 174 -- .../C++/bitmap/ddihook.cpp | 114 - .../C++/bitmap/debug.h | 82 - .../C++/bitmap/devmode.cpp | 132 - .../C++/bitmap/devmode.h | 37 - .../C++/bitmap/dllentry.cpp | 50 - .../C++/bitmap/intrface.cpp | 2048 -------------- .../C++/bitmap/intrface.h | 287 -- .../C++/bitmap/precomp.h | 40 - .../C++/bitmap/precompsrc.cpp | 1 - .../C++/bitmap/resource.h | 17 - .../C++/custhlp.gpd | 563 ---- .../C++/custhlp.ini | 3 - .../C++/custhlp/CUSTHLP.def | 3 - .../C++/custhlp/CUSTHLP.vcxproj | 1060 ------- .../C++/custhlp/CUSTHLP.vcxproj.Filters | 220 -- .../C++/custhlp/customhelp/customdrv.cnt | 3 - .../C++/custhlp/customhelp/customdrv.h | 11 - .../C++/custhlp/customhelp/customdrv.hpj | 17 - .../C++/custhlp/customhelp/customdrv.rtf | 22 - .../C++/custhlp/debug.h | 82 - .../C++/custhlp/devmode.cpp | 182 -- .../C++/custhlp/devmode.h | 46 - .../C++/custhlp/dllentry.cpp | 49 - .../C++/custhlp/globals.cpp | 25 - .../C++/custhlp/globals.h | 22 - .../C++/custhlp/intrface.cpp | 562 ---- .../C++/custhlp/intrface.h | 182 -- .../C++/custhlp/oemui.cpp | 960 ------- .../C++/custhlp/oemui.h | 47 - .../C++/custhlp/oemui.rc | 170 -- .../C++/custhlp/precomp.h | 54 - .../C++/custhlp/precompsrc.cpp | 1 - .../C++/custhlp/resource.h | 23 - .../C++/gdl/res/gdlsmpl.gpd | 520 ---- .../C++/gdl/res/gdlsmpl.inf | Bin 3622 -> 0 bytes .../C++/gdl/res/gdlsmpl.ini | 3 - .../C++/gdl/src/GDLSMPL.vcxproj | 1084 -------- .../C++/gdl/src/GDLSMPL.vcxproj.Filters | 134 - .../C++/gdl/src/debug.h | 82 - .../C++/gdl/src/devmode.cpp | 251 -- .../C++/gdl/src/devmode.h | 52 - .../C++/gdl/src/gdlsmpl.cpp | 856 ------ .../C++/gdl/src/gdlsmpl.def | 18 - .../C++/gdl/src/gdlsmpl.h | 79 - .../C++/gdl/src/gdlsmpl.rc | 106 - .../C++/gdl/src/intrface.cpp | 559 ---- .../C++/gdl/src/intrface.h | 212 -- .../C++/gdl/src/precomp.h | 62 - .../C++/gdl/src/precompsrc.cpp | 1 - .../C++/oem.gpd | 704 ----- .../C++/oem.ppd | 431 --- .../C++/oemdll.inf | Bin 10570 -> 0 bytes .../C++/oemdll.sln | 809 ------ .../C++/oemprean.gpd | 706 ----- .../C++/oemprean.htm | 514 ---- .../C++/oemprean.inf | Bin 5058 -> 0 bytes .../C++/oemprean.ini | 4 - .../C++/oemprean/ddihook.cpp | 2069 -------------- .../C++/oemprean/debug.cpp | 1503 ---------- .../C++/oemprean/debug.h | 215 -- .../C++/oemprean/devmode.cpp | 229 -- .../C++/oemprean/devmode.h | 43 - .../C++/oemprean/dllentry.cpp | 58 - .../C++/oemprean/intrface.cpp | 1819 ------------ .../C++/oemprean/intrface.h | 288 -- .../C++/oemprean/oemprean.def | 3 - .../C++/oemprean/oemprean.h | 259 -- .../C++/oemprean/oemprean.rc | 110 - .../C++/oemprean/oemprean.vcxproj | 1096 -------- .../C++/oemprean/oemprean.vcxproj.Filters | 177 -- .../C++/oemprean/precomp.h | 49 - .../C++/oemprean/precompsrc.cpp | 1 - .../C++/oemprean/resource.h | 17 - .../C++/oemps.ini | 3 - .../C++/oemps/OEMPS.rc | 109 - .../C++/oemps/OEMPS.vcxproj | 1096 -------- .../C++/oemps/OEMPS.vcxproj.Filters | 220 -- .../C++/oemps/command.cpp | 278 -- .../C++/oemps/command.h | 24 - .../C++/oemps/ddihook.cpp | 1049 ------- .../C++/oemps/debug.h | 82 - .../C++/oemps/devmode.cpp | 151 - .../C++/oemps/devmode.h | 44 - .../C++/oemps/dllentry.cpp | 50 - .../C++/oemps/intrface.cpp | 632 ----- .../C++/oemps/intrface.h | 119 - .../C++/oemps/oemps.def | 3 - .../C++/oemps/oemps.h | 76 - .../C++/oemps/precomp.h | 47 - .../C++/oemps/precompsrc.cpp | 1 - .../C++/oemps/resource.h | 15 - .../C++/oemui.ini | 3 - .../C++/oemui/OEMUI.def | 3 - .../C++/oemui/OEMUI.rc | 169 -- .../C++/oemui/OEMUI.vcxproj | 1042 ------- .../C++/oemui/OEMUI.vcxproj.Filters | 220 -- .../C++/oemui/debug.h | 82 - .../C++/oemui/devmode.cpp | 182 -- .../C++/oemui/devmode.h | 52 - .../C++/oemui/dllentry.cpp | 49 - .../C++/oemui/globals.cpp | 22 - .../C++/oemui/globals.h | 17 - .../C++/oemui/intrface.cpp | 567 ---- .../C++/oemui/intrface.h | 178 -- .../C++/oemui/oemui.cpp | 737 ----- .../C++/oemui/oemui.h | 37 - .../C++/oemui/precomp.h | 52 - .../C++/oemui/precompsrc.cpp | 1 - .../C++/oemui/resource.h | 24 - .../C++/oemuni.ini | 3 - .../C++/oemuni/OEMUNI.def | 3 - .../C++/oemuni/OEMUNI.h | 234 -- .../C++/oemuni/OEMUNI.rc | 110 - .../C++/oemuni/OEMUNI.vcxproj | 1090 -------- .../C++/oemuni/OEMUNI.vcxproj.Filters | 174 -- .../C++/oemuni/ddihook.cpp | 1670 ----------- .../C++/oemuni/debug.h | 82 - .../C++/oemuni/devmode.cpp | 222 -- .../C++/oemuni/devmode.h | 43 - .../C++/oemuni/dllentry.cpp | 55 - .../C++/oemuni/intrface.cpp | 1797 ------------ .../C++/oemuni/intrface.h | 283 -- .../C++/oemuni/precomp.h | 36 - .../C++/oemuni/precompsrc.cpp | 1 - .../C++/oemuni/resource.h | 17 - .../C++/psuirep.ini | 3 - .../C++/syncset.gpd | 654 ----- .../C++/syncset.ini | 3 - .../C++/themeui.ini | 3 - .../C++/uisamples.inf | Bin 5820 -> 0 bytes .../C++/uniuirep/res/uniuirep.gpd | 559 ---- .../C++/uniuirep/res/uniuirep.inf | Bin 3710 -> 0 bytes .../C++/uniuirep/res/uniuirep.ini | 3 - .../C++/uniuirep/src/Features.cpp | 1991 -------------- .../C++/uniuirep/src/Features.h | 388 --- .../C++/uniuirep/src/UNIUIREP.vcxproj | 1066 -------- .../C++/uniuirep/src/UNIUIREP.vcxproj.Filters | 223 -- .../C++/uniuirep/src/debug.cpp | 405 --- .../C++/uniuirep/src/debug.h | 166 -- .../C++/uniuirep/src/devmode.cpp | 255 -- .../C++/uniuirep/src/devmode.h | 48 - .../C++/uniuirep/src/dllentry.cpp | 82 - .../C++/uniuirep/src/intrface.cpp | 1151 -------- .../C++/uniuirep/src/intrface.h | 222 -- .../C++/uniuirep/src/precomp.h | 68 - .../C++/uniuirep/src/precompsrc.cpp | 1 - .../C++/uniuirep/src/resource.h | 57 - .../C++/uniuirep/src/uniuirep.cpp | 492 ---- .../C++/uniuirep/src/uniuirep.def | 18 - .../C++/uniuirep/src/uniuirep.h | 55 - .../C++/uniuirep/src/uniuirep.rc | 192 -- .../C++/watermark/common/debug.h | 82 - .../C++/watermark/common/devmode.cpp | 229 -- .../C++/watermark/common/devmode.h | 56 - .../C++/watermark/common/oem.h | 24 - .../C++/watermark/wmarkps/WMARKPS.vcxproj | 1090 -------- .../C++/watermark/wmarkps/WMARKPS.vcxproj.Filters | 137 - .../C++/watermark/wmarkps/WMarkPS.def | 3 - .../C++/watermark/wmarkps/WMarkPS.rc | 130 - .../C++/watermark/wmarkps/command.cpp | 410 --- .../C++/watermark/wmarkps/command.h | 22 - .../C++/watermark/wmarkps/dllentry.cpp | 54 - .../C++/watermark/wmarkps/drawmark.ps | Bin 37 -> 0 bytes .../C++/watermark/wmarkps/fdevmode.cpp | 20 - .../C++/watermark/wmarkps/intrface.cpp | 491 ---- .../C++/watermark/wmarkps/intrface.h | 116 - .../C++/watermark/wmarkps/precomp.h | 51 - .../C++/watermark/wmarkps/precompsrc.cpp | 1 - .../C++/watermark/wmarkps/resource.h | 18 - .../C++/watermark/wmarkps/wmark.ps | 33 - .../C++/watermark/wmarkps/wmarkps.h | 25 - .../C++/watermark/wmarkui/WMARKUI.vcxproj | 1096 -------- .../C++/watermark/wmarkui/WMARKUI.vcxproj.Filters | 140 - .../C++/watermark/wmarkui/dllentry.cpp | 52 - .../C++/watermark/wmarkui/fdevmode.cpp | 21 - .../C++/watermark/wmarkui/globals.cpp | 27 - .../C++/watermark/wmarkui/globals.h | 22 - .../C++/watermark/wmarkui/intrface.cpp | 522 ---- .../C++/watermark/wmarkui/intrface.h | 177 -- .../C++/watermark/wmarkui/precomp.h | 50 - .../C++/watermark/wmarkui/precompsrc.cpp | 1 - .../C++/watermark/wmarkui/resource.h | 24 - .../C++/watermark/wmarkui/wmarkui.cpp | 590 ---- .../C++/watermark/wmarkui/wmarkui.def | 3 - .../C++/watermark/wmarkui/wmarkui.h | 35 - .../C++/watermark/wmarkui/wmarkui.rc | 128 - .../C++/watermarkuni/common/debug.h | 82 - .../C++/watermarkuni/common/devmode.cpp | 216 -- .../C++/watermarkuni/common/devmode.h | 52 - .../C++/watermarkuni/common/oem.h | 23 - .../C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj | 1150 -------- .../wmarkui/WMARKUNIUI.vcxproj.Filters | 140 - .../C++/watermarkuni/wmarkui/dllentry.cpp | 52 - .../C++/watermarkuni/wmarkui/fdevmode.cpp | 21 - .../C++/watermarkuni/wmarkui/globals.cpp | 26 - .../C++/watermarkuni/wmarkui/globals.h | 21 - .../C++/watermarkuni/wmarkui/intrface.cpp | 525 ---- .../C++/watermarkuni/wmarkui/intrface.h | 178 -- .../C++/watermarkuni/wmarkui/precomp.h | 54 - .../C++/watermarkuni/wmarkui/precompsrc.cpp | 1 - .../C++/watermarkuni/wmarkui/resource.h | 26 - .../C++/watermarkuni/wmarkui/wmarkui.cpp | 594 ---- .../C++/watermarkuni/wmarkui/wmarkui.h | 37 - .../C++/watermarkuni/wmarkui/wmarkui.rc | 124 - .../C++/watermarkuni/wmarkui/wmarkuniui.def | 3 - .../C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj | 1090 -------- .../watermarkuni/wmarkuni/WMARKUNI.vcxproj.Filters | 137 - .../C++/watermarkuni/wmarkuni/ddihook.cpp | 1226 --------- .../C++/watermarkuni/wmarkuni/dllentry.cpp | 51 - .../C++/watermarkuni/wmarkuni/fdevmode.cpp | 22 - .../C++/watermarkuni/wmarkuni/intrface.cpp | 950 ------- .../C++/watermarkuni/wmarkuni/intrface.h | 254 -- .../C++/watermarkuni/wmarkuni/name.h | 34 - .../C++/watermarkuni/wmarkuni/precomp.h | 53 - .../C++/watermarkuni/wmarkuni/precompsrc.cpp | 1 - .../C++/watermarkuni/wmarkuni/resource.h | 17 - .../C++/watermarkuni/wmarkuni/wmarkuni.def | 3 - .../C++/watermarkuni/wmarkuni/wmarkuni.h | 82 - .../C++/watermarkuni/wmarkuni/wmarkuni.rc | 104 - .../C++/winxp.inf | Bin 7046 -> 0 bytes .../README.md | 146 - .../license.rtf | 25 - print/README.md | 5 + .../BlankProjSrc/BlankProject.vcxproj | 194 -- .../BlankProjSrc/BlankProject.vcxproj.Filters | 17 - .../MarkupCompatibility/M1.1a.oxps | Bin 110463 -> 0 bytes .../MarkupCompatibility/M1.2a.oxps | Bin 110704 -> 0 bytes .../MarkupCompatibility/M2.14a.oxps | Bin 113173 -> 0 bytes .../MarkupCompatibility/M2.17a.oxps | Bin 114090 -> 0 bytes .../MarkupCompatibility/M2.20a.oxps | Bin 110933 -> 0 bytes .../MarkupCompatibility/M2.24a.oxps | Bin 114270 -> 0 bytes .../MarkupCompatibility/M2.27a.oxps | Bin 113251 -> 0 bytes .../MarkupCompatibility/M2.27b.oxps | Bin 114316 -> 0 bytes .../MarkupCompatibility/M2.30a.oxps | Bin 109949 -> 0 bytes .../MarkupCompatibility/M2.31a.oxps | Bin 109239 -> 0 bytes .../MarkupCompatibility/M2.32a.oxps | Bin 108094 -> 0 bytes .../MarkupCompatibility/M2.33a.oxps | Bin 106754 -> 0 bytes .../MarkupCompatibility/M2.35a.oxps | Bin 110403 -> 0 bytes .../MarkupCompatibility/M2.36a.oxps | Bin 117918 -> 0 bytes .../MarkupCompatibility/M2.36b.oxps | Bin 114139 -> 0 bytes .../MarkupCompatibility/M2.41a.oxps | Bin 109093 -> 0 bytes .../MarkupCompatibility/M2.41b.oxps | Bin 108518 -> 0 bytes .../MarkupCompatibility/M2.42a.oxps | Bin 110434 -> 0 bytes .../MarkupCompatibility/M2.42b.oxps | Bin 109580 -> 0 bytes .../MarkupCompatibility/M2.43a.oxps | Bin 109032 -> 0 bytes .../MarkupCompatibility/M2.43b.oxps | Bin 108300 -> 0 bytes .../MarkupCompatibility/M2.44a.oxps | Bin 107717 -> 0 bytes .../MarkupCompatibility/M2.48a.oxps | Bin 112803 -> 0 bytes .../MarkupCompatibility/M2.49a.oxps | Bin 111223 -> 0 bytes .../MarkupCompatibility/M2.49b.oxps | Bin 110444 -> 0 bytes .../MarkupCompatibility/M2.50a.oxps | Bin 113588 -> 0 bytes .../MarkupCompatibility/M2.52a.oxps | Bin 110381 -> 0 bytes .../MarkupCompatibility/M2.55a.oxps | Bin 109084 -> 0 bytes .../MarkupCompatibility/M2.56a.oxps | Bin 109737 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M1.2a.oxps | Bin 726 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M10.23a.oxps | Bin 103254 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M10.6a.oxps | Bin 102575 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M10.6b.oxps | Bin 102650 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M12.2a.oxps | Bin 104751 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M12.3a.oxps | Bin 104685 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M12.3b.oxps | Bin 110319 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M12.5a.oxps | Bin 107624 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M12.5b.oxps | Bin 107283 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M12.5c.oxps | Bin 107632 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M12.7a.oxps | Bin 104362 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.10a.oxps | Bin 106123 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.10b.oxps | Bin 106268 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.13a.oxps | Bin 101636 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.13b.oxps | Bin 101686 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.14a.oxps | Bin 102956 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.14b.oxps | Bin 102633 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.17a.oxps | Bin 177448 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.18a.oxps | Bin 64522 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.25a.oxps | Bin 120979 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.2a.oxps | Bin 100662 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.2b.oxps | Bin 101217 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.2c.oxps | Bin 101321 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.35a.oxps | Bin 107168 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.36a.oxps | Bin 102480 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.37a.oxps | Bin 1422218 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.39a.oxps | Bin 145780 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.39b.oxps | Bin 145568 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.39c.oxps | Bin 477300 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.3a.oxps | Bin 102696 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.3b.oxps | Bin 102754 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.3c.oxps | Bin 102373 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.4a.oxps | Bin 101906 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.4b.oxps | Bin 102381 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.54a.oxps | Bin 102759 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.59a.oxps | Bin 111139 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.59b.oxps | Bin 110266 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.59c.oxps | Bin 110253 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.5a.oxps | Bin 100836 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.5b.oxps | Bin 102393 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.6a.oxps | Bin 52761 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.6b.oxps | Bin 103567 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.6c.oxps | Bin 103670 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.70a.oxps | Bin 106392 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.71a.oxps | Bin 103343 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.71b.oxps | Bin 104231 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.71c.oxps | Bin 103611 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.72a.oxps | Bin 106618 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.72b.oxps | Bin 108011 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.72c.oxps | Bin 108008 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.73a.oxps | Bin 106480 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.73b.oxps | Bin 106625 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.74a.oxps | Bin 104771 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.74b.oxps | Bin 105454 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.74c.oxps | Bin 105675 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.75a.oxps | Bin 146656 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.75b.oxps | Bin 146976 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.75c.oxps | Bin 146399 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.75d.oxps | Bin 145829 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.76a.oxps | Bin 108053 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.77a.oxps | Bin 106368 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.77b.oxps | Bin 107928 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.7a.oxps | Bin 60527 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.7b.oxps | Bin 102923 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.7c.oxps | Bin 102929 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.80.oxps | Bin 477645 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.81.oxps | Bin 477491 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.82.oxps | Bin 469824 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.8a.oxps | Bin 103512 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.8b.oxps | Bin 104190 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M2.8c.oxps | Bin 104205 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.11a.oxps | Bin 104939 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.11b.oxps | Bin 105129 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.12a.oxps | Bin 104209 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.12b.oxps | Bin 105077 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.13a.oxps | Bin 105068 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.14a.oxps | Bin 104964 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.20a.oxps | Bin 106622 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.20b.oxps | Bin 106582 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.2a.oxps | Bin 105997 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.2b.oxps | Bin 106469 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.3a.oxps | Bin 105076 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.5a.oxps | Bin 105282 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.5b.oxps | Bin 105795 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.6a.oxps | Bin 107755 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M3.6b.oxps | Bin 113676 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M4.1a.oxps | Bin 104661 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M4.1b.oxps | Bin 105685 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M4.1c.oxps | Bin 104661 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M4.2a.oxps | Bin 106211 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M4.2b.oxps | Bin 106722 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M4.3a.oxps | Bin 105684 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.15a.oxps | Bin 106255 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.2a.oxps | Bin 104472 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.2b.oxps | Bin 104678 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.2c.oxps | Bin 104708 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.3a.oxps | Bin 105241 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.3b.oxps | Bin 105232 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.3c.oxps | Bin 105241 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.4a.oxps | Bin 109836 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.4b.oxps | Bin 110089 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M5.7a.oxps | Bin 107491 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.1a.oxps | Bin 106380 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.1b.oxps | Bin 105638 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.2a.oxps | Bin 106352 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.2b.oxps | Bin 105670 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.3a.oxps | Bin 106922 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.3b.oxps | Bin 107336 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.4a.oxps | Bin 106409 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.4b.oxps | Bin 106030 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.5a.oxps | Bin 106729 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.5b.oxps | Bin 106425 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.6a.oxps | Bin 106359 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M6.6b.oxps | Bin 106363 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M7.11a.oxps | Bin 143685 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M7.11b.oxps | Bin 142905 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M7.2a.oxps | Bin 103509 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M7.2b.oxps | Bin 104065 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M7.3a.oxps | Bin 145744 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M7.5a.oxps | Bin 103137 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M7.6a.oxps | Bin 143109 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M8.14a.oxps | Bin 524425 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M9.10a.oxps | Bin 141326 -> 0 bytes .../ConformanceViolations_oxps/OXPS/M9.10b.oxps | Bin 141476 -> 0 bytes .../OpenPackagingConventions/M1.10a.oxps | Bin 146594 -> 0 bytes .../OpenPackagingConventions/M1.10b.oxps | Bin 101375 -> 0 bytes .../OpenPackagingConventions/M1.11a.oxps | Bin 90001 -> 0 bytes .../OpenPackagingConventions/M1.12a.oxps | Bin 125552 -> 0 bytes .../OpenPackagingConventions/M1.13a.oxps | Bin 120137 -> 0 bytes .../OpenPackagingConventions/M1.13b.oxps | Bin 120018 -> 0 bytes .../OpenPackagingConventions/M1.14a.oxps | Bin 120617 -> 0 bytes .../OpenPackagingConventions/M1.14b.oxps | Bin 120571 -> 0 bytes .../OpenPackagingConventions/M1.14c.oxps | Bin 120515 -> 0 bytes .../OpenPackagingConventions/M1.15a.oxps | Bin 116371 -> 0 bytes .../OpenPackagingConventions/M1.17a.oxps | Bin 87089 -> 0 bytes .../OpenPackagingConventions/M1.17b.oxps | Bin 86179 -> 0 bytes .../OpenPackagingConventions/M1.18a.oxps | Bin 83532 -> 0 bytes .../OpenPackagingConventions/M1.18b.oxps | Bin 82355 -> 0 bytes .../OpenPackagingConventions/M1.1a.oxps | Bin 120451 -> 0 bytes .../OpenPackagingConventions/M1.20a.oxps | Bin 122057 -> 0 bytes .../OpenPackagingConventions/M1.20b.oxps | Bin 122193 -> 0 bytes .../OpenPackagingConventions/M1.21a.oxps | Bin 119692 -> 0 bytes .../OpenPackagingConventions/M1.21b.oxps | Bin 120277 -> 0 bytes .../OpenPackagingConventions/M1.22a.oxps | Bin 82619 -> 0 bytes .../OpenPackagingConventions/M1.25a.oxps | Bin 115110 -> 0 bytes .../OpenPackagingConventions/M1.26a.oxps | Bin 87726 -> 0 bytes .../OpenPackagingConventions/M1.26b.oxps | Bin 88950 -> 0 bytes .../OpenPackagingConventions/M1.27a.oxps | Bin 80693 -> 0 bytes .../OpenPackagingConventions/M1.27b.oxps | Bin 82653 -> 0 bytes .../OpenPackagingConventions/M1.28a.oxps | Bin 80925 -> 0 bytes .../OpenPackagingConventions/M1.28b.oxps | Bin 82088 -> 0 bytes .../OpenPackagingConventions/M1.2a.oxps | Bin 137277 -> 0 bytes .../OpenPackagingConventions/M1.2b.oxps | Bin 136477 -> 0 bytes .../OpenPackagingConventions/M1.2c.oxps | Bin 137609 -> 0 bytes .../OpenPackagingConventions/M1.30a.oxps | Bin 83363 -> 0 bytes .../OpenPackagingConventions/M1.30b.oxps | Bin 82894 -> 0 bytes .../OpenPackagingConventions/M1.3a.oxps | Bin 102125 -> 0 bytes .../OpenPackagingConventions/M1.5a.oxps | Bin 123720 -> 0 bytes .../OpenPackagingConventions/M1.6a.oxps | Bin 107037 -> 0 bytes .../OpenPackagingConventions/M1.6b.oxps | Bin 107452 -> 0 bytes .../OpenPackagingConventions/M1.6c.oxps | Bin 106664 -> 0 bytes .../OpenPackagingConventions/M1.6d.oxps | Bin 106686 -> 0 bytes .../OpenPackagingConventions/M1.7a.oxps | Bin 106737 -> 0 bytes .../OpenPackagingConventions/M1.7b.oxps | Bin 107048 -> 0 bytes .../OpenPackagingConventions/M1.8a.oxps | Bin 106099 -> 0 bytes .../OpenPackagingConventions/M1.8b.oxps | Bin 105504 -> 0 bytes .../OpenPackagingConventions/M1.8c.oxps | Bin 105505 -> 0 bytes .../OpenPackagingConventions/M1.9a.oxps | Bin 125830 -> 0 bytes .../OpenPackagingConventions/M2.10a.oxps | Bin 79045 -> 0 bytes .../OpenPackagingConventions/M2.18a.oxps | Bin 127465 -> 0 bytes .../OpenPackagingConventions/M2.4a.oxps | Bin 85086 -> 0 bytes .../OpenPackagingConventions/M2.5a.oxps | Bin 82164 -> 0 bytes .../OpenPackagingConventions/M2.5b.oxps | Bin 82171 -> 0 bytes .../OpenPackagingConventions/M2.6a.oxps | Bin 81169 -> 0 bytes .../OpenPackagingConventions/M2.6b.oxps | Bin 81792 -> 0 bytes .../OpenPackagingConventions/M2.7a.oxps | Bin 81348 -> 0 bytes .../OpenPackagingConventions/M2.7b.oxps | Bin 81608 -> 0 bytes .../OpenPackagingConventions/M3.10a.oxps | Bin 84347 -> 0 bytes .../OpenPackagingConventions/M3.14a.oxps | Bin 133028 -> 0 bytes .../OpenPackagingConventions/M3.9a.oxps | Bin 106930 -> 0 bytes .../OpenXPSTestFiles_EndUserLicenseAgreement.txt | 7 - .../QualityLogicMinBar_oxps/mb01.oxps | Bin 813337 -> 0 bytes .../QualityLogicMinBar_oxps/mb02.oxps | Bin 2243951 -> 0 bytes .../QualityLogicMinBar_oxps/mb03.oxps | Bin 14423522 -> 0 bytes .../QualityLogicMinBar_oxps/mb04.oxps | Bin 2116093 -> 0 bytes .../QualityLogicMinBar_oxps/mb05.oxps | Bin 4577317 -> 0 bytes .../QualityLogicMinBar_oxps/mb06.oxps | Bin 233280 -> 0 bytes .../QualityLogicMinBar_oxps/mb07.oxps | Bin 477710 -> 0 bytes .../QualityLogicMinBar_oxps/mb08.oxps | Bin 160252 -> 0 bytes .../QualityLogicMinBar_oxps/mb09.oxps | Bin 241162 -> 0 bytes print/SampleOpenXPS/README.md | 15 - print/SampleOpenXPS/SampleOpenXPS.sln | 34 - print/SampleXPS/BlankProjSrc/BlankProject.vcxproj | 194 -- .../BlankProjSrc/BlankProject.vcxproj.Filters | 17 - .../MarkupCompatibility/M1.1a.xps | Bin 281044 -> 0 bytes .../MarkupCompatibility/M1.2a.xps | Bin 281046 -> 0 bytes .../MarkupCompatibility/M2.13a.xps | Bin 281089 -> 0 bytes .../MarkupCompatibility/M2.14a.xps | Bin 281079 -> 0 bytes .../MarkupCompatibility/M2.17a.xps | Bin 281082 -> 0 bytes .../MarkupCompatibility/M2.20a.xps | Bin 281104 -> 0 bytes .../MarkupCompatibility/M2.24a.xps | Bin 281107 -> 0 bytes .../MarkupCompatibility/M2.27a.xps | Bin 281063 -> 0 bytes .../MarkupCompatibility/M2.27b.xps | Bin 281053 -> 0 bytes .../MarkupCompatibility/M2.30a.xps | Bin 281063 -> 0 bytes .../MarkupCompatibility/M2.31a.xps | Bin 281196 -> 0 bytes .../MarkupCompatibility/M2.32a.xps | Bin 281189 -> 0 bytes .../MarkupCompatibility/M2.33a.xps | Bin 281201 -> 0 bytes .../MarkupCompatibility/M2.35a.xps | Bin 281212 -> 0 bytes .../MarkupCompatibility/M2.35b.xps | Bin 281206 -> 0 bytes .../MarkupCompatibility/M2.36a.xps | Bin 281203 -> 0 bytes .../MarkupCompatibility/M2.41a.xps | Bin 281231 -> 0 bytes .../MarkupCompatibility/M2.42a.xps | Bin 281232 -> 0 bytes .../MarkupCompatibility/M2.43a.xps | Bin 281257 -> 0 bytes .../MarkupCompatibility/M2.44a.xps | Bin 281178 -> 0 bytes .../MarkupCompatibility/M2.48a.xps | Bin 281260 -> 0 bytes .../MarkupCompatibility/M2.49a.xps | Bin 281256 -> 0 bytes .../MarkupCompatibility/M2.50a.xps | Bin 281252 -> 0 bytes .../MarkupCompatibility/M2.52a.xps | Bin 281252 -> 0 bytes .../MarkupCompatibility/M2.55a.xps | Bin 281260 -> 0 bytes .../MarkupCompatibility/M2.56a.xps | Bin 281256 -> 0 bytes .../OpenPackagingConventions/M1.10a.xps | Bin 51959 -> 0 bytes .../OpenPackagingConventions/M1.11a.xps | Bin 52024 -> 0 bytes .../OpenPackagingConventions/M1.17a.xps | Bin 51970 -> 0 bytes .../OpenPackagingConventions/M1.18a.xps | Bin 51972 -> 0 bytes .../OpenPackagingConventions/M1.18b.xps | Bin 51972 -> 0 bytes .../OpenPackagingConventions/M1.1a.xps | Bin 51921 -> 0 bytes .../OpenPackagingConventions/M1.1b.xps | Bin 51927 -> 0 bytes .../OpenPackagingConventions/M1.20a.xps | Bin 51975 -> 0 bytes .../OpenPackagingConventions/M1.26a.xps | Bin 51968 -> 0 bytes .../OpenPackagingConventions/M1.26b.xps | Bin 51971 -> 0 bytes .../OpenPackagingConventions/M1.26c.xps | Bin 51969 -> 0 bytes .../OpenPackagingConventions/M1.27a.xps | Bin 51958 -> 0 bytes .../OpenPackagingConventions/M1.28a.xps | Bin 51962 -> 0 bytes .../OpenPackagingConventions/M1.2a.xps | Bin 51961 -> 0 bytes .../OpenPackagingConventions/M1.2b.xps | Bin 51957 -> 0 bytes .../OpenPackagingConventions/M1.34a.xps | Bin 51979 -> 0 bytes .../OpenPackagingConventions/M1.3a.xps | Bin 51932 -> 0 bytes .../OpenPackagingConventions/M1.5a.xps | Bin 51933 -> 0 bytes .../OpenPackagingConventions/M1.6a.xps | Bin 51934 -> 0 bytes .../OpenPackagingConventions/M1.6b.xps | Bin 51936 -> 0 bytes .../OpenPackagingConventions/M1.7a.xps | Bin 51980 -> 0 bytes .../OpenPackagingConventions/M1.7c.xps | Bin 51968 -> 0 bytes .../OpenPackagingConventions/M1.8a.xps | Bin 51971 -> 0 bytes .../OpenPackagingConventions/M2.18a.xps | Bin 52359 -> 0 bytes .../OpenPackagingConventions/M2.24a.xps | Bin 51924 -> 0 bytes .../OpenPackagingConventions/M2.5a.xps | Bin 51975 -> 0 bytes .../OpenPackagingConventions/M2.5b.xps | Bin 51974 -> 0 bytes .../OpenPackagingConventions/M2.6a.xps | Bin 51967 -> 0 bytes .../OpenPackagingConventions/M2.6b.xps | Bin 51965 -> 0 bytes .../OpenPackagingConventions/M2.7a.xps | Bin 51956 -> 0 bytes .../OpenPackagingConventions/M2.7b.xps | Bin 51950 -> 0 bytes .../OpenPackagingConventions/M3.10a.xps | Bin 57170 -> 0 bytes .../OpenPackagingConventions/M3.10b.xps | Bin 57171 -> 0 bytes .../OpenPackagingConventions/M3.10c.xps | Bin 57170 -> 0 bytes .../OpenPackagingConventions/M3.11a.xps | Bin 57167 -> 0 bytes .../OpenPackagingConventions/M3.11b.xps | Bin 57164 -> 0 bytes .../OpenPackagingConventions/M3.12a.xps | Bin 57167 -> 0 bytes .../OpenPackagingConventions/M3.12b.xps | Bin 57164 -> 0 bytes .../OpenPackagingConventions/M3.13a.xps | Bin 57169 -> 0 bytes .../OpenPackagingConventions/M3.14a.xps | Bin 57163 -> 0 bytes .../OpenPackagingConventions/M3.15a.xps | Bin 57089 -> 0 bytes .../OpenPackagingConventions/M3.16a.xps | Bin 56390 -> 0 bytes .../OpenPackagingConventions/M3.17a.xps | Bin 57117 -> 0 bytes .../OpenPackagingConventions/M3.17b.xps | Bin 57167 -> 0 bytes .../OpenPackagingConventions/M3.18a.xps | Bin 57168 -> 0 bytes .../OpenPackagingConventions/M3.1a.xps | Bin 51964 -> 0 bytes .../OpenPackagingConventions/M3.1b.xps | Bin 52382 -> 0 bytes .../OpenPackagingConventions/M3.20a.xps | Bin 57169 -> 0 bytes .../OpenPackagingConventions/M3.21a.xps | Bin 57166 -> 0 bytes .../OpenPackagingConventions/M3.21b.xps | Bin 57161 -> 0 bytes .../OpenPackagingConventions/M3.25a.xps | Bin 57164 -> 0 bytes .../OpenPackagingConventions/M3.26a.xps | Bin 57165 -> 0 bytes .../OpenPackagingConventions/M3.28a.xps | Bin 57167 -> 0 bytes .../OpenPackagingConventions/M3.29a.xps | Bin 57166 -> 0 bytes .../OpenPackagingConventions/M3.2a.xps | Bin 52018 -> 0 bytes .../OpenPackagingConventions/M3.31a.xps | Bin 57165 -> 0 bytes .../OpenPackagingConventions/M3.31b.xps | Bin 57166 -> 0 bytes .../OpenPackagingConventions/M3.32a.xps | Bin 57166 -> 0 bytes .../OpenPackagingConventions/M3.32b.xps | Bin 57165 -> 0 bytes .../OpenPackagingConventions/M3.4a.xps | Bin 57304 -> 0 bytes .../OpenPackagingConventions/M3.4b.xps | Bin 57069 -> 0 bytes .../OpenPackagingConventions/M3.5a.xps | Bin 57016 -> 0 bytes .../OpenPackagingConventions/M3.6a.xps | Bin 57023 -> 0 bytes .../OpenPackagingConventions/M3.7a.xps | Bin 57167 -> 0 bytes .../OpenPackagingConventions/M3.8a.xps | Bin 57224 -> 0 bytes .../OpenPackagingConventions/M3.9a.xps | Bin 57175 -> 0 bytes .../OpenPackagingConventions/M3.9b.xps | Bin 57181 -> 0 bytes .../OpenPackagingConventions/M3.9c.xps | Bin 57169 -> 0 bytes .../OpenPackagingConventions/M4.1a.xps | Bin 51970 -> 0 bytes .../OpenPackagingConventions/M4.2a.xps | Bin 51971 -> 0 bytes .../OpenPackagingConventions/M4.3a.xps | Bin 51975 -> 0 bytes .../OpenPackagingConventions/M6.1a.xps | Bin 55529 -> 0 bytes .../OpenPackagingConventions/M6.2a.xps | Bin 55529 -> 0 bytes .../OpenPackagingConventions/M6.4a.xps | Bin 55529 -> 0 bytes .../OpenPackagingConventions/M6.6a.xps | Bin 55529 -> 0 bytes .../OpenPackagingConventions/M6.7a.xps | Bin 55529 -> 0 bytes .../OpenPackagingConventions/M6.8a.xps | Bin 55529 -> 0 bytes .../OpenPackagingConventions/M7.2a.xps | Bin 51976 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M1.2a.xps | Bin 306 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M12.2a.xps | Bin 79569 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M12.3b.xps | Bin 157979 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M12.5a.xps | Bin 7172 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M12.7a.xps | Bin 79569 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.10a.xps | Bin 52433 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.13a.xps | Bin 52452 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.13b.xps | Bin 55919 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.14a.xps | Bin 52502 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.18a.xps | Bin 1621196 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.25a.xps | Bin 9501586 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.36a.xps | Bin 81864 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.37a.xps | Bin 84470 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.3a.xps | Bin 52234 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.3b.xps | Bin 52452 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.3c.xps | Bin 55919 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.4a.xps | Bin 52180 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.4b.xps | Bin 52419 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.59a.xps | Bin 5266 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.5a.xps | Bin 51800 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.5b.xps | Bin 52373 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.6a.xps | Bin 5839 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.6b.xps | Bin 52382 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.71a.xps | Bin 79658 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.71b.xps | Bin 79650 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.71c.xps | Bin 79761 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.73a.xps | Bin 79606 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.73b.xps | Bin 79624 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.74a.xps | Bin 13699 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.75a.xps | Bin 79578 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.75b.xps | Bin 79583 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M2.76a.xps | Bin 79563 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M3.2a.xps | Bin 52499 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M3.3a.xps | Bin 52464 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M3.5a.xps | Bin 52457 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M3.6a.xps | Bin 55591 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M3.6b.xps | Bin 52463 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M4.3a.xps | Bin 2396 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M5.15a.xps | Bin 37130 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M5.2a.xps | Bin 26289 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M5.2b.xps | Bin 26292 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M5.4a.xps | Bin 26348 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M5.4b.xps | Bin 26340 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M5.7a.xps | Bin 13158 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M6.2a.xps | Bin 79597 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M6.3a.xps | Bin 13735 -> 0 bytes .../SampleXPS/ConformanceViolations/XPS/M7.5a.xps | Bin 19114 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb01.xps | Bin 813339 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb02.xps | Bin 2243925 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb03.xps | Bin 14423371 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb04.xps | Bin 2115955 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb05.xps | Bin 4577346 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb06.xps | Bin 231855 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb07.xps | Bin 468479 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb08.xps | Bin 160268 -> 0 bytes print/SampleXPS/QualityLogicMinBar/mb09.xps | Bin 236946 -> 0 bytes print/SampleXPS/README.md | 15 - print/SampleXPS/SampleXPS.sln | 34 - .../XPSTestFiles_EndUserLicenseAgreement.txt | 7 - print/SimplePipelineFilter/FilterSample.def | 8 - print/SimplePipelineFilter/FilterSample.rc | 10 - print/SimplePipelineFilter/README.md | 19 - .../SimplePipelineFilter/SimplePipelineFilter.sln | 34 - print/SimplePipelineFilter/StreamFilter.cxx | 263 -- print/SimplePipelineFilter/StreamFilter.hxx | 99 - .../SimplePipelineFilter/WdkPipelineFilter.vcxproj | 407 --- .../WdkPipelineFilter.vcxproj.Filters | 91 - print/SimplePipelineFilter/XpsFilter.cxx | 785 ------ print/SimplePipelineFilter/XpsFilter.hxx | 126 - print/SimplePipelineFilter/main.cxx | 172 -- print/SimplePipelineFilter/main.hxx | 51 - print/SimplePipelineFilter/precomp.hxx | 26 - print/SimplePipelineFilter/precompsrc.cpp | 1 - print/SimplePipelineFilter/smartptr.hxx | 233 -- print/SimplePipelineFilter/trace.hxx | 51 - print/XPSDrvSmpl/Package/package.VcxProj | 161 -- print/XPSDrvSmpl/Package/package.VcxProj.Filters | 21 - print/XPSDrvSmpl/README.md | 292 -- print/XPSDrvSmpl/XPSDrvSmpl.sln | 268 -- print/XPSDrvSmpl/install/xdCMYKPrinter.icc | Bin 849080 -> 0 bytes print/XPSDrvSmpl/install/xdbook.gpd | 87 - print/XPSDrvSmpl/install/xdcolman.gpd | 106 - print/XPSDrvSmpl/install/xdnames.gpd | 151 - print/XPSDrvSmpl/install/xdnup.gpd | 207 -- print/XPSDrvSmpl/install/xdpgscl.gpd | 117 - print/XPSDrvSmpl/install/xdsmpl-PipelineConfig.xml | 55 - print/XPSDrvSmpl/install/xdsmpl.gpd | 467 ---- print/XPSDrvSmpl/install/xdsmpl.inf | Bin 7036 -> 0 bytes print/XPSDrvSmpl/install/xdsmpl.ini | 22 - print/XPSDrvSmpl/install/xdwmark.gpd | 67 - print/XPSDrvSmpl/install/xdwscRGB.icc | Bin 124856 -> 0 bytes print/XPSDrvSmpl/src/common/bkdata.h | 46 - print/XPSDrvSmpl/src/common/bkpchndlr.cpp | 201 -- print/XPSDrvSmpl/src/common/bkpchndlr.h | 41 - print/XPSDrvSmpl/src/common/bkpthndlr.cpp | 318 --- print/XPSDrvSmpl/src/common/bkpthndlr.h | 55 - print/XPSDrvSmpl/src/common/bkschema.cpp | 51 - print/XPSDrvSmpl/src/common/bkschema.h | 77 - print/XPSDrvSmpl/src/common/cmdata.h | 42 - print/XPSDrvSmpl/src/common/cmintentsdata.h | 42 - print/XPSDrvSmpl/src/common/cmintentsschema.cpp | 34 - print/XPSDrvSmpl/src/common/cmintentsschema.h | 55 - print/XPSDrvSmpl/src/common/cmintpthndlr.cpp | 156 -- print/XPSDrvSmpl/src/common/cmintpthndlr.h | 43 - print/XPSDrvSmpl/src/common/cmprofiledata.h | 44 - print/XPSDrvSmpl/src/common/cmprofileschema.cpp | 49 - print/XPSDrvSmpl/src/common/cmprofileschema.h | 60 - print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp | 179 -- print/XPSDrvSmpl/src/common/cmprofpchndlr.h | 42 - print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp | 206 -- print/XPSDrvSmpl/src/common/cmprofpthndlr.h | 51 - print/XPSDrvSmpl/src/common/cmpthndlr.cpp | 154 -- print/XPSDrvSmpl/src/common/cmpthndlr.h | 46 - print/XPSDrvSmpl/src/common/cmschema.cpp | 34 - print/XPSDrvSmpl/src/common/cmschema.h | 55 - print/XPSDrvSmpl/src/common/globals.cpp | 237 -- print/XPSDrvSmpl/src/common/globals.h | 102 - print/XPSDrvSmpl/src/common/nupchndlr.cpp | 196 -- print/XPSDrvSmpl/src/common/nupchndlr.h | 41 - print/XPSDrvSmpl/src/common/nupdata.h | 46 - print/XPSDrvSmpl/src/common/nupschema.cpp | 46 - print/XPSDrvSmpl/src/common/nupschema.h | 77 - print/XPSDrvSmpl/src/common/nupthndlr.cpp | 309 --- print/XPSDrvSmpl/src/common/nupthndlr.h | 53 - print/XPSDrvSmpl/src/common/pchndlr.cpp | 640 ----- print/XPSDrvSmpl/src/common/pchndlr.h | 91 - print/XPSDrvSmpl/src/common/pgscdata.h | 52 - print/XPSDrvSmpl/src/common/pgscpchndlr.cpp | 349 --- print/XPSDrvSmpl/src/common/pgscpchndlr.h | 41 - print/XPSDrvSmpl/src/common/pgscpthndlr.cpp | 479 ---- print/XPSDrvSmpl/src/common/pgscpthndlr.h | 55 - print/XPSDrvSmpl/src/common/pgscschema.cpp | 64 - print/XPSDrvSmpl/src/common/pgscschema.h | 112 - print/XPSDrvSmpl/src/common/pimagedata.h | 52 - print/XPSDrvSmpl/src/common/pimagepthndlr.cpp | 171 -- print/XPSDrvSmpl/src/common/pimagepthndlr.h | 42 - print/XPSDrvSmpl/src/common/pimageschema.cpp | 40 - print/XPSDrvSmpl/src/common/pimageschema.h | 62 - print/XPSDrvSmpl/src/common/porientdata.h | 42 - print/XPSDrvSmpl/src/common/porientpthndlr.cpp | 150 - print/XPSDrvSmpl/src/common/porientpthndlr.h | 45 - print/XPSDrvSmpl/src/common/porientschema.cpp | 34 - print/XPSDrvSmpl/src/common/porientschema.h | 55 - print/XPSDrvSmpl/src/common/precomp.h | 102 - print/XPSDrvSmpl/src/common/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/common/privatedefs.h | 300 -- print/XPSDrvSmpl/src/common/pshndlr.cpp | 1836 ------------- print/XPSDrvSmpl/src/common/pshndlr.h | 218 -- print/XPSDrvSmpl/src/common/psizedata.h | 44 - print/XPSDrvSmpl/src/common/psizepthndlr.cpp | 136 - print/XPSDrvSmpl/src/common/psizepthndlr.h | 45 - print/XPSDrvSmpl/src/common/psizeschema.cpp | 32 - print/XPSDrvSmpl/src/common/psizeschema.h | 55 - print/XPSDrvSmpl/src/common/pthndlr.cpp | 1385 ---------- print/XPSDrvSmpl/src/common/pthndlr.h | 178 -- print/XPSDrvSmpl/src/common/ptquerybld.cpp | 516 ---- print/XPSDrvSmpl/src/common/ptquerybld.h | 84 - print/XPSDrvSmpl/src/common/schema.cpp | 70 - print/XPSDrvSmpl/src/common/schema.h | 94 - print/XPSDrvSmpl/src/common/wmdata.h | 71 - print/XPSDrvSmpl/src/common/wmpchndlr.cpp | 555 ---- print/XPSDrvSmpl/src/common/wmpchndlr.h | 41 - print/XPSDrvSmpl/src/common/wmpthndlr.cpp | 1167 -------- print/XPSDrvSmpl/src/common/wmpthndlr.h | 116 - print/XPSDrvSmpl/src/common/wmschema.cpp | 60 - print/XPSDrvSmpl/src/common/wmschema.h | 114 - print/XPSDrvSmpl/src/common/workbuff.cpp | 233 -- print/XPSDrvSmpl/src/common/workbuff.h | 51 - print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj | 593 ---- .../src/common/xdsmplcmn.vcxproj.Filters | 2230 --------------- print/XPSDrvSmpl/src/debug/debug.cpp | 189 -- print/XPSDrvSmpl/src/debug/debug.h | 186 -- print/XPSDrvSmpl/src/debug/precomp.h | 67 - print/XPSDrvSmpl/src/debug/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj | 343 --- print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters | 33 - print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp | 591 ---- print/XPSDrvSmpl/src/filters/booklet/bkflt.h | 80 - print/XPSDrvSmpl/src/filters/booklet/bkflt.rc | 43 - print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp | 124 - print/XPSDrvSmpl/src/filters/booklet/bkprps.h | 52 - print/XPSDrvSmpl/src/filters/booklet/bksax.cpp | 285 -- print/XPSDrvSmpl/src/filters/booklet/bksax.h | 59 - print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp | 143 - .../XPSDrvSmpl/src/filters/booklet/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/filters/booklet/xdbook.def | 26 - .../XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj | 540 ---- .../src/filters/booklet/xdbook.vcxproj.Filters | 65 - print/XPSDrvSmpl/src/filters/color/XDColMan.def | 26 - .../XPSDrvSmpl/src/filters/color/XDColMan.vcxproj | 614 ----- .../src/filters/color/XDColMan.vcxproj.Filters | 329 --- print/XPSDrvSmpl/src/filters/color/bmpconv.cpp | 1187 -------- print/XPSDrvSmpl/src/filters/color/bmpconv.h | 168 -- print/XPSDrvSmpl/src/filters/color/bmpdata.cpp | 253 -- print/XPSDrvSmpl/src/filters/color/bmpdata.h | 768 ------ print/XPSDrvSmpl/src/filters/color/cmflt.cpp | 264 -- print/XPSDrvSmpl/src/filters/color/cmflt.h | 51 - print/XPSDrvSmpl/src/filters/color/cmflt.rc | 43 - print/XPSDrvSmpl/src/filters/color/cmimg.cpp | 856 ------ print/XPSDrvSmpl/src/filters/color/cmimg.h | 87 - print/XPSDrvSmpl/src/filters/color/cmsax.cpp | 440 --- print/XPSDrvSmpl/src/filters/color/cmsax.h | 80 - print/XPSDrvSmpl/src/filters/color/colchan.cpp | 1883 ------------- print/XPSDrvSmpl/src/filters/color/colchan.h | 289 -- print/XPSDrvSmpl/src/filters/color/colconv.cpp | 1138 -------- print/XPSDrvSmpl/src/filters/color/colconv.h | 167 -- print/XPSDrvSmpl/src/filters/color/dictionary.cpp | 289 -- print/XPSDrvSmpl/src/filters/color/dictionary.h | 65 - print/XPSDrvSmpl/src/filters/color/dllentry.cpp | 145 - print/XPSDrvSmpl/src/filters/color/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/filters/color/profile.cpp | 709 ----- print/XPSDrvSmpl/src/filters/color/profile.h | 124 - print/XPSDrvSmpl/src/filters/color/profman.cpp | 818 ------ print/XPSDrvSmpl/src/filters/color/profman.h | 126 - print/XPSDrvSmpl/src/filters/color/scaniter.cpp | 604 ---- print/XPSDrvSmpl/src/filters/color/scaniter.h | 218 -- print/XPSDrvSmpl/src/filters/color/transform.cpp | 666 ----- print/XPSDrvSmpl/src/filters/color/transform.h | 83 - print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp | 813 ------ print/XPSDrvSmpl/src/filters/color/wcsapiconv.h | 280 -- print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp | 751 ----- print/XPSDrvSmpl/src/filters/color/wictobmscn.h | 88 - print/XPSDrvSmpl/src/filters/common/clasfact.h | 202 -- print/XPSDrvSmpl/src/filters/common/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/filters/common/ptmanage.cpp | 1216 -------- print/XPSDrvSmpl/src/filters/common/ptmanage.h | 153 -- print/XPSDrvSmpl/src/filters/common/rescache.cpp | 309 --- print/XPSDrvSmpl/src/filters/common/rescache.h | 132 - print/XPSDrvSmpl/src/filters/common/rescpy.cpp | 132 - print/XPSDrvSmpl/src/filters/common/rescpy.h | 40 - print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp | 586 ---- print/XPSDrvSmpl/src/filters/common/saxhndlr.h | 129 - print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp | 199 -- print/XPSDrvSmpl/src/filters/common/widetoutf8.h | 48 - .../XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj | 561 ---- .../src/filters/common/xdfltcmn.vcxproj.Filters | 163 -- print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp | 508 ---- print/XPSDrvSmpl/src/filters/common/xdrchflt.h | 86 - print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp | 319 --- print/XPSDrvSmpl/src/filters/common/xdsmplflt.h | 77 - print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp | 351 --- print/XPSDrvSmpl/src/filters/common/xdstrmflt.h | 63 - print/XPSDrvSmpl/src/filters/nup/dllentry.cpp | 144 - print/XPSDrvSmpl/src/filters/nup/nupflt.cpp | 476 ---- print/XPSDrvSmpl/src/filters/nup/nupflt.h | 88 - print/XPSDrvSmpl/src/filters/nup/nupflt.rc | 43 - print/XPSDrvSmpl/src/filters/nup/nuppage.cpp | 581 ---- print/XPSDrvSmpl/src/filters/nup/nuppage.h | 107 - print/XPSDrvSmpl/src/filters/nup/nupsax.cpp | 522 ---- print/XPSDrvSmpl/src/filters/nup/nupsax.h | 76 - print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp | 449 --- print/XPSDrvSmpl/src/filters/nup/nuptprps.h | 97 - print/XPSDrvSmpl/src/filters/nup/nupxform.cpp | 623 ----- print/XPSDrvSmpl/src/filters/nup/nupxform.h | 101 - print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/filters/nup/xdnup.def | 26 - print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj | 552 ---- .../src/filters/nup/xdnup.vcxproj.Filters | 95 - print/XPSDrvSmpl/src/filters/precomp.h | 110 - print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp | 144 - print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp | 761 ------ print/XPSDrvSmpl/src/filters/scaling/pagescale.h | 107 - .../XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp | 478 ---- print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h | 91 - .../XPSDrvSmpl/src/filters/scaling/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp | 253 -- print/XPSDrvSmpl/src/filters/scaling/scaleflt.h | 56 - print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc | 43 - print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp | 591 ---- print/XPSDrvSmpl/src/filters/scaling/scalesax.h | 75 - print/XPSDrvSmpl/src/filters/scaling/xdscale.def | 26 - .../XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj | 578 ---- .../src/filters/scaling/xdscale.vcxproj.Filters | 79 - print/XPSDrvSmpl/src/filters/watermark/Raster1.png | Bin 67501 -> 0 bytes print/XPSDrvSmpl/src/filters/watermark/Vector1.xps | Bin 1724 -> 0 bytes .../XPSDrvSmpl/src/filters/watermark/dllentry.cpp | 143 - .../src/filters/watermark/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp | 416 --- print/XPSDrvSmpl/src/filters/watermark/wmbase.h | 95 - print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp | 340 --- print/XPSDrvSmpl/src/filters/watermark/wmflt.h | 54 - print/XPSDrvSmpl/src/filters/watermark/wmflt.rc | 54 - print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp | 413 --- print/XPSDrvSmpl/src/filters/watermark/wmfont.h | 82 - print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp | 503 ---- print/XPSDrvSmpl/src/filters/watermark/wmimg.h | 90 - .../XPSDrvSmpl/src/filters/watermark/wmptprop.cpp | 683 ----- print/XPSDrvSmpl/src/filters/watermark/wmptprop.h | 103 - print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp | 271 -- print/XPSDrvSmpl/src/filters/watermark/wmrast.h | 58 - print/XPSDrvSmpl/src/filters/watermark/wmres.h | 27 - print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp | 427 --- print/XPSDrvSmpl/src/filters/watermark/wmsax.h | 74 - print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp | 250 -- print/XPSDrvSmpl/src/filters/watermark/wmtext.h | 57 - print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp | 279 -- print/XPSDrvSmpl/src/filters/watermark/wmvect.h | 62 - print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp | 291 -- print/XPSDrvSmpl/src/filters/watermark/wmxps.h | 60 - print/XPSDrvSmpl/src/filters/watermark/xdwmark.def | 26 - .../src/filters/watermark/xdwmark.vcxproj | 582 ---- .../src/filters/watermark/xdwmark.vcxproj.Filters | 233 -- print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj | 473 ---- .../src/filters/xdcont/xdcont.vcxproj.Filters | 163 -- print/XPSDrvSmpl/src/filters/xdcont/xps.h | 83 - print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp | 639 ----- print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h | 91 - print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp | 285 -- print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h | 60 - print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp | 285 -- print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h | 61 - print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp | 679 ----- print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h | 119 - print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp | 291 -- print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h | 76 - print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp | 916 ------- print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h | 137 - print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp | 419 --- print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h | 70 - print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp | 417 --- print/XPSDrvSmpl/src/filters/xdcont/xpstype.h | 63 - print/XPSDrvSmpl/src/inc/cunknown.h | 212 -- print/XPSDrvSmpl/src/inc/gdip.h | 121 - print/XPSDrvSmpl/src/inc/ipkarch.h | 230 -- print/XPSDrvSmpl/src/inc/ipkfile.h | 128 - print/XPSDrvSmpl/src/inc/streamcnv.h | 593 ---- print/XPSDrvSmpl/src/inc/xdexcept.h | 104 - print/XPSDrvSmpl/src/inc/xdstring.h | 2889 -------------------- print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp | 433 --- print/XPSDrvSmpl/src/ui/bkdmptcnv.h | 84 - print/XPSDrvSmpl/src/ui/colctrls.cpp | 371 --- print/XPSDrvSmpl/src/ui/colctrls.h | 83 - print/XPSDrvSmpl/src/ui/coldmptcnv.cpp | 395 --- print/XPSDrvSmpl/src/ui/coldmptcnv.h | 76 - print/XPSDrvSmpl/src/ui/colppg.cpp | 160 -- print/XPSDrvSmpl/src/ui/colppg.h | 42 - print/XPSDrvSmpl/src/ui/devmode.h | 82 - print/XPSDrvSmpl/src/ui/dllentry.cpp | 175 -- print/XPSDrvSmpl/src/ui/docppg.cpp | 1314 --------- print/XPSDrvSmpl/src/ui/docppg.h | 186 -- print/XPSDrvSmpl/src/ui/ftrctrls.cpp | 1667 ----------- print/XPSDrvSmpl/src/ui/ftrctrls.h | 288 -- print/XPSDrvSmpl/src/ui/ftrdmptcnv.h | 631 ----- print/XPSDrvSmpl/src/ui/ftrppg.cpp | 270 -- print/XPSDrvSmpl/src/ui/ftrppg.h | 42 - print/XPSDrvSmpl/src/ui/nupptcnv.cpp | 477 ---- print/XPSDrvSmpl/src/ui/nupptcnv.h | 86 - print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp | 468 ---- print/XPSDrvSmpl/src/ui/pgscdmptcnv.h | 76 - print/XPSDrvSmpl/src/ui/precomp.h | 103 - print/XPSDrvSmpl/src/ui/precompsrc.cpp | 1 - print/XPSDrvSmpl/src/ui/resource.h | 232 -- print/XPSDrvSmpl/src/ui/uictrl.cpp | 2117 -------------- print/XPSDrvSmpl/src/ui/uictrl.h | 405 --- print/XPSDrvSmpl/src/ui/uiproperties.cpp | 783 ------ print/XPSDrvSmpl/src/ui/uiproperties.h | 111 - print/XPSDrvSmpl/src/ui/wmctrls.cpp | 1381 ---------- print/XPSDrvSmpl/src/ui/wmctrls.h | 259 -- print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp | 591 ---- print/XPSDrvSmpl/src/ui/wmdmptcnv.h | 75 - print/XPSDrvSmpl/src/ui/wmppg.cpp | 268 -- print/XPSDrvSmpl/src/ui/wmppg.h | 42 - print/XPSDrvSmpl/src/ui/xdsmplcf.cpp | 192 -- print/XPSDrvSmpl/src/ui/xdsmplcf.h | 56 - print/XPSDrvSmpl/src/ui/xdsmpldlg.rc | 326 --- print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp | 891 ------ print/XPSDrvSmpl/src/ui/xdsmplptprov.h | 124 - print/XPSDrvSmpl/src/ui/xdsmplui.cpp | 1018 ------- print/XPSDrvSmpl/src/ui/xdsmplui.def | 23 - print/XPSDrvSmpl/src/ui/xdsmplui.h | 161 -- print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj | 582 ---- print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters | 611 ----- print/XpsRasFilter/README.md | 43 - print/XpsRasFilter/XpsRasFilter.sln | 34 - .../install/xpsrassmpl-PipelineConfig.xml | 32 - print/XpsRasFilter/install/xpsrassmpl.gpd | 342 --- print/XpsRasFilter/install/xpsrassmpl.inf | Bin 4440 -> 0 bytes print/XpsRasFilter/src/BitmapHandler.cpp | 361 --- print/XpsRasFilter/src/BitmapHandler.h | 64 - print/XpsRasFilter/src/Exception.cpp | 43 - print/XpsRasFilter/src/Exception.h | 86 - print/XpsRasFilter/src/OMConvertor.cpp | 774 ------ print/XpsRasFilter/src/OMConvertor.h | 90 - print/XpsRasFilter/src/PThandler.cpp | 781 ------ print/XpsRasFilter/src/PThandler.h | 112 - print/XpsRasFilter/src/UnknownBase.h | 158 -- print/XpsRasFilter/src/WppTrace.cpp | 41 - print/XpsRasFilter/src/WppTrace.h | 58 - print/XpsRasFilter/src/dllentry.cpp | 326 --- print/XpsRasFilter/src/filtertypes.h | 497 ---- print/XpsRasFilter/src/precomp.h | 87 - print/XpsRasFilter/src/precompsrc.cpp | 1 - print/XpsRasFilter/src/rasinterface.cpp | 412 --- print/XpsRasFilter/src/rasinterface.h | 107 - print/XpsRasFilter/src/xpsrasfilter.cpp | 396 --- print/XpsRasFilter/src/xpsrasfilter.def | 22 - print/XpsRasFilter/src/xpsrasfilter.h | 141 - print/XpsRasFilter/src/xpsrasfilter.rc | 28 - print/XpsRasFilter/src/xpsrasfilter.vcxproj | 454 --- .../XpsRasFilter/src/xpsrasfilter.vcxproj.Filters | 178 -- print/autoconfig/ACnfgPS.gdl | 100 - print/autoconfig/ACnfgUni.GDL | 111 - print/autoconfig/AutoCnfg.GPD | 733 ----- print/autoconfig/AutoCnfg.PPD | 479 ---- print/autoconfig/AutoCnfg.inf | Bin 6140 -> 0 bytes print/autoconfig/AutoConfig.htm | 367 --- print/autoconfig/AutoConfig.sln | 61 - print/autoconfig/AutoConfig.vcxproj | 219 -- print/autoconfig/AutoConfig.vcxproj.Filters | 33 - print/autoconfig/Package/package.VcxProj | 118 - print/autoconfig/Package/package.VcxProj.Filters | 21 - print/autoconfig/README.md | 46 - print/cpsuisam/CPSUIDAT.C | 1331 --------- print/cpsuisam/CPSUIDAT.H | 73 - print/cpsuisam/CPSUISAM.DEF | 6 - print/cpsuisam/CPSUISAM.DLG | 35 - print/cpsuisam/CPSUISAM.H | 37 - print/cpsuisam/DEBUG.C | 114 - print/cpsuisam/DEBUG.H | 66 - print/cpsuisam/PRECOMP.H | 17 - print/cpsuisam/README.md | 21 - print/cpsuisam/cpsuisam.c | 665 ----- print/cpsuisam/cpsuisam.sln | 34 - print/cpsuisam/cpsuisam.vcxproj | 352 --- print/cpsuisam/cpsuisam.vcxproj.Filters | 70 - print/cpsuisam/icons/apple.ico | Bin 1078 -> 0 bytes print/cpsuisam/icons/cpsuisam.ico | Bin 1078 -> 0 bytes print/cpsuisam/precompsrc.c | 1 - print/cpsuisam/res.rc | 51 - .../ExtensionSample/App.xaml | 7 - .../ExtensionSample/App.xaml.cs | 146 - .../ExtensionSample/BidiHelper.cs | 154 -- .../ExtensionSample/Fabrikam_Logo.png | Bin 2589 -> 0 bytes .../ExtensionSample/PrintPreferenceWindow.xaml | 147 - .../ExtensionSample/PrintPreferenceWindow.xaml.cs | 467 ---- .../ExtensionSample/PrintSchemaHelper.cs | 190 -- .../ExtensionSample/PrinterExtensionSample.csproj | 285 -- .../ExtensionSample/Properties/AssemblyInfo.cs | 62 - .../Properties/Resources.Designer.cs | 63 - .../ExtensionSample/Properties/Resources.resx | 117 - .../Properties/Settings.Designer.cs | 26 - .../ExtensionSample/Properties/Settings.settings | 7 - .../ExtensionSample/Strings.Designer.cs | 82 - .../ExtensionSample/Strings.resx | 129 - .../ExtensionSample/ValidationModalDialog.xaml | 19 - .../ExtensionSample/ValidationModalDialog.xaml.cs | 108 - .../ExtensionSample/WindowHelper.cs | 83 - .../ExtensionSample/app.config | 9 - .../ExtensionSample/bidi_Ink_mock.xml | 74 - .../PrinterExtensionAdapters.cs | 2051 -------------- .../PrinterExtensionLibrary.csproj | 101 - .../PrinterExtensionManager.cs | 121 - .../PrinterExtensionTypes.cs | 921 ------- .../Properties/AssemblyInfo.cs | 33 - .../PrinterExtensionSample.sln | 149 - .../PrinterExtensionSample/README.md | 22 - .../ConstraintScript.js | 679 ----- .../ConstraintScript.sln | 34 - .../ConstraintScript.vcxproj | 209 -- .../ConstraintScript.vcxproj.Filters | 21 - .../v4PrintDriver-ConstraintScript/README.md | 32 - .../v4PrintDriver-Intellisense-Windows8.1.js | 126 - .../v4PrintDriver-Intellisense.js | 513 ---- .../HostBasedSampleDriver.sln | 53 - .../HostBasedSampleDriver.vcxproj | 221 -- .../HostBasedSampleDriver.vcxproj.Filters | 41 - .../Package/package.VcxProj | 128 - .../Package/package.VcxProj.Filters | 21 - .../v4PrintDriver-HostBasedSampleDriver/README.md | 67 - .../usb_host_based_sample-manifest.ini | 13 - .../usb_host_based_sample-pipelineconfig.xml | 1 - .../usb_host_based_sample.gpd | 138 - .../usb_host_based_sample.inf | Bin 5802 -> 0 bytes .../usb_host_based_sample.js | Bin 35004 -> 0 bytes .../usb_host_based_sample_events.xml | 11 - .../usb_host_based_sample_extension.xml | 8 - .../v4PrintDriver-Intellisense-Windows8.1.js | 126 - .../v4PrintDriver-Intellisense.js | 513 ---- .../v4PrintDriver-USBMon-Bidi-Extension/README.md | 48 - .../USBMon-Bidi-Extension.js | Bin 34662 -> 0 bytes .../USBMon-Bidi-Extension.sln | 34 - .../USBMon-Bidi-Extension.vcxproj | 210 -- .../USBMon-Bidi-Extension.vcxproj.Filters | 26 - .../USBMon-Bidi-Extension.xml | 24 - .../v4PrintDriver-Intellisense-Windows8.1.js | 126 - .../v4PrintDriver-Intellisense.js | 513 ---- .../v4PrintDriver-WSDMon-Bidi-Extension/README.md | 55 - .../WSDMon-Bidi-Extension.sln | 34 - .../WSDMon-Bidi-Extension.vcxproj | 203 -- .../WSDMon-Bidi-Extension.vcxproj.Filters | 26 - .../WSDMon-Bidi-Extension.xml | 79 - 1141 files changed, 5 insertions(+), 187090 deletions(-) delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/CUSTOMDRV.HLP delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/OEMUI.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/psuirep.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/debug.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/dllentry.cxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.cxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.cxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oem.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.cxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precomp.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.cxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.cxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.hxx delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SyncSet.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oem.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/SyncSet/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/OEMUI.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUI.Manifest delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oem.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/themeuismpl.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/WMarkPS.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/WMarkUni.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/ddihook.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/bitmap/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.cnt delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.hpj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.rtf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/custhlp/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oem.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oem.ppd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemdll.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemdll.sln delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean.htm delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/ddihook.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemprean/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/command.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/command.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/ddihook.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemps/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemui/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/ddihook.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/oemuni/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/psuirep.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/syncset.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/syncset.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/themeui.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uisamples.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.gpd delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.ini delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/common/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/common/oem.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/drawmark.ps delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/fdevmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmark.ps delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmarkps.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/fdevmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/debug.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/oem.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/fdevmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkuniui.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj.Filters delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/ddihook.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/dllentry.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/fdevmode.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/name.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precomp.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precompsrc.cpp delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/resource.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.def delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.h delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.rc delete mode 100644 print/OEM Printer Customization Plug-in Samples/C++/winxp.inf delete mode 100644 print/OEM Printer Customization Plug-in Samples/README.md delete mode 100644 print/OEM Printer Customization Plug-in Samples/license.rtf create mode 100644 print/README.md delete mode 100644 print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj delete mode 100644 print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj.Filters delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.1a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.14a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.17a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.20a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.24a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.30a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.31a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.32a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.33a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.35a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.44a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.48a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.50a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.52a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.55a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.56a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M1.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.23a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.7a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.17a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.18a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.25a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.35a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.36a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.37a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.54a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.70a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75d.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.76a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.80.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.81.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.82.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.13a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.14a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.15a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.7a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.5a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.6a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M8.14a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.11a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.12a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.15a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.1a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.22a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.25a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.3a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.5a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6d.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8c.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.9a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.10a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.18a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.4a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7b.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.10a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.14a.oxps delete mode 100644 print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.9a.oxps delete mode 100644 print/SampleOpenXPS/OpenXPSTestFiles_EndUserLicenseAgreement.txt delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb01.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb02.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb03.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb04.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb05.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb06.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb07.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb08.oxps delete mode 100644 print/SampleOpenXPS/QualityLogicMinBar_oxps/mb09.oxps delete mode 100644 print/SampleOpenXPS/README.md delete mode 100644 print/SampleOpenXPS/SampleOpenXPS.sln delete mode 100644 print/SampleXPS/BlankProjSrc/BlankProject.vcxproj delete mode 100644 print/SampleXPS/BlankProjSrc/BlankProject.vcxproj.Filters delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.1a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.13a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.14a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.17a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.20a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.24a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.30a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.31a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.32a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.33a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.36a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.41a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.42a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.43a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.44a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.48a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.49a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.50a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.52a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.55a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.56a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.10a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.11a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.17a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.20a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26c.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.27a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.28a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.34a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.3a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.5a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7c.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.8a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.18a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.24a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10c.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.13a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.14a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.15a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.16a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.18a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.20a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.25a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.26a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.28a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.29a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.5a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.6a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.7a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.8a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9c.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.1a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.3a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.1a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.4a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.6a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.7a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.8a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M7.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M1.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M12.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M12.3b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M12.5a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M12.7a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.10a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.13a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.13b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.14a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.18a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.25a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.36a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.37a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.3a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.3b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.3c.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.4a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.4b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.59a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.5a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.5b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.6a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.6b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.71a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.71b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.71c.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.73a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.73b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.74a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.75a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.75b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M2.76a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M3.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M3.3a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M3.5a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M3.6a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M3.6b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M4.3a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M5.15a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M5.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M5.2b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M5.4a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M5.4b.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M5.7a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M6.2a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M6.3a.xps delete mode 100644 print/SampleXPS/ConformanceViolations/XPS/M7.5a.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb01.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb02.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb03.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb04.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb05.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb06.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb07.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb08.xps delete mode 100644 print/SampleXPS/QualityLogicMinBar/mb09.xps delete mode 100644 print/SampleXPS/README.md delete mode 100644 print/SampleXPS/SampleXPS.sln delete mode 100644 print/SampleXPS/XPSTestFiles_EndUserLicenseAgreement.txt delete mode 100644 print/SimplePipelineFilter/FilterSample.def delete mode 100644 print/SimplePipelineFilter/FilterSample.rc delete mode 100644 print/SimplePipelineFilter/README.md delete mode 100644 print/SimplePipelineFilter/SimplePipelineFilter.sln delete mode 100644 print/SimplePipelineFilter/StreamFilter.cxx delete mode 100644 print/SimplePipelineFilter/StreamFilter.hxx delete mode 100644 print/SimplePipelineFilter/WdkPipelineFilter.vcxproj delete mode 100644 print/SimplePipelineFilter/WdkPipelineFilter.vcxproj.Filters delete mode 100644 print/SimplePipelineFilter/XpsFilter.cxx delete mode 100644 print/SimplePipelineFilter/XpsFilter.hxx delete mode 100644 print/SimplePipelineFilter/main.cxx delete mode 100644 print/SimplePipelineFilter/main.hxx delete mode 100644 print/SimplePipelineFilter/precomp.hxx delete mode 100644 print/SimplePipelineFilter/precompsrc.cpp delete mode 100644 print/SimplePipelineFilter/smartptr.hxx delete mode 100644 print/SimplePipelineFilter/trace.hxx delete mode 100644 print/XPSDrvSmpl/Package/package.VcxProj delete mode 100644 print/XPSDrvSmpl/Package/package.VcxProj.Filters delete mode 100644 print/XPSDrvSmpl/README.md delete mode 100644 print/XPSDrvSmpl/XPSDrvSmpl.sln delete mode 100644 print/XPSDrvSmpl/install/xdCMYKPrinter.icc delete mode 100644 print/XPSDrvSmpl/install/xdbook.gpd delete mode 100644 print/XPSDrvSmpl/install/xdcolman.gpd delete mode 100644 print/XPSDrvSmpl/install/xdnames.gpd delete mode 100644 print/XPSDrvSmpl/install/xdnup.gpd delete mode 100644 print/XPSDrvSmpl/install/xdpgscl.gpd delete mode 100644 print/XPSDrvSmpl/install/xdsmpl-PipelineConfig.xml delete mode 100644 print/XPSDrvSmpl/install/xdsmpl.gpd delete mode 100644 print/XPSDrvSmpl/install/xdsmpl.inf delete mode 100644 print/XPSDrvSmpl/install/xdsmpl.ini delete mode 100644 print/XPSDrvSmpl/install/xdwmark.gpd delete mode 100644 print/XPSDrvSmpl/install/xdwscRGB.icc delete mode 100644 print/XPSDrvSmpl/src/common/bkdata.h delete mode 100644 print/XPSDrvSmpl/src/common/bkpchndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/bkpchndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/bkpthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/bkpthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/bkschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/bkschema.h delete mode 100644 print/XPSDrvSmpl/src/common/cmdata.h delete mode 100644 print/XPSDrvSmpl/src/common/cmintentsdata.h delete mode 100644 print/XPSDrvSmpl/src/common/cmintentsschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/cmintentsschema.h delete mode 100644 print/XPSDrvSmpl/src/common/cmintpthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/cmintpthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/cmprofiledata.h delete mode 100644 print/XPSDrvSmpl/src/common/cmprofileschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/cmprofileschema.h delete mode 100644 print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/cmprofpchndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/cmprofpthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/cmpthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/cmpthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/cmschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/cmschema.h delete mode 100644 print/XPSDrvSmpl/src/common/globals.cpp delete mode 100644 print/XPSDrvSmpl/src/common/globals.h delete mode 100644 print/XPSDrvSmpl/src/common/nupchndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/nupchndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/nupdata.h delete mode 100644 print/XPSDrvSmpl/src/common/nupschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/nupschema.h delete mode 100644 print/XPSDrvSmpl/src/common/nupthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/nupthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/pchndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pchndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/pgscdata.h delete mode 100644 print/XPSDrvSmpl/src/common/pgscpchndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pgscpchndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/pgscpthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pgscpthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/pgscschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pgscschema.h delete mode 100644 print/XPSDrvSmpl/src/common/pimagedata.h delete mode 100644 print/XPSDrvSmpl/src/common/pimagepthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pimagepthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/pimageschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pimageschema.h delete mode 100644 print/XPSDrvSmpl/src/common/porientdata.h delete mode 100644 print/XPSDrvSmpl/src/common/porientpthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/porientpthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/porientschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/porientschema.h delete mode 100644 print/XPSDrvSmpl/src/common/precomp.h delete mode 100644 print/XPSDrvSmpl/src/common/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/common/privatedefs.h delete mode 100644 print/XPSDrvSmpl/src/common/pshndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pshndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/psizedata.h delete mode 100644 print/XPSDrvSmpl/src/common/psizepthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/psizepthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/psizeschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/psizeschema.h delete mode 100644 print/XPSDrvSmpl/src/common/pthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/pthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/ptquerybld.cpp delete mode 100644 print/XPSDrvSmpl/src/common/ptquerybld.h delete mode 100644 print/XPSDrvSmpl/src/common/schema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/schema.h delete mode 100644 print/XPSDrvSmpl/src/common/wmdata.h delete mode 100644 print/XPSDrvSmpl/src/common/wmpchndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/wmpchndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/wmpthndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/common/wmpthndlr.h delete mode 100644 print/XPSDrvSmpl/src/common/wmschema.cpp delete mode 100644 print/XPSDrvSmpl/src/common/wmschema.h delete mode 100644 print/XPSDrvSmpl/src/common/workbuff.cpp delete mode 100644 print/XPSDrvSmpl/src/common/workbuff.h delete mode 100644 print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj delete mode 100644 print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/debug/debug.cpp delete mode 100644 print/XPSDrvSmpl/src/debug/debug.h delete mode 100644 print/XPSDrvSmpl/src/debug/precomp.h delete mode 100644 print/XPSDrvSmpl/src/debug/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj delete mode 100644 print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/bkflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/bkflt.rc delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/bkprps.h delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/bksax.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/bksax.h delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/xdbook.def delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj delete mode 100644 print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/color/XDColMan.def delete mode 100644 print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj delete mode 100644 print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/color/bmpconv.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/bmpconv.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/bmpdata.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/bmpdata.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/cmflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/cmflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/cmflt.rc delete mode 100644 print/XPSDrvSmpl/src/filters/color/cmimg.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/cmimg.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/cmsax.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/cmsax.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/colchan.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/colchan.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/colconv.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/colconv.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/dictionary.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/dictionary.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/dllentry.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/profile.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/profile.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/profman.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/profman.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/scaniter.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/scaniter.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/transform.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/transform.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/wcsapiconv.h delete mode 100644 print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/color/wictobmscn.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/clasfact.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/ptmanage.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/ptmanage.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/rescache.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/rescache.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/rescpy.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/rescpy.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/saxhndlr.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/widetoutf8.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdrchflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdsmplflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/common/xdstrmflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/nup/dllentry.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nupflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nupflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nupflt.rc delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nuppage.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nuppage.h delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nupsax.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nupsax.h delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nuptprps.h delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nupxform.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/nup/nupxform.h delete mode 100644 print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/nup/xdnup.def delete mode 100644 print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj delete mode 100644 print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/precomp.h delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/pagescale.h delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/scaleflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/scalesax.h delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/xdscale.def delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj delete mode 100644 print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/Raster1.png delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/Vector1.xps delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/dllentry.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmbase.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmflt.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmflt.rc delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmfont.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmimg.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmptprop.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmptprop.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmrast.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmres.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmsax.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmtext.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmvect.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/wmxps.h delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/xdwmark.def delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj delete mode 100644 print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj.Filters delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xps.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp delete mode 100644 print/XPSDrvSmpl/src/filters/xdcont/xpstype.h delete mode 100644 print/XPSDrvSmpl/src/inc/cunknown.h delete mode 100644 print/XPSDrvSmpl/src/inc/gdip.h delete mode 100644 print/XPSDrvSmpl/src/inc/ipkarch.h delete mode 100644 print/XPSDrvSmpl/src/inc/ipkfile.h delete mode 100644 print/XPSDrvSmpl/src/inc/streamcnv.h delete mode 100644 print/XPSDrvSmpl/src/inc/xdexcept.h delete mode 100644 print/XPSDrvSmpl/src/inc/xdstring.h delete mode 100644 print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/bkdmptcnv.h delete mode 100644 print/XPSDrvSmpl/src/ui/colctrls.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/colctrls.h delete mode 100644 print/XPSDrvSmpl/src/ui/coldmptcnv.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/coldmptcnv.h delete mode 100644 print/XPSDrvSmpl/src/ui/colppg.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/colppg.h delete mode 100644 print/XPSDrvSmpl/src/ui/devmode.h delete mode 100644 print/XPSDrvSmpl/src/ui/dllentry.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/docppg.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/docppg.h delete mode 100644 print/XPSDrvSmpl/src/ui/ftrctrls.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/ftrctrls.h delete mode 100644 print/XPSDrvSmpl/src/ui/ftrdmptcnv.h delete mode 100644 print/XPSDrvSmpl/src/ui/ftrppg.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/ftrppg.h delete mode 100644 print/XPSDrvSmpl/src/ui/nupptcnv.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/nupptcnv.h delete mode 100644 print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/pgscdmptcnv.h delete mode 100644 print/XPSDrvSmpl/src/ui/precomp.h delete mode 100644 print/XPSDrvSmpl/src/ui/precompsrc.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/resource.h delete mode 100644 print/XPSDrvSmpl/src/ui/uictrl.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/uictrl.h delete mode 100644 print/XPSDrvSmpl/src/ui/uiproperties.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/uiproperties.h delete mode 100644 print/XPSDrvSmpl/src/ui/wmctrls.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/wmctrls.h delete mode 100644 print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/wmdmptcnv.h delete mode 100644 print/XPSDrvSmpl/src/ui/wmppg.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/wmppg.h delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplcf.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplcf.h delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmpldlg.rc delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplptprov.h delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplui.cpp delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplui.def delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplui.h delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj delete mode 100644 print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters delete mode 100644 print/XpsRasFilter/README.md delete mode 100644 print/XpsRasFilter/XpsRasFilter.sln delete mode 100644 print/XpsRasFilter/install/xpsrassmpl-PipelineConfig.xml delete mode 100644 print/XpsRasFilter/install/xpsrassmpl.gpd delete mode 100644 print/XpsRasFilter/install/xpsrassmpl.inf delete mode 100644 print/XpsRasFilter/src/BitmapHandler.cpp delete mode 100644 print/XpsRasFilter/src/BitmapHandler.h delete mode 100644 print/XpsRasFilter/src/Exception.cpp delete mode 100644 print/XpsRasFilter/src/Exception.h delete mode 100644 print/XpsRasFilter/src/OMConvertor.cpp delete mode 100644 print/XpsRasFilter/src/OMConvertor.h delete mode 100644 print/XpsRasFilter/src/PThandler.cpp delete mode 100644 print/XpsRasFilter/src/PThandler.h delete mode 100644 print/XpsRasFilter/src/UnknownBase.h delete mode 100644 print/XpsRasFilter/src/WppTrace.cpp delete mode 100644 print/XpsRasFilter/src/WppTrace.h delete mode 100644 print/XpsRasFilter/src/dllentry.cpp delete mode 100644 print/XpsRasFilter/src/filtertypes.h delete mode 100644 print/XpsRasFilter/src/precomp.h delete mode 100644 print/XpsRasFilter/src/precompsrc.cpp delete mode 100644 print/XpsRasFilter/src/rasinterface.cpp delete mode 100644 print/XpsRasFilter/src/rasinterface.h delete mode 100644 print/XpsRasFilter/src/xpsrasfilter.cpp delete mode 100644 print/XpsRasFilter/src/xpsrasfilter.def delete mode 100644 print/XpsRasFilter/src/xpsrasfilter.h delete mode 100644 print/XpsRasFilter/src/xpsrasfilter.rc delete mode 100644 print/XpsRasFilter/src/xpsrasfilter.vcxproj delete mode 100644 print/XpsRasFilter/src/xpsrasfilter.vcxproj.Filters delete mode 100644 print/autoconfig/ACnfgPS.gdl delete mode 100644 print/autoconfig/ACnfgUni.GDL delete mode 100644 print/autoconfig/AutoCnfg.GPD delete mode 100644 print/autoconfig/AutoCnfg.PPD delete mode 100644 print/autoconfig/AutoCnfg.inf delete mode 100644 print/autoconfig/AutoConfig.htm delete mode 100644 print/autoconfig/AutoConfig.sln delete mode 100644 print/autoconfig/AutoConfig.vcxproj delete mode 100644 print/autoconfig/AutoConfig.vcxproj.Filters delete mode 100644 print/autoconfig/Package/package.VcxProj delete mode 100644 print/autoconfig/Package/package.VcxProj.Filters delete mode 100644 print/autoconfig/README.md delete mode 100644 print/cpsuisam/CPSUIDAT.C delete mode 100644 print/cpsuisam/CPSUIDAT.H delete mode 100644 print/cpsuisam/CPSUISAM.DEF delete mode 100644 print/cpsuisam/CPSUISAM.DLG delete mode 100644 print/cpsuisam/CPSUISAM.H delete mode 100644 print/cpsuisam/DEBUG.C delete mode 100644 print/cpsuisam/DEBUG.H delete mode 100644 print/cpsuisam/PRECOMP.H delete mode 100644 print/cpsuisam/README.md delete mode 100644 print/cpsuisam/cpsuisam.c delete mode 100644 print/cpsuisam/cpsuisam.sln delete mode 100644 print/cpsuisam/cpsuisam.vcxproj delete mode 100644 print/cpsuisam/cpsuisam.vcxproj.Filters delete mode 100644 print/cpsuisam/icons/apple.ico delete mode 100644 print/cpsuisam/icons/cpsuisam.ico delete mode 100644 print/cpsuisam/precompsrc.c delete mode 100644 print/cpsuisam/res.rc delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintSchemaHelper.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrinterExtensionSample.csproj delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/AssemblyInfo.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.Designer.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.resx delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.Designer.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.settings delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.Designer.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.resx delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/WindowHelper.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/app.config delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/bidi_Ink_mock.xml delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/PrinterExtensionLibrary/PrinterExtensionAdapters.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/PrinterExtensionLibrary/PrinterExtensionLibrary.csproj delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/PrinterExtensionLibrary/PrinterExtensionManager.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/PrinterExtensionLibrary/PrinterExtensionTypes.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/PrinterExtensionLibrary/Properties/AssemblyInfo.cs delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/PrinterExtensionSample.sln delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/README.md delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-ConstraintScript/ConstraintScript.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-ConstraintScript/ConstraintScript.sln delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-ConstraintScript/ConstraintScript.vcxproj delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-ConstraintScript/ConstraintScript.vcxproj.Filters delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-ConstraintScript/README.md delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-ConstraintScript/v4PrintDriver-Intellisense-Windows8.1.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-ConstraintScript/v4PrintDriver-Intellisense.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/HostBasedSampleDriver.sln delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/HostBasedSampleDriver.vcxproj delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/HostBasedSampleDriver.vcxproj.Filters delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/Package/package.VcxProj delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/Package/package.VcxProj.Filters delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/README.md delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/usb_host_based_sample-manifest.ini delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/usb_host_based_sample-pipelineconfig.xml delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/usb_host_based_sample.gpd delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/usb_host_based_sample.inf delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/usb_host_based_sample.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/usb_host_based_sample_events.xml delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/usb_host_based_sample_extension.xml delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/v4PrintDriver-Intellisense-Windows8.1.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-HostBasedSampleDriver/v4PrintDriver-Intellisense.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/README.md delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/USBMon-Bidi-Extension.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/USBMon-Bidi-Extension.sln delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/USBMon-Bidi-Extension.vcxproj delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/USBMon-Bidi-Extension.vcxproj.Filters delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/USBMon-Bidi-Extension.xml delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/v4PrintDriver-Intellisense-Windows8.1.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/v4PrintDriver-Intellisense.js delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-WSDMon-Bidi-Extension/README.md delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-WSDMon-Bidi-Extension/WSDMon-Bidi-Extension.sln delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-WSDMon-Bidi-Extension/WSDMon-Bidi-Extension.vcxproj delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-WSDMon-Bidi-Extension/WSDMon-Bidi-Extension.vcxproj.Filters delete mode 100644 print/v4PrintDriverSamples/v4PrintDriver-WSDMon-Bidi-Extension/WSDMon-Bidi-Extension.xml diff --git a/print/OEM Printer Customization Plug-in Samples/C++/CUSTOMDRV.HLP b/print/OEM Printer Customization Plug-in Samples/C++/CUSTOMDRV.HLP deleted file mode 100644 index 8ba599b2..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/CUSTOMDRV.HLP and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.cpp deleted file mode 100644 index acee806b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.cpp +++ /dev/null @@ -1,2858 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 2001 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Features.cpp -// -// PURPOSE: Implementation wrapper class for PScript Driver Features and Options. -// - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "globals.h" -#include "devmode.h" -#include "stringutils.h" -#include "helper.h" -#include "features.h" -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// Internal Defines and Macros -//////////////////////////////////////////////////////// - -#define INITIAL_ENUM_FEATURES_SIZE 1024 -#define INITIAL_ENUM_OPTIONS_SIZE 64 -#define INITIAL_FEATURE_DISPLAY_NAME_SIZE 64 -#define INITIAL_OPTION_DISPLAY_NAME_SIZE 32 -#define INITIAL_GET_OPTION_SIZE 64 -#define INITIAL_GET_REASON_SIZE 1024 - -#define DRIVER_FEATURE_PREFIX '%' -#define IS_DRIVER_FEATURE(f) (DRIVER_FEATURE_PREFIX == (f)[0]) - -// Flags that the uDisplayNameID should be returned as -// MAKEINTRESOURCE() instead of loading the string resource. -#define RETURN_INT_RESOURCE 1 - -// Macros to test for conditions of KEYWORDMAP entry. -#define IS_MAPPING_INT_RESOURCE(p) ((p)->dwFlags & RETURN_INT_RESOURCE) - -// TAG the identifies feature OPTITEM data stuct. -#define FEATURE_OPTITEM_TAG 'FETR' - - -//////////////////////////////////////////////////////// -// Type Definitions -//////////////////////////////////////////////////////// - -// Struct used to identify OPTITEM as -// feature OPTITEM and to map back from -// an OPTITEM to the feature. -typedef struct _tagFeatureOptitemData -{ - DWORD dwSize; - DWORD dwTag; - PCSTR pszFeatureKeyword; - COptions *pOptions; - -} FEATUREOPTITEMDATA, *PFEATUREOPTITEMDATA; - - - -//////////////////////////////////////////////////////// -// Internal Constants -//////////////////////////////////////////////////////// - -static KEYWORDMAP gkmFeatureMap[] = -{ - "%AddEuro", NULL, IDS_ADD_EURO, OEMCUIP_PRNPROP, 0, - "%CtrlDAfter", NULL, IDS_CTRLD_AFTER, OEMCUIP_PRNPROP, 0, - "%CtrlDBefore", NULL, IDS_CTRLD_BEFORE, OEMCUIP_PRNPROP, 0, - //"%CustomPageSize", NULL, IDS_PSCRIPT_CUSTOMSIZE, OEMCUIP_DOCPROP, 0, - "%GraphicsTrueGray", NULL, IDS_TRUE_GRAY_GRAPH, OEMCUIP_PRNPROP, 0, - "%JobTimeout", NULL, IDS_JOBTIMEOUT, OEMCUIP_PRNPROP, 0, - "%MaxFontSizeAsBitmap", NULL, IDS_PSMAXBITMAP, OEMCUIP_PRNPROP, 0, - "%MetafileSpooling", NULL, IDS_METAFILE_SPOOLING, OEMCUIP_DOCPROP, 0, - "%MinFontSizeAsOutline", NULL, IDS_PSMINOUTLINE, OEMCUIP_PRNPROP, 0, - "%Mirroring", NULL, IDS_MIRROR, OEMCUIP_DOCPROP, 0, - "%Negative", NULL, IDS_NEGATIVE_PRINT, OEMCUIP_DOCPROP, 0, - "%Orientation", TEXT("COMPSTUI.DLL"), IDS_CPSUI_ORIENTATION, OEMCUIP_DOCPROP, RETURN_INT_RESOURCE, - "%OutputFormat", NULL, IDS_PSOUTPUT_OPTION, OEMCUIP_DOCPROP, 0, - "%OutputProtocol", NULL, IDS_PSPROTOCOL, OEMCUIP_PRNPROP, 0, - "%OutputPSLevel", NULL, IDS_PSLEVEL, OEMCUIP_DOCPROP, 0, - "%PageOrder", TEXT("COMPSTUI.DLL"), IDS_CPSUI_PAGEORDER, OEMCUIP_DOCPROP, RETURN_INT_RESOURCE, - "%PagePerSheet", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP, OEMCUIP_DOCPROP, RETURN_INT_RESOURCE, - "%PSErrorHandler", NULL, IDS_PSERROR_HANDLER, OEMCUIP_DOCPROP, 0, - "%PSMemory", NULL, IDS_POSTSCRIPT_VM, OEMCUIP_PRNPROP, 0, - "%TextTrueGray", NULL, IDS_TRUE_GRAY_TEXT, OEMCUIP_PRNPROP, 0, - "%TTDownloadFormat", NULL, IDS_PSTT_DLFORMAT, OEMCUIP_DOCPROP, 0, - "%WaitTimeout", NULL, IDS_WAITTIMEOUT, OEMCUIP_PRNPROP, 0, -}; -static const NUM_FEATURE_MAP = (sizeof(gkmFeatureMap)/sizeof(gkmFeatureMap[0])); - - -static KEYWORDMAP gkmOptionMap[] = -{ - "True", TEXT("COMPSTUI.DLL"), IDS_CPSUI_TRUE, 0, RETURN_INT_RESOURCE, - "False", TEXT("COMPSTUI.DLL"), IDS_CPSUI_FALSE, 0, RETURN_INT_RESOURCE, - "Portrait", TEXT("COMPSTUI.DLL"), IDS_CPSUI_PORTRAIT, 0, RETURN_INT_RESOURCE, - "Landscape", TEXT("COMPSTUI.DLL"), IDS_CPSUI_LANDSCAPE, 0, RETURN_INT_RESOURCE, - "RotatedLandscape", TEXT("COMPSTUI.DLL"), IDS_CPSUI_ROT_LAND, 0, RETURN_INT_RESOURCE, - "Speed", NULL, IDS_PSOPT_SPEED, 0, RETURN_INT_RESOURCE, - "Portability", NULL, IDS_PSOPT_PORTABILITY, 0, 0, - "EPS", NULL, IDS_PSOPT_EPS, 0, 0, - "Archive", NULL, IDS_PSOPT_ARCHIVE, 0, 0, - "ASCII", NULL, IDS_PSPROTOCOL_ASCII, 0, 0, - "BCP", NULL, IDS_PSPROTOCOL_BCP, 0, 0, - "TBCP", NULL, IDS_PSPROTOCOL_TBCP, 0, 0, - "Binary", NULL, IDS_PSPROTOCOL_BINARY, 0, 0, - "FrontToBack", TEXT("COMPSTUI.DLL"), IDS_CPSUI_FRONTTOBACK, 0, RETURN_INT_RESOURCE, - "BackToFront", TEXT("COMPSTUI.DLL"), IDS_CPSUI_BACKTOFRONT, 0, RETURN_INT_RESOURCE, - "1", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_NORMAL, 0, RETURN_INT_RESOURCE, - "2", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_TWOUP, 0, RETURN_INT_RESOURCE, - "4", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_FOURUP, 0, RETURN_INT_RESOURCE, - "6", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_SIXUP, 0, RETURN_INT_RESOURCE, - "9", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_NINEUP, 0, RETURN_INT_RESOURCE, - "16", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_SIXTEENUP, 0, RETURN_INT_RESOURCE, - "Booklet", TEXT("COMPSTUI.DLL"), IDS_CPSUI_BOOKLET, 0, RETURN_INT_RESOURCE, - "Automatic", NULL, IDS_TTDL_DEFAULT, 0, 0, - "Outline", NULL, IDS_TTDL_TYPE1, 0, 0, - "Bitmap", NULL, IDS_TTDL_TYPE3, 0, 0, - "NativeTrueType", NULL, IDS_TTDL_TYPE42, 0, 0, -}; -static const NUM_OPTION_MAP = (sizeof(gkmOptionMap)/sizeof(gkmOptionMap[0])); - - - - -//////////////////////////////////////////// -// -// COptions Methods -// - -// -// Private Methods -// - -// Initializes class data members. -void COptions::Init() -{ - m_wOptions = 0; - m_cType = TVOT_COMBOBOX; - m_pmszRaw = NULL; - m_pszFeature = NULL; - m_ppszOptions = NULL; - m_ptRange.x = 0; - m_ptRange.y = 0; - m_dwSize = 0; - m_pszUnits = NULL; - m_hHeap = NULL; - m_pInfo = NULL; -} - -void COptions::Clear() -{ - // Free memory associated with data members. - if(NULL != m_pmszRaw) HeapFree(m_hHeap, 0, m_pmszRaw); - if(NULL != m_ppszOptions) HeapFree(m_hHeap, 0, m_ppszOptions); - if( (NULL != m_pszUnits) && !IS_INTRESOURCE(m_pszUnits)) HeapFree(m_hHeap, 0, m_pszUnits); - - // Free option info. - FreeOptionInfo(); - - // Initialize data members. - Init(); -} - -// Frees memory associated with Option Info array. -void COptions::FreeOptionInfo() -{ - // Validate parameters. - if( (NULL == m_hHeap) - || - (NULL == m_pInfo) - ) - { - return; - } - - // Free strings in the array. - for(WORD wIndex = 0; wIndex < m_wOptions; ++wIndex) - { - PWSTR pszDisplay = m_pInfo[wIndex].pszDisplayName; - - if( (NULL != pszDisplay) - && - !(IS_INTRESOURCE(pszDisplay)) - ) - { - HeapFree(m_hHeap, 0, pszDisplay); - } - } - - // Free the array. - HeapFree(m_hHeap, 0, m_pInfo); - m_pInfo = NULL; -} - -// Will do init for features that need special handling. -HRESULT COptions::GetOptionsForSpecialFeatures(CUIHelper &Helper, POEMUIOBJ poemuiobj) -{ - HRESULT hrResult = E_NOTIMPL; - - - // See if this is a special feature. - // If it is, then call the special option init for the - // feature. - if(!lstrcmpA(m_pszFeature, "%CustomPageSize")) - { - // There is no option init for CustomPageSize. - // The item itself must be handled specially. - hrResult = S_OK; - } - else if( !lstrcmpA(m_pszFeature, "%JobTimeout") - || - !lstrcmpA(m_pszFeature, "%WaitTimeout") - ) - { - // JobTimeout and WaitTimeout feature options are string representations - // of an integer that represents number of seconds in the range 0 through - // 2,147,483,647 (i.e. LONG_MAX). However, COMPSTUI limits us to - // WORD size, which has range of 0 to 32,767 (i.e. SHRT_MAX). - m_cType = TVOT_UDARROW; - m_ptRange.x = 0; - m_ptRange.y = SHRT_MAX; - hrResult = GetOptionSelectionShort(Helper, poemuiobj); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForSpecialFeatures() failed to get current selection for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - } - else if( !lstrcmpA(m_pszFeature, "%MaxFontSizeAsBitmap") - || - !lstrcmpA(m_pszFeature, "%MinFontSizeAsOutline") - ) - { - // MaxFontSizeAsBitmap, and MinFontSizeAsOutline feature options - // are string representations of an integer that represents number - // of pixels in the range 0 through 32,767 (i.e. SHRT_MAX). - m_cType = TVOT_UDARROW; - m_ptRange.x = 0; - m_ptRange.y = SHRT_MAX; - hrResult = GetOptionSelectionShort(Helper, poemuiobj); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForSpecialFeatures() failed to get current selection for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - } - else if( !lstrcmpA(m_pszFeature, "%PSMemory") ) - { - DWORD dwType; - DWORD dwLevel; - DWORD dwNeeded; - - - // PSMemory option is string representation of an integer - // that represents number of seconds in the range 0 - // through 32,767 (i.e. SHRT_MAX). - // However, the minimum is 172 KB for Level 1 and 249 KB for level 2 - m_cType = TVOT_UDARROW; - m_ptRange.y = SHRT_MAX; - hrResult = GetOptionSelectionShort(Helper, poemuiobj); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForSpecialFeatures() failed to get current selection for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - - // Get the global attribute for max language level. - hrResult = Helper.GetGlobalAttribute(poemuiobj, - 0, - "LanguageLevel", - &dwType, - (PBYTE) &dwLevel, - sizeof(dwLevel), - &dwNeeded); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForSpecialFeatures() failed to get global attribute \"LanguageLevel\". (hrResult = 0x%x)\r\n"), - hrResult); - - goto Exit; - } - - // Set minimum range based on PS Max Language level. - switch(dwLevel) - { - case 1: - m_ptRange.x = 172; - break; - - default: - case 2: - case 3: - m_ptRange.x = 249; - break; - } - - // Get Units string. - //GetStringResource(m_pszUnits - } - else if(!lstrcmpA(m_pszFeature, "%OutputPSLevel")) - { - hrResult = GetOptionsForOutputPSLevel(Helper, poemuiobj); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForSpecialFeatures() failed to get current selection for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - } - - -Exit: - - return hrResult; -} - -// Do init for PS Level options. -HRESULT COptions::GetOptionsForOutputPSLevel(CUIHelper &Helper, POEMUIOBJ poemuiobj) -{ - WORD wCount = 0; - DWORD dwLevel = 0; - DWORD dwType = 0; - DWORD dwNeeded = 0; - HRESULT hrResult = E_NOTIMPL; - - - // PS Level is integers from 1 to "LanguageLevel" - // global atribute. - m_cType = TVOT_COMBOBOX; - - // Get the global attribute for max language level. - hrResult = Helper.GetGlobalAttribute(poemuiobj, - 0, - "LanguageLevel", - &dwType, - (PBYTE) &dwLevel, - sizeof(dwLevel), - &dwNeeded); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForOutputPSLevel() failed to get global attribute \"LanguageLevel\". (hrResult = 0x%x)\r\n"), - hrResult); - - goto Exit; - } - - // - // Create Options for PS Level - // - - // Set the number of options to the PS Level supported. - m_wOptions = (WORD) dwLevel; - - // Allocate keyword list. - // Allocate memory for pointer to keyword and the keyword itself, so that - // the memory for the keyword strings will get de-allocated with the keyword list - // on object destruction, just like regular features for which EnumOptions works. - // User the size of a pointer (4 bytes on x86, and 8 on IA64) so that - // it begining of the keyword strings will be DWORD or QUADWORD aligned - // for x86 and IA64 respectively. Keyword strings aren't required to - // be DWORD or QUADWORD aligned, but it is more optimal. Also, this gives - // some additional space for the case of %OutputPSLevel keywords, which are - // in the range of 1 through the max PostScript level supported, and only - // require 2 CHARs (1 for the digit and one for the NULL terminator). - m_ppszOptions = (PCSTR *) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, m_wOptions * ( sizeof(PSTR) + sizeof(PCSTR *) ) ); - if(NULL == m_ppszOptions) - { - ERR(ERRORTEXT("COptions::GetOptionsForOutputPSLevel() failed to allocate option keyword array for PS Level.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - - // Allocate option info array. - m_pInfo = (POPTION_INFO) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, m_wOptions * sizeof(OPTION_INFO)); - if(NULL == m_pInfo) - { - ERR(ERRORTEXT("COptions::GetOptionsForOutputPSLevel() failed to allocate info array for PS Level.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Init the option info. - for(wCount = 0; wCount < m_wOptions; ++wCount) - { - // Init keyword. - // The memory for both the keyword list and the keyword strings was allocated above. - m_ppszOptions[wCount] = (PSTR)(m_ppszOptions + m_wOptions) + (sizeof(PSTR) * wCount); - hrResult = StringCbPrintfA(const_cast(m_ppszOptions[wCount]), sizeof(PSTR), "%d", wCount + 1); - if(FAILED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForOutputPSLevel() failed to string representation of item %d.\r\n"), - wCount + 1); - - goto Exit; - } - - // Init option display name. - m_pInfo[wCount].pszDisplayName = (PWSTR) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, 2 * sizeof(WCHAR)); - if(NULL == m_pInfo[wCount].pszDisplayName) - { - ERR(ERRORTEXT("COptions::GetOptionsForOutputPSLevel() failed to allocate display string for Level %d.\r\n"), - wCount); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Init option display name. - hrResult = StringCchPrintfW(m_pInfo[wCount].pszDisplayName, 2, TEXT("%d"), wCount + 1); - if(FAILED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionsForOutputPSLevel() failed to create display name for item %d.\r\n"), - wCount + 1); - - goto Exit; - } - } - - // - // Get Current Selection - // - - hrResult = GetOptionSelectionIndex(Helper, poemuiobj); - - -Exit: - - // Don't need to clean up memory allocation on error, since - // all memory allocated are assigned to data members, which - // will be cleaned up in the object destructor. - - return hrResult; -} - -HRESULT COptions::GetOptionSelectionString(CUIHelper &Helper, POEMUIOBJ poemuiobj, _Outptr_result_maybenull_ PSTR *ppszSel) -{ - PSTR pmszFeature = NULL; - PSTR pmszBuf = NULL; - WORD wCount = 0; - PCSTR *ppszList = NULL; - DWORD dwFeatureSize = 0; - DWORD dwNeeded = 0; - DWORD dwSize = INITIAL_GET_OPTION_SIZE; - HRESULT hrResult = S_OK; - - *ppszSel = NULL; - - - // - // Make single feature multi-sz. - // - - // Allocate single feature multi-sz buffer that's the size of the Feature name, plus two bytes for multi-sz termination - if (FAILED(hrResult = SizeTToDWord(strlen(m_pszFeature) + 2, &dwFeatureSize))) - { - goto Exit; - } - - pmszFeature = (PSTR) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, dwFeatureSize); - if(NULL == pmszFeature) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionString() failed to allocate buffer for single feature multi-sz for feature %hs.\r\n"), - m_pszFeature); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Just need to do a regular string copy, since the buffer is already zero filled. - hrResult = StringCbCopyA(pmszFeature, dwFeatureSize, m_pszFeature); - if(FAILED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionString() failed to copy feature string %hs.\r\n"), m_pszFeature); - } - - // Allocated initial buffer of reasonible size. - pmszBuf = (PSTR) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, dwSize); - if(NULL == pmszBuf) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionString() failed to allocate buffer to get current setting for feature %hs.\r\n"), - m_pszFeature); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Get current option selection. - hrResult = Helper.GetOptions(poemuiobj, - 0, - pmszFeature, - dwFeatureSize, - pmszBuf, - dwSize, - &dwNeeded); - if( (E_OUTOFMEMORY == hrResult) && (dwSize < dwNeeded) ) - { - PSTR pTemp = NULL; - - - // INVARIANT: initial buffer not large enough. - - // Re-alloc buffer and try again. - pTemp = (PSTR) HeapReAlloc(m_hHeap, HEAP_ZERO_MEMORY, pmszBuf, dwNeeded); - if(NULL == pTemp) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionString() failed to re-allocate buffer to get current setting for feature %hs.\r\n"), - m_pszFeature); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - pmszBuf = pTemp; - - - // Try to get current option selection again. - hrResult = Helper.GetOptions(poemuiobj, - 0, - pmszFeature, - dwFeatureSize, - pmszBuf, - dwNeeded, - &dwNeeded); - } - - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionString() failed to get current setting for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - - // NOTE: The return string from GetOptions() may return - // contain no strings and not return a HRESULT error - // when the feature isn't supported in the current document or - // printer sticky mode. - if('\0' == pmszBuf[0]) - { - // Feature not supported for this sticky mode. - goto Exit; - } - - // Parse the results buffer to see what the current setting is. - hrResult = MakeStrPtrList(m_hHeap, pmszBuf, &ppszList, &wCount); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionString() failed to make string list for GetOptions() return for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - - // Check that we got 2 strings back. - if(2 != wCount) - { - WARNING(DLLTEXT("COptions::GetOptionSelectionString() the GetOption() return string list for \r\n\tfeature %hs is not of size 2.\r\n\tNumber of string is %d\r\n"), - m_pszFeature, - wCount); - - // Bail if we don't have at least 2 strings. - if(2 > wCount) - { - goto Exit; - } - } - - // Return copy of just the GetOption() result. - *ppszSel = MakeStringCopy(m_hHeap, ppszList[1]); - if(NULL == *ppszSel) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionString() failed to duplicate string GetOptions() return for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - -Exit: - - // Free local buffers. - if(NULL != pmszFeature) HeapFree(m_hHeap, 0, pmszFeature); - if(NULL != pmszBuf) HeapFree(m_hHeap, 0, pmszBuf); - if(NULL != ppszList) HeapFree(m_hHeap, 0, ppszList); - - return hrResult; -} - -// Gets current Options selection for LONG value. -HRESULT COptions::GetOptionSelectionLong(CUIHelper &Helper, POEMUIOBJ poemuiobj) -{ - PSTR pszSel = NULL; - HRESULT hrResult = S_OK; - - - // Get option selection string. - hrResult = GetOptionSelectionString(Helper, poemuiobj, &pszSel); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionLong() failed to get string for GetOptions() return for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - - // Convert string option to LONG and uses that as the selection. - if(NULL != pszSel) m_Sel = atol(pszSel); - - -Exit: - - // Free local buffers. - if(NULL != pszSel) HeapFree(m_hHeap, 0, pszSel); - - return hrResult; -} - -// Gets current Options selection for SHORT value. -HRESULT COptions::GetOptionSelectionShort(CUIHelper &Helper, POEMUIOBJ poemuiobj) -{ - PSTR pszSel = NULL; - HRESULT hrResult = S_OK; - - - // Get option selection string. - hrResult = GetOptionSelectionString(Helper, poemuiobj, &pszSel); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionLong() failed to get string for GetOptions() return for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - - // Convert string option to LONG and uses that as the selection. - if(NULL != pszSel) m_Sel = atoi(pszSel) & 0x00ffff; - - -Exit: - - // Free local buffers. - if(NULL != pszSel) HeapFree(m_hHeap, 0, pszSel); - - return hrResult; -} - -// Gets current option selection for feature. -HRESULT COptions::GetOptionSelectionIndex(CUIHelper &Helper, POEMUIOBJ poemuiobj) -{ - PSTR pszSel = NULL; - HRESULT hrResult = S_OK; - - - // Get option selection string. - hrResult = GetOptionSelectionString(Helper, poemuiobj, &pszSel); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::GetOptionSelectionIndex() failed to get string for GetOptions() return for feature %hs. (hrResult = 0x%x)\r\n"), - m_pszFeature, - hrResult); - - goto Exit; - } - - // Find the matching option for the string returned from GetOption. - m_Sel = FindOption(pszSel, m_wOptions - 1); - - -Exit: - - // Free local buffers. - if(NULL != pszSel) HeapFree(m_hHeap, 0, pszSel); - - return hrResult; -} - - - -// -// Public Methods -// - -// Default constructor -COptions::COptions() -{ - Init(); -} - -// Destructor -COptions::~COptions() -{ - Clear(); -} - -// Get the option list for a feature -HRESULT COptions::Acquire(_In_ HANDLE hHeap, - CUIHelper &Helper, - _In_ POEMUIOBJ poemuiobj, - _In_ PCSTR pszFeature) -{ - DWORD dwNeeded = 0; - HRESULT hrResult = S_OK; - - - VERBOSE(DLLTEXT("COptions::Acquire(0x%p, Helper, 0x%p, %hs) entered.\r\n"), - hHeap, - poemuiobj, - pszFeature ? pszFeature : "NULL"); - - // Don't retreive the Options again if we already got them. - if( (0 < m_wOptions) - && - (NULL != m_pszFeature) - && - !lstrcmpA(m_pszFeature, pszFeature) - ) - { - VERBOSE(DLLTEXT("COptions::Acquire() already have options for feature %hs.\r\n"), m_pszFeature); - VERBOSE(DLLTEXT("COptions::Acquire() returning with HRESULT of S_OK\r\n")); - - return S_OK; - } - - // Save the heap handle for use later, such as freeing memory at destruction. - m_hHeap = hHeap; - - // Store Keyword string. - m_pszFeature = pszFeature; - - - // - // Enumerate Options. - // - - - // Some features require special handling for initializing their options. - // EnumOpionts isn't implemented for these features. - // Return of E_NOTIMPL indicates it isn't the feature doesn't - // need special handling. - hrResult = GetOptionsForSpecialFeatures(Helper, poemuiobj); - if( SUCCEEDED(hrResult) - || - (!SUCCEEDED(hrResult) && (E_NOTIMPL != hrResult) ) - ) - { - // We either dealt with the special feature or incounter an error - // trying to deal with the special feature. - - goto Exit; - } - - // To try to cut down on having to call EnumOptions more than once, - // pre-allocate a buffer of reasonable size. - m_dwSize = INITIAL_ENUM_OPTIONS_SIZE; - m_pmszRaw = (PSTR) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, m_dwSize); - if(NULL == m_pmszRaw) - { - ERR(ERRORTEXT("COptions::Acquire() alloc for options for feature %hs failed.\r\n"), m_pszFeature); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - - // Try to get options list with initial buffer. - hrResult = Helper.EnumOptions(poemuiobj, 0, m_pszFeature, m_pmszRaw, m_dwSize, &dwNeeded); - if( (E_OUTOFMEMORY == hrResult) && (m_dwSize < dwNeeded)) - { - PSTR pTemp; - - - // INVARIANT: options list multi-sz wasn't large enough. - - // Re-allocate the buffer and try again. - pTemp = (PSTR) HeapReAlloc(m_hHeap, HEAP_ZERO_MEMORY, m_pmszRaw, dwNeeded); - if(NULL == pTemp) - { - ERR(ERRORTEXT("COptions::Acquire() re-alloc for options list for feature %hs failed.\r\n"), m_pszFeature); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - m_pmszRaw = pTemp; - m_dwSize = dwNeeded; - - // Try again to get the options list. - hrResult = Helper.EnumOptions(poemuiobj, 0, m_pszFeature, m_pmszRaw, m_dwSize, &dwNeeded); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::Acquire() failed to EnumOptions() for feature %hs after re-allocating buffer.\r\n"), m_pszFeature); - - goto Exit; - } - } - - // Make sure we got the option list. - // Can't do anything more with out it. - if(!SUCCEEDED(hrResult)) - { - if(E_NOTIMPL != hrResult) ERR(ERRORTEXT("COptions::Acquire() failed to enumerate options for feature %hs. (hrResult = 0x%x)\r\n"), m_pszFeature, hrResult); - - goto Exit; - } - - // INVARIANT: successfully got option keyword list. - - // Create array of string pointers to the Option names - // in the multi-sz we got from EnumOptions(). - hrResult = MakeStrPtrList(m_hHeap, m_pmszRaw, &m_ppszOptions, &m_wOptions); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::Acquire() failed to create pointer list to options. (hrResult = 0x%x)\r\n"), hrResult); - - goto Exit; - } - - // - // Build Option Information - // - - // Allocate array to hold feature info - m_pInfo = (POPTION_INFO) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, m_wOptions * sizeof(OPTION_INFO)); - if(NULL == m_pInfo) - { - ERR(ERRORTEXT("COptions::Acquire() failed to alloc feature info array.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // For each option, build or get useful information, such as display name. - for(WORD wIndex = 0; wIndex < m_wOptions; ++wIndex) - { - POPTION_INFO pCurrent = m_pInfo + wIndex; - - - // Get or build a keyword mapping entry - // that maps from keyword to usefully where to get info, such as - // display name, icon, option type, for keywords that may not be - // able to get info for from Helper. - pCurrent->pMapping = FindKeywordMapping(gkmOptionMap, NUM_OPTION_MAP, m_ppszOptions[wIndex]); - - // Get display names for each of the Options. - // The function implements a heuristic for detemining the display name, - // since can't get the display name from the UI Helper for all Options. - hrResult = DetermineOptionDisplayName(m_hHeap, - Helper, - poemuiobj, - m_pszFeature, - m_ppszOptions[wIndex], - pCurrent->pMapping, - &pCurrent->pszDisplayName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("COptions::Acquire() failed to get display name for %hs of feature %hs. (hrResult = 0x%x)\r\n"), - m_ppszOptions[wIndex], - m_pszFeature, - hrResult); - - goto Exit; - } - } - - // - // Get current option selection. - // - - hrResult = GetOptionSelectionIndex(Helper, poemuiobj); - - -Exit: - - // Clean up if weren't successful. - if(!SUCCEEDED(hrResult)) - { - Clear(); - } - - VERBOSE(DLLTEXT("COptions::Acquire() returning with HRESULT of 0x%x\r\n"), hrResult); - - return hrResult; -} - -// Return nth options keyword. -PCSTR COptions::GetKeyword(WORD wIndex) const -{ - // Validate parameters. - if( (wIndex >= m_wOptions) - || - (NULL == m_ppszOptions) - ) - { - return NULL; - } - - return m_ppszOptions[wIndex]; -} - -// Return nth options display name. -PCWSTR COptions::GetName(WORD wIndex) const -{ - // Validate parameters. - if( (wIndex >= m_wOptions) - || - (NULL == m_pInfo) - ) - { - ERR(ERRORTEXT("COptions::GetName() invalid parameters.\r\n")); - - return NULL; - } - - if(NULL == m_pInfo[wIndex].pszDisplayName) ERR(ERRORTEXT("COptions::GetName() returning NULL option display name.\r\n")); - - return m_pInfo[wIndex].pszDisplayName; -} - -// Find option with matching keyword string. -WORD COptions::FindOption(_In_opt_ PCSTR pszOption, WORD wDefault) const -{ - BOOL bFound = FALSE; - WORD wMatch = wDefault; - - - // Validate parameters. - if( (NULL == pszOption) - || - (NULL == m_ppszOptions) - ) - { - return wDefault; - } - - // Walk the option keyword looking for a match. - for(WORD wIndex = 0; !bFound && (wIndex < m_wOptions); ++wIndex) - { - bFound = !lstrcmpA(pszOption, m_ppszOptions[wIndex]); - if(bFound) - { - wMatch = wIndex; - } - } - - return wMatch; -} - -// Initializes OptItem with options for a feature. -HRESULT COptions::InitOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem) -{ - WORD wParams = 0; - WORD wOptions = 0; - HRESULT hrResult = S_OK; - - - // Set option selection. - pOptItem->pSel = m_pSel; - - // Get count of number of options. - // NOTE: Some feature options have no counts. - wOptions = GetCount(); - - // Different OPTTYPE types require different number of OPTPARAMs. - switch(m_cType) - { - // For up down arrow control, the OPTPARAMs need is 2. - case TVOT_UDARROW: - wParams = 2; - break; - - // For combobox, the OPTPARAMs needed is on per options. - case TVOT_COMBOBOX: - wParams = wOptions; - break; - - // The default is the option count. - default: - WARNING(DLLTEXT("COptions::InitOptItem() OPTTYPE type %d num of OPTPARAMs not handled. Default to option count of %d.\r\n"), - m_cType, - wOptions); - wParams = wOptions; - break; - } - - // Only do OPTTYPEs if we have non-Zero number of OPTPARAMs. - // Every OPTTYPE has at leas one OPTPARAM. - if(0 < wParams) - { - // Allocate memory for feature options. - pOptItem->pOptType = CreateOptType(hHeap, wParams); - if(NULL == pOptItem->pOptType) - { - ERR(ERRORTEXT("COptions::InitOptItem() failed to allocate OPTTYPEs for OPTITEM %hs.\r\n"), - m_pszFeature); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Set OPTTYPE. - pOptItem->pOptType->Type = m_cType; - - // Different OPTTYPE types require different initialization. - switch(m_cType) - { - // For up down arrow control, OPTPARAM[0] is used by the contrl. - // pOptParam[0]->pData is the Units description string. - // pOptParam[1].IconID is the min limit. - // pOptParam[1].lParam is the max limit. - case TVOT_UDARROW: - assert(2 == wParams); - pOptItem->pOptType->pOptParam[0].pData = m_pszUnits; - pOptItem->pOptType->pOptParam[1].IconID = m_ptRange.x; - pOptItem->pOptType->pOptParam[1].lParam = m_ptRange.y; - break; - - // For combobox, the pOptParam[n].pData is the display name of the option. - case TVOT_COMBOBOX: - for(WORD wIndex = 0; wIndex < wParams; ++wIndex) - { - pOptItem->pOptType->pOptParam[wIndex].pData = const_cast(GetName(wIndex)); - } - break; - - default: - ERR(ERRORTEXT("COptions::InitOptItem() OPTTYPE type %d OPTTYPE init not handled.\r\n"), - m_cType); - break; - } - } - - -Exit: - - return hrResult; -} - -// Refresh option selection. -HRESULT COptions::RefreshSelection(CUIHelper &Helper, POEMUIOBJ poemuiobj) -{ - HRESULT hrResult = S_OK; - - - // Method for getting option selection is based - // on OPTTYPE type. - switch(m_cType) - { - - case TVOT_UDARROW: - hrResult = GetOptionSelectionShort(Helper, poemuiobj); - break; - - case TVOT_COMBOBOX: - hrResult = GetOptionSelectionIndex(Helper, poemuiobj); - break; - - default: - ERR(ERRORTEXT("COptions::RefreshSelection() not handled for type %d OPTTYPE.\r\n"), - m_cType); - break; - } - - return hrResult; -} - - - -//////////////////////////////////////////// -// -// CFeatures Methods -// - -// -// Private Methods -// - -// Initializes class -void CFeatures::Init() -{ - // Initialize data members. - m_wFeatures = 0; - m_wDocFeatures = 0; - m_wPrintFeatures = 0; - m_pmszRaw = NULL; - m_ppszKeywords = NULL; - m_dwSize = 0; - m_hHeap = NULL; - m_pInfo = NULL; -} - -// Cleans up class and re-initialize it. -void CFeatures::Clear() -{ - // Free memory associated with data members. - if(NULL != m_pmszRaw) HeapFree(m_hHeap, 0, m_pmszRaw); - if(NULL != m_ppszKeywords) HeapFree(m_hHeap, 0, m_ppszKeywords); - - // Free feature info - FreeFeatureInfo(); - - // Re-initialize - Init(); -} - -// Free feature info -void CFeatures::FreeFeatureInfo() -{ - // Validate parameters. - if( (NULL == m_hHeap) - || - (NULL == m_pInfo) - ) - { - return; - } - - // Free memory associated with feature info. - for(WORD wIndex = 0; wIndex < m_wFeatures; ++wIndex) - { - PWSTR pszDisplay = m_pInfo[wIndex].pszDisplayName; - - - // Free display name. - if( (NULL != pszDisplay) - && - !IS_INTRESOURCE(pszDisplay) - ) - { - HeapFree(m_hHeap, 0, pszDisplay); - } - } - - // Free feature info array. - // Feature Info array allocated with new so - // that each of the constructors for COptions - // in fhte Feature Info array will be called. - delete[] m_pInfo; -} - -// Turns index for mode to modeless index, which -// is the real index to the feature. -WORD CFeatures::GetModelessIndex(WORD wIndex, DWORD dwMode) const -{ - WORD wCount = 0; - - - switch(dwMode) - { - // Number of features, all modes - case 0: - wCount = wIndex; - break; - - // Find the nth feature that matches the mode - case OEMCUIP_DOCPROP: - case OEMCUIP_PRNPROP: - // Walk the feature list looking for nth feature - // with matching mode. - for(wCount = 0; wCount < m_wFeatures; ++wCount) - { - // Count down to the feature we want. - // Only count down for matching modes. - if(dwMode == m_pInfo[wCount].dwMode) - { - if(0 == wIndex) - { - break; - } - else - { - --wIndex; - } - } - } - break; - } - - return wCount; -} - - -// -// Public Methods -// - -// Default constructor -CFeatures::CFeatures() -{ - Init(); -} - -// Destructor -CFeatures::~CFeatures() -{ - // Clean up class. - Clear(); -} - -// Gets Core Driver Features, if not already retrieved. -HRESULT CFeatures::Acquire(_In_ HANDLE hHeap, - CUIHelper &Helper, - _In_ POEMUIOBJ poemuiobj - ) -{ - WORD wIndex = 0; - DWORD dwNeeded = 0; - HRESULT hrResult = S_OK; - - - VERBOSE(DLLTEXT("CFeatures::Acquire(0x%p, Helper, 0x%p) entered.\r\n"), - hHeap, - poemuiobj); - - // Don't retreive the Features again if we already got them. - if(0 < m_wFeatures) - { - VERBOSE(DLLTEXT("CFeatures::Acquire() features already enumerated.\r\n")); - VERBOSE(DLLTEXT("CFeatures::Acquire() returning S_OK.\r\n")); - - return S_OK; - } - - // Save the heap handle for use later, such as freeing memory at destruction. - m_hHeap = hHeap; - - // - // Enumerate features. - // - - // To try to cut down on having to call EnumFeatures more than once, - // pre-allocate a buffer of reasonable size. - m_dwSize = INITIAL_ENUM_FEATURES_SIZE; - m_pmszRaw = (PSTR) HeapAlloc(m_hHeap, HEAP_ZERO_MEMORY, m_dwSize); - if(NULL == m_pmszRaw) - { - ERR(ERRORTEXT("CFeatures::Acquire() alloc for feature list failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - - // Try to get feature list with initial buffer. - hrResult = Helper.EnumFeatures(poemuiobj, 0, m_pmszRaw, m_dwSize, &dwNeeded); - if( (E_OUTOFMEMORY == hrResult) && (m_dwSize < dwNeeded)) - { - PSTR pTemp; - - - // INVARIANT: feature list multi-sz wasn't large enough. - - - // Re-allocate the buffer and try again. - pTemp = (PSTR) HeapReAlloc(m_hHeap, HEAP_ZERO_MEMORY, m_pmszRaw, dwNeeded); - if(NULL == pTemp) - { - ERR(ERRORTEXT("CFeatures::Acquire() re-alloc for feature list failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - m_pmszRaw = pTemp; - m_dwSize = dwNeeded; - - // Try again to get the feature list. - hrResult = Helper.EnumFeatures(poemuiobj, 0, m_pmszRaw, m_dwSize, &dwNeeded); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("CFeatures::Acquire() failed to EnumFeatures() after re-allocating buffer.\r\n")); - - goto Exit; - } - } - - // Make sure we got the feature list. - // Can't do anything more with out it. - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("CFeatures::Acquire() failed to enumerate features. (hrResult = 0x%x)\r\n"), hrResult); - - goto Exit; - } - - // INVARIANT: successfully got feature keyword list. - - // Create array of string pointers to the feature keywords - // in the multi-sz we got from EnumFreatures(). - hrResult = MakeStrPtrList(m_hHeap, m_pmszRaw, &m_ppszKeywords, &m_wFeatures); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("CFeatures::Acquire() failed to create pointer list to keywords. (hrResult = 0x%x)\r\n"), hrResult); - - goto Exit; - } - - - // - // Build Feature Information - // - - - // Allocate array to hold feature info - // Use new for allocation so class - // constructors/destructors get called. - m_pInfo = new FEATURE_INFO[m_wFeatures]; - if(NULL == m_pInfo) - { - ERR(ERRORTEXT("CFeatures::Acquire() failed to alloc feature info array.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // For each feature, build/get feature info.... - for(wIndex = 0; wIndex < m_wFeatures; ++wIndex) - { - PFEATURE_INFO pCurrent = m_pInfo + wIndex; - - - // Get or build a keyword mapping entry - // that maps from keyword to usefully where to get info, such as - // display name, icon, option type, for keywords that may not be - // able to get info for from Helper. - pCurrent->pMapping = FindKeywordMapping(gkmFeatureMap, NUM_FEATURE_MAP, m_ppszKeywords[wIndex]); - - // Get display names for each of the featurs. - // The function implements a heuristic for detemining the display name, - // since can't get the display name from the UI Helper for all features. - hrResult = DetermineFeatureDisplayName(m_hHeap, - Helper, - poemuiobj, - m_ppszKeywords[wIndex], - pCurrent->pMapping, - &pCurrent->pszDisplayName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("CFeatures::Acquire() failed to get display name for feature %hs. (hrResult = 0x%x)\r\n"), - m_ppszKeywords[wIndex], - hrResult); - - goto Exit; - } - - // Get options for each feature. - // NOTE: some features don't have options; the HRESULT will be E_NOTIMPL for these. - hrResult = pCurrent->Options.Acquire(hHeap, - Helper, - poemuiobj, - m_ppszKeywords[wIndex]); - if(!SUCCEEDED(hrResult) && (E_NOTIMPL != hrResult)) - { - ERR(ERRORTEXT("CFeatures::Acquire() failed to get options for feature %hs. (hrResult = 0x%x)\r\n"), - m_ppszKeywords[wIndex], - hrResult); - - goto Exit; - } - - // Determine if feature is Printer or Document sticky. - hrResult = DetermineStickiness(Helper, - poemuiobj, - m_ppszKeywords[wIndex], - pCurrent->pMapping, - &pCurrent->dwMode); - // Don't propagate error if failure from unhandled driver feature. - if( !SUCCEEDED(hrResult) - && - !IS_DRIVER_FEATURE(m_ppszKeywords[wIndex]) - ) - { - ERR(ERRORTEXT("CFeatures::Acquire() failed to determine stickiness for feature %hs. (hrResult = 0x%x)\r\n"), - m_ppszKeywords[wIndex], - hrResult); - - goto Exit; - } - - // Keep track of mode counts. - switch(pCurrent->dwMode) - { - case OEMCUIP_DOCPROP: - ++m_wDocFeatures; - break; - - case OEMCUIP_PRNPROP: - ++m_wPrintFeatures; - break; - - default: - ERR(ERRORTEXT("CFeatures::Acquire() unknown stickiness for feature %hs.\r\n"), - m_ppszKeywords[wIndex]); - break; - } - - } - - // INVARIANT: successfully build feature list. - - // Make sure that we always return success if we reach this point. - hrResult = S_OK; - - -Exit: - - // Clean up if weren't successful. - if(!SUCCEEDED(hrResult)) - { - Clear(); - } - - - VERBOSE(DLLTEXT("CFeatures::Acquire() returning HRESULT of 0x%x.\r\n"), hrResult); - - return hrResult; -} - -// Returns number of features contained in class instance. -WORD CFeatures::GetCount(DWORD dwMode) const -{ - WORD wCount = 0; - - - switch(dwMode) - { - // Number of features, all modes - case 0: - wCount = m_wFeatures; - break; - - case OEMCUIP_DOCPROP: - wCount = m_wDocFeatures; - break; - - case OEMCUIP_PRNPROP: - wCount = m_wPrintFeatures; - break; - - } - - VERBOSE(DLLTEXT("CFeatures::GetCount() returning %d\r\n"), wCount); - - return wCount; -} - -// Returns nth feature's keyword -PCSTR CFeatures::GetKeyword(WORD wIndex, DWORD dwMode) const -{ - // Validate parameters. - if( (wIndex >= GetCount(dwMode)) - || - (NULL == m_ppszKeywords) - ) - { - return NULL; - } - - // Get internal index. - wIndex = GetModelessIndex(wIndex, dwMode); - - // Return keyword - return m_ppszKeywords[wIndex]; -} - -// Return nth feature's Display Name. -PCWSTR CFeatures::GetName(WORD wIndex, DWORD dwMode) const -{ - // Validate parameters. - if( (wIndex >= GetCount(dwMode)) - || - (NULL == m_pInfo) - ) - { - return NULL; - } - - // Get internal index. - wIndex = GetModelessIndex(wIndex, dwMode); - - // Return display name. - return m_pInfo[wIndex].pszDisplayName; -} - -// Returns pointer to option class for nth feature. -COptions* CFeatures::GetOptions(WORD wIndex, DWORD dwMode) const -{ - // Validate parameters. - if( (wIndex >= GetCount(dwMode)) - || - (NULL == m_pInfo) - ) - { - return NULL; - } - - // Get internal index. - wIndex = GetModelessIndex(wIndex, dwMode); - - // Return options pointer. - return &m_pInfo[wIndex].Options; -} - -// Formats OPTITEM for specied feature. -HRESULT CFeatures::InitOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem, WORD wIndex, DWORD dwMode) -{ - COptions *pOptions = NULL; - HRESULT hrResult = S_OK; - PFEATUREOPTITEMDATA pData = NULL; - - - // Validate parameters. - if( (wIndex >= GetCount(dwMode)) - || - (NULL == m_pInfo) - || - (NULL == pOptItem) - ) - { - return E_INVALIDARG; - } - - // Map mode index to internal index. - wIndex = GetModelessIndex(wIndex, dwMode); - - // Get name of feature. - pOptItem->pName = const_cast(GetName(wIndex)); - - // Add feature OPTITEM data to OPTITEM to facilitate saving - // selection changes. - pData = (PFEATUREOPTITEMDATA) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(FEATUREOPTITEMDATA)); - if(NULL == pData) - { - ERR(ERRORTEXT("CFeatures::InitOptItem() failed to allocated memory for feature OPTITEM data.")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - pData->dwSize = sizeof(FEATUREOPTITEMDATA); - pData->dwTag = FEATURE_OPTITEM_TAG; - pData->pszFeatureKeyword = GetKeyword(wIndex); - pData->pOptions = GetOptions(wIndex); - pOptItem->UserData = (ULONG_PTR) pData; - - - // Get pointer to options for this feature. - // NOTE: some features do not have option list for various reasons. - pOptions = GetOptions(wIndex); - if(NULL != pOptions) - { - // Initialize COption parts of the OPTITEM - hrResult = pOptions->InitOptItem(hHeap, pOptItem); - } - -Exit: - - Dump(pOptItem); - - return hrResult; -} - -////////////////////////////////////////////////// -// -// Regular functions not part of class -// -////////////////////////////////////////////////// - - -// Maps feature keywords to display names for the features. -HRESULT DetermineFeatureDisplayName(_In_ HANDLE hHeap, - CUIHelper &Helper, - POEMUIOBJ poemuiobj, - _In_ PCSTR pszKeyword, - const PKEYWORDMAP pMapping, - _Outptr_result_maybenull_ PWSTR *ppszDisplayName) -{ - DWORD dwDataType = 0; - DWORD dwSize = INITIAL_FEATURE_DISPLAY_NAME_SIZE; - DWORD dwNeeded = 0; - HRESULT hrResult = S_OK; - - - // Validate parameters. - if( (NULL == hHeap) - || - (NULL == pszKeyword) - || - (NULL == ppszDisplayName) - ) - { - ERR(ERRORTEXT("DetermineFeatureDisplayName() invalid arguement.\r\n")); - - hrResult = E_INVALIDARG; - goto Exit; - } - - // - // Call the Helper function. - // - - // Helper will return Display Names for PPD Features, but - // not for Driver Synthisized features (i.e. features prefixed with %). - // Do it for Driver Synthisized features, just in case the helper - // interface changes to support it. - - // Pre-allocate a buffer of reasonable size to try - // to one have to call GetFeatureAttribute() once. - *ppszDisplayName = (PWSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize); - if(NULL == *ppszDisplayName) - { - ERR(ERRORTEXT("DetermineFeatureDisplayName() alloc for feature display name failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Try to get diplay name for feature from Helper. - hrResult = Helper.GetFeatureAttribute(poemuiobj, - 0, - pszKeyword, - "DisplayName", - &dwDataType, - (PBYTE) *ppszDisplayName, - dwSize, - &dwNeeded); - if( (E_OUTOFMEMORY == hrResult) && (dwSize < dwNeeded)) - { - PWSTR pTemp; - - - // INVARIANT: initial buffer wasn't large enough. - - // Re-alloc buffer and try again. - pTemp = (PWSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, *ppszDisplayName, dwNeeded); - if(NULL == pTemp) - { - ERR(ERRORTEXT("DetermineFeatureDisplayName() re-alloc for feature display name failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - *ppszDisplayName = pTemp; - - // Try to get the display name from Helper, again. - hrResult = Helper.GetFeatureAttribute(poemuiobj, - 0, - pszKeyword, - "DisplayName", - &dwDataType, - (PBYTE) *ppszDisplayName, - dwNeeded, - &dwNeeded); - } - - if(SUCCEEDED(hrResult)) - { - // INVARIANT: Successfully got display name from Helper for feature. - // Don't need to do anything more. - - // Check the data type, it should be kADT_UNICODE. - if(kADT_UNICODE != dwDataType) WARNING(DLLTEXT("DetermineFeatureDisplayName() feature attribute type not kADT_UNICODE. (dwDataType = %d)\r\n"), dwDataType); - - goto Exit; - } - - // INVARIANT: Did not get the display name from the Helper. - - // Free memory allocated for call to Helper. - if(NULL != *ppszDisplayName) - { - HeapFree(hHeap, 0, *ppszDisplayName); - *ppszDisplayName = NULL; - } - - // Try alternative methods for getting the display name other - // than from the Helper function. - // If we have a mapping entry, then try to get resource string - // for the display name. - // Otherwise, covert the keyword to UNICODE and use that. - if(NULL != pMapping) - { - // - // Try mapping the keyword to resource string. - // - - hrResult = GetDisplayNameFromMapping(hHeap, pMapping, ppszDisplayName); - } - else - { - // - // Convert the keyword to UNICODE and use that. - // - - // Convert ANSI keyword to Unicode string for display name. - // Need to remove the % for Driver Synthisized features. - // For debug version, add marker that shows that the display name was faked. - PCSTR pConvert = IS_DRIVER_FEATURE(pszKeyword) ? pszKeyword + 1 : pszKeyword; - #if DBG - CHAR szTemp[256]; - if(FAILED(StringCbPrintfA(szTemp, sizeof(szTemp), "%s (Keyword)", pConvert))) - { - ERR(ERRORTEXT("DetermineFeatureDisplayName() StringCbPrintfA() called failed.\r\n")); - } - pConvert = szTemp; - #endif - *ppszDisplayName = MakeUnicodeString(hHeap, pConvert); - if(NULL == *ppszDisplayName) - { - ERR(ERRORTEXT("DetermineFeatureDisplayName() alloc for feature display name failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Return success even though we faked a display name. - hrResult = S_OK; - } - - -Exit: - - // If failed, then return no string. - if(!SUCCEEDED(hrResult)) - { - if(ppszDisplayName && NULL != *ppszDisplayName) - { - HeapFree(hHeap, 0, *ppszDisplayName); - *ppszDisplayName = NULL; - } - } - - return hrResult; -} - -// Maps option keywords to display names for the option. -HRESULT DetermineOptionDisplayName(_In_ HANDLE hHeap, - CUIHelper &Helper, - POEMUIOBJ poemuiobj, - _In_ PCSTR pszFeature, - _In_ PCSTR pszOption, - const PKEYWORDMAP pMapping, - _Outptr_result_maybenull_ PWSTR *ppszDisplayName) -{ - DWORD dwDataType = 0; - DWORD dwSize = INITIAL_OPTION_DISPLAY_NAME_SIZE; - DWORD dwNeeded = 0; - HRESULT hrResult = S_OK; - - - // Validate parameters. - if( (NULL == hHeap) - || - (NULL == pszFeature) - || - (NULL == pszOption) - || - (NULL == ppszDisplayName) - ) - { - ERR(ERRORTEXT("DetermineOptionDisplayName() invalid arguement.\r\n")); - - hrResult = E_INVALIDARG; - goto Exit; - } - - // - // Call the Helper function. - // - - // Helper will return Display Names for PPD Feature Options, but - // not for Driver Synthisized features options (i.e. features prefixed with %). - // Do it for all options, just in case the helper interface changes to support it. - - // Pre-allocate a buffer of reasonable size to try - // to one have to call GetOptionAttribute() once. - *ppszDisplayName = (PWSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize); - if(NULL == *ppszDisplayName) - { - ERR(ERRORTEXT("DetermineOptionDisplayName() alloc for feature display name failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Try to get diplay name for feature from Helper. - hrResult = Helper.GetOptionAttribute(poemuiobj, - 0, - pszFeature, - pszOption, - "DisplayName", - &dwDataType, - (PBYTE) *ppszDisplayName, - dwSize, - &dwNeeded); - if( (E_OUTOFMEMORY == hrResult) && (dwSize < dwNeeded)) - { - PWSTR pTemp; - - - // INVARIANT: initial buffer wasn't large enough. - - // Re-alloc buffer and try again. - pTemp = (PWSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, *ppszDisplayName, dwNeeded); - if(NULL == pTemp) - { - ERR(ERRORTEXT("GetOptionAttribute() re-alloc for feature display name failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - *ppszDisplayName = pTemp; - - // Try to get the display name from Helper, again. - hrResult = Helper.GetOptionAttribute(poemuiobj, - 0, - pszFeature, - pszOption, - "DisplayName", - &dwDataType, - (PBYTE) *ppszDisplayName, - dwNeeded, - &dwNeeded); - } - - if(SUCCEEDED(hrResult)) - { - // INVARIANT: Successfully got display name from Helper for feature. - // Don't need to do anything more. - - // Check the data type, it should be kADT_UNICODE. - if(kADT_UNICODE != dwDataType) WARNING(DLLTEXT("DetermineOptionDisplayName() feature attribute type not kADT_UNICODE. (dwDataType = %d)\r\n"), dwDataType); - - goto Exit; - } - - // INVARIANT: Did not get the display name from the Helper. - - // Free memory allocated for call to Helper. - if(NULL != *ppszDisplayName) - { - HeapFree(hHeap, 0, *ppszDisplayName); - *ppszDisplayName = NULL; - } - - // Try alternative methods for getting the display name other - // than from the Helper function. - // If we have a mapping entry, then try to get resource string - // for the display name. - // Otherwise, covert the keyword to UNICODE and use that. - if(NULL != pMapping) - { - // - // Try mapping the keyword to resource string. - // - - hrResult = GetDisplayNameFromMapping(hHeap, pMapping, ppszDisplayName); - } - else - { - // - // Convert the keyword to UNICODE and use that. - // - - // Convert ANSI keyword to Unicode string for display name. - // For debug version, add marker that shows that the display name was faked. - PCSTR pConvert = pszOption; - #if DBG - CHAR szTemp[256]; - if(FAILED(StringCbPrintfA(szTemp, sizeof(szTemp), "%s (Keyword)", pConvert))) - { - ERR(ERRORTEXT("DetermineOptionDisplayName() StringCbPrintfA() called failed.\r\n")); - } - pConvert = szTemp; - #endif - *ppszDisplayName = MakeUnicodeString(hHeap, pConvert); - if(NULL == *ppszDisplayName) - { - ERR(ERRORTEXT("DetermineOptionDisplayName() alloc for feature display name failed.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Return success even though we faked a display name. - hrResult = S_OK; - } - - -Exit: - - // If failed, then return no string. - if(!SUCCEEDED(hrResult)) - { - if(ppszDisplayName && NULL != *ppszDisplayName) - { - HeapFree(hHeap, 0, *ppszDisplayName); - *ppszDisplayName = NULL; - } - } - - return hrResult; -} - -// Determines sticky mode for the feature. -HRESULT DetermineStickiness(CUIHelper &Helper, - POEMUIOBJ poemuiobj, - PCSTR pszKeyword, - const PKEYWORDMAP pMapping, - PDWORD pdwMode) -{ - CHAR szGroupType[32] = {0}; - DWORD dwType = 0; - DWORD dwNeeded = 0; - HRESULT hrResult = S_OK; - - - // Use mapping to see what stickiness of the feature is. - if(NULL != pMapping) - { - *pdwMode = pMapping->dwMode; - goto Exit; - } - - // By default make feature Document sticky, if we don't have mapping. - *pdwMode = OEMCUIP_DOCPROP; - - // Try to use Helper to determine stickiness. - hrResult = Helper.GetFeatureAttribute(poemuiobj, - 0, - pszKeyword, - "OpenGroupType", - &dwType, - (PBYTE) szGroupType, - sizeof(szGroupType), - &dwNeeded); - if(SUCCEEDED(hrResult)) - { - // INVARIANT: found out if feature is an installable option. - // Installable options are the only PPD features - // that are Printer sticky. - - if(!lstrcmpA(szGroupType, "InstallableOptions")) - { - *pdwMode = OEMCUIP_PRNPROP; - } - goto Exit; - } - - -Exit: - - return hrResult; -} - -// Find the mapping entry from the keyword. -PKEYWORDMAP FindKeywordMapping(PKEYWORDMAP pKeywordMap, WORD wMapSize, PCSTR pszKeyword) -{ - BOOL bFound = FALSE; - PKEYWORDMAP pMapping = NULL; - - - // Walk mapping array for matching keyword. - for(WORD wIndex = 0; !bFound && (wIndex < wMapSize); ++wIndex) - { - bFound = !lstrcmpA(pszKeyword, pKeywordMap[wIndex].pszKeyword); - if(bFound) - { - pMapping = pKeywordMap + wIndex; - } - } - - return pMapping; -} - -// Get display name from mapping entry. -HRESULT GetDisplayNameFromMapping(_In_ HANDLE hHeap, PKEYWORDMAP pMapping, _Outptr_result_maybenull_ PWSTR *ppszDisplayName) -{ - HMODULE hModule = NULL; - HRESULT hrResult = S_OK; - - - // Validate parameters. - if( (NULL == hHeap) - || - (NULL == pMapping) - || - (NULL == ppszDisplayName) - ) - { - hrResult = E_INVALIDARG; - goto Exit; - } - - // Check for simple case of returning INT resource. - if( (NULL == pMapping->pwszModule) - || - IS_MAPPING_INT_RESOURCE(pMapping) - ) - { - // Just need to do MAKEINTRESOURCE on the resource ID and return. - *ppszDisplayName = MAKEINTRESOURCE(pMapping->uDisplayNameID); - goto Exit; - } - - // We only need to get the module if we aren't loading the resource from - // this module (i.e. if module name isn't NULL). - // Also, as an optimization, we assume that the module has already been loaded, - // since the only cases currently are this module, driver ui, and Compstui.dll. - hModule = GetModuleHandle(pMapping->pwszModule); - if(NULL == hModule) - { - DWORD dwError = GetLastError(); - - - ERR(ERRORTEXT("GetDisplayNameFromMapping() for failed to load module %s. (Error %d)\r\n"), - pMapping->pwszModule, - dwError); - - hrResult = HRESULT_FROM_WIN32(dwError); - goto Exit; - } - - // INVARIANT: have handle to module to load resource from or the - // resource is being loaded from this module. - - // Get the string resouce. - hrResult = GetStringResource(hHeap, hModule, pMapping->uDisplayNameID, ppszDisplayName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("GetDisplayNameFromMapping() failed to load string. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - -Exit: - - return hrResult; -} - -// Test if an OPTITEM is an OPTITEM for a feature. -// Macro for testing if OPTITEM is feature OPTITEM -BOOL IsFeatureOptitem(POPTITEM pOptItem) -{ - BOOL bRet = FALSE; - PFEATUREOPTITEMDATA pData = NULL; - - - // Make sure pointers are NULL. - if( (NULL == pOptItem) - || - (NULL == pOptItem->UserData) - ) - { - // INVARIANT: can't be feature OPTITEM, since one of - // the necessary pointer are NULL. - - return FALSE; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItem->UserData); - - // Check size and tag. - bRet = (sizeof(FEATUREOPTITEMDATA) == pData->dwSize) - && - (FEATURE_OPTITEM_TAG == pData->dwTag); - - return bRet; -} - - - -// Walks array of OPTITEMs saving each feature OPTITEM -// that has changed. -HRESULT SaveFeatureOptItems(_In_ HANDLE hHeap, - CUIHelper *pHelper, - POEMUIOBJ poemuiobj, - HWND hWnd, - POPTITEM pOptItem, - WORD wItems) -{ - PSTR pmszPairs = NULL; - WORD wPairs = 0; - WORD wReasons = 0; - DWORD dwSize = 0; - DWORD dwResult = 0; - PCSTR *ppszReasons = NULL; - PWSTR pszConfilictFeature = NULL; - PWSTR pszConfilictOption = NULL; - PWSTR pszCaption = NULL; - PWSTR pszFormat = NULL; - PWSTR pszMessage = NULL; - HRESULT hrResult = S_OK; - - - // Validate parameters - if( (NULL == hHeap) - || - (NULL == pHelper) - || - (NULL == pOptItem) - ) - { - ERR(ERRORTEXT("SaveFeatureOptItems() called with invalid parameters.\r\n")); - - hrResult = E_INVALIDARG; - goto Exit; - } - - // Get feature option pairs to save. - hrResult = GetChangedFeatureOptions(hHeap, pOptItem, wItems, &pmszPairs, &wPairs, &dwSize); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems() failed to get changed feature option pairs. (hrResult = 0x%x)\r\n"), - hrResult); - - goto Exit; - } - - // Don't need to do anything more if no feature options changed. - if(0 == wPairs || !pmszPairs) - { - VERBOSE(DLLTEXT("SaveFeatureOptItems() no feature options that need to be set.\r\n")); - - goto Exit; - } - - // Set the change feature options. - // For the first SetOptions() call, don't have the - // core driver UI resolve conflicts, so we can - // prompt user for automatic resolution or let - // them do the conflict resolving. - hrResult = pHelper->SetOptions(poemuiobj, - SETOPTIONS_FLAG_KEEP_CONFLICT, - pmszPairs, - dwSize, - &dwResult); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems() call to SetOptions() failed. (hrResult = 0x%x, dwResult = %d\r\n"), - hrResult, - dwResult); - - goto Exit; - } - - // Check to see if we were able to save changed feature options, - // or if there is a conflict that needs resolution. - if(SETOPTIONS_RESULT_CONFLICT_REMAINED == dwResult) - { - int nRet; - DWORD dwRet; - CONFLICT Conflict; - PKEYWORDMAP pMapping = NULL; - - - // INVARIANT: constraint conflict, options weren't saved. - - // Get list of all features that have conflict. - hrResult = GetFirstConflictingFeature(hHeap, - pHelper, - poemuiobj, - pOptItem, - wItems, - &Conflict); - if(!SUCCEEDED(hrResult)) - { - goto Exit; - } - - // Create string pointer list in to multi-sz of first conflict. - hrResult = MakeStrPtrList(hHeap, Conflict.pmszReasons, &ppszReasons, &wReasons); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems() failed to make string list for conflict reasons. (hrResult = 0x%x)\r\n"), - hrResult); - - goto Exit; - } - - // Ensure that we have at least 2 reasons. Later code assumes that we do. - if (wReasons < 2) - { - hrResult = E_UNEXPECTED; - - goto Exit; - } - - // - // Get display versions of feature/option conflict reason. - // - - // Get or build a keyword mapping entry - // that maps from keyword to usefully where to get info, such as - // display name, icon, option type, for keywords that may not be - // able to get info for from Helper. - pMapping = FindKeywordMapping(gkmFeatureMap, NUM_FEATURE_MAP, ppszReasons[0]); - - // Get display names for each of the featurs. - // The function implements a heuristic for detemining the display name, - // since can't get the display name from the UI Helper for all features. - hrResult = DetermineFeatureDisplayName(hHeap, - *pHelper, - poemuiobj, - ppszReasons[0], - pMapping, - &pszConfilictFeature); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems failed to get display name for feature %hs. (hrResult = 0x%x)\r\n"), - ppszReasons[0], - hrResult); - - goto Exit; - } - - // Get or build a keyword mapping entry - // that maps from keyword to usefully where to get info, such as - // display name, icon, option type, for keywords that may not be - // able to get info for from Helper. - pMapping = FindKeywordMapping(gkmOptionMap, NUM_OPTION_MAP, ppszReasons[1]); - - // Get option display name. - hrResult = DetermineOptionDisplayName(hHeap, - *pHelper, - poemuiobj, - ppszReasons[0], - ppszReasons[1], - pMapping, - &pszConfilictOption); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems() failed to get display name for %hs of feature %hs. (hrResult = 0x%x)\r\n"), - ppszReasons[1], - ppszReasons[0], - hrResult); - - goto Exit; - } - - // - // Prompt user about how to resolve conflict. - // - - // Get caption name. - hrResult = GetStringResource(hHeap, ghInstance, IDS_NAME, &pszCaption); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems() failed to get caption name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - // Get message body format string. - hrResult = GetStringResource(hHeap, ghInstance, IDS_CONSTRAINT_CONFLICT, &pszFormat); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems() failed to get constraint conflict format. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - - // Get messsage body. - PVOID paArgs[4] = {pszConfilictFeature, - pszConfilictOption, - const_cast(Conflict.pszFeature), - Conflict.pszOption - }; - dwRet = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, - pszFormat, - 0, - 0, - (PWSTR) &pszMessage, - 0, - (va_list *) paArgs); - if(0 == dwRet) - { - DWORD dwError = GetLastError(); - - ERR(ERRORTEXT("SaveFeatureOptItems() failed to FormatMessage() for constraint conflict of feature %hs option %hs. (Last Error %d)\r\n"), - Conflict.pszFeatureKeyword, - Conflict.pszOptionKeyword, - dwError); - - hrResult = HRESULT_FROM_WIN32(dwError); - goto Exit; - } - - // Display simple message box with prompt. - nRet = MessageBox(hWnd, pszMessage, pszCaption, MB_YESNO | MB_ICONWARNING); - - // Check to see how user wants to resolve conflict. - if(IDYES == nRet) - { - // Let core driver resolve conflict resolution. - hrResult = pHelper->SetOptions(poemuiobj, - SETOPTIONS_FLAG_RESOLVE_CONFLICT, - pmszPairs, - dwSize, - &dwResult); - - // Conflict resolution requires refreshing current option - // selection for each feature, since selection may have - // changed because of conflict resolution. - RefreshOptItemSelection(pHelper, poemuiobj, pOptItem, wItems); - } - - // Return failure if there are still conflictts. - if(SETOPTIONS_RESULT_CONFLICT_REMAINED == dwResult) - { - hrResult = E_FAIL; - } - } - - -Exit: - - // Clean up... - - // cleanup heap allocs. - if(NULL != pmszPairs) HeapFree(hHeap, 0, pmszPairs); - if(NULL != ppszReasons) HeapFree(hHeap, 0, ppszReasons); - if(NULL != pszConfilictFeature) HeapFree(hHeap, 0, pszConfilictFeature); - if(NULL != pszConfilictOption) HeapFree(hHeap, 0, pszConfilictOption); - if(NULL != pszCaption) HeapFree(hHeap, 0, pszCaption); - if(NULL != pszFormat) HeapFree(hHeap, 0, pszFormat); - if(NULL != pszMessage) LocalFree(pszMessage); - - return hrResult; -} - -// Allocates buffer, if needed, and calls IPrintCoreUI2::WhyConsrained -// to get reason for constraint. -HRESULT GetWhyConstrained(_In_ HANDLE hHeap, - CUIHelper *pHelper, - POEMUIOBJ poemuiobj, - _In_ PCSTR pszFeature, - _In_ PCSTR pszOption, - _Inout_ PSTR *ppmszReason, - _Inout_ PDWORD pdwSize) -{ - PSTR pmszReasonList = *ppmszReason; - DWORD dwNeeded = 0; - HRESULT hrResult = S_OK; - - - // If buffer wasn't passed in, then allocate one. - if( (NULL == pmszReasonList) || (0 == *pdwSize) ) - { - // If no size or size is smaller than default, then change to default - // size. We want to try to only allocate and call once. - if(*pdwSize < INITIAL_GET_REASON_SIZE) - { - *pdwSize = INITIAL_GET_REASON_SIZE; - } - - // Alloc initial buffer for reason constrained. - pmszReasonList = (PSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, *pdwSize); - if(NULL == pmszReasonList) - { - ERR(ERRORTEXT("GetWhyConstrained() failed to alloc buffer for constraint reasons for feature %hs and option %hs.\r\n"), - pszFeature, - pszOption); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - } - - // Get reason for constraint. - hrResult = pHelper->WhyConstrained(poemuiobj, - 0, - pszFeature, - pszOption, - pmszReasonList, - *pdwSize, - &dwNeeded); - if( (E_OUTOFMEMORY == hrResult) - && - (*pdwSize < dwNeeded) - ) - { - PSTR pTemp; - - - // INVARIANT: initial buffer not large enough. - - // Re-alloc buffer to needed size. - pTemp = (PSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pmszReasonList, dwNeeded); - if(NULL == pTemp) - { - ERR(ERRORTEXT("GetWhyConstrained() failed to re-allocate buffer for constraint reason for feature %hs and option %hs.\r\n"), - pszFeature, - pszOption); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - pmszReasonList = pTemp; - *pdwSize = dwNeeded; - - // Retry getting constaint reason. - hrResult = pHelper->WhyConstrained(poemuiobj, - 0, - pszFeature, - pszOption, - pmszReasonList, - *pdwSize, - &dwNeeded); - } - - -Exit: - - // On error, do clean up. - if(!SUCCEEDED(hrResult)) - { - // Free reason buffer. - if(NULL != pmszReasonList) HeapFree(hHeap, 0, pmszReasonList); - - // Return NULL and zero size. - *ppmszReason = NULL; - *pdwSize = 0; - } - else - { - *ppmszReason = pmszReasonList; - } - - return hrResult; -} - -// Creates multi-sz list of feature option pairs that have changed. -HRESULT GetChangedFeatureOptions(_In_ HANDLE hHeap, - POPTITEM pOptItem, - WORD wItems, - _Outptr_result_maybenull_ PSTR *ppmszPairs, - _Out_ PWORD pwPairs, - _Out_ PDWORD pdwSize) -{ - WORD wCount = 0; - WORD wChanged = 0; - WORD wPairs = 0; - PSTR pmszPairs = NULL; - DWORD dwNeeded = 2; - DWORD dwOffset = 0; - HRESULT hrResult = S_OK; - PFEATUREOPTITEMDATA pData = NULL; - - - // Walk OPTITEM array looking or changed options, - // and calculating size needed for multi-sz buffer. - for(wCount = 0; wCount < wItems; ++wCount) - { - PSTR pszOption = NULL; - - - // Just go to next item if this OPTITEM hasn't - // changed or isn't a feature OPTITEM. - if( !(OPTIF_CHANGEONCE & pOptItem[wCount].Flags) - || - !IsFeatureOptitem(pOptItem + wCount) - ) - { - continue; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItem[wCount].UserData); - - // Increment options changed and size needed. - pszOption = GetOptionKeywordFromOptItem(hHeap, pOptItem + wCount); - if(NULL != pszOption) - { - ++wChanged; - - DWORD dwTmp = 0; - - if (FAILED(hrResult = SizeTToDWord(strlen(pData->pszFeatureKeyword) + strlen(pszOption) + 2, &dwTmp))) - { - goto Exit; - } - - dwNeeded += dwTmp; - - // Need to free option keyword string copy - // allocated in GetOptionKeywordFromOptItem(). - HeapFree(hHeap, 0, pszOption); - pszOption = NULL; - } - } - - // Don't need to do anything more if no feature options changed. - if(0 == wChanged) - { - goto Exit; - } - - // Allocate multi-sz buffer. - pmszPairs = (PSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwNeeded); - if(NULL == pmszPairs) - { - ERR(ERRORTEXT("GetChangedFeatureOptions() failed to allocate multi-sz.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Build mult-sz list of feature option pairs - // that changed. - for(wCount = 0, wPairs = 0; (wCount < wItems) && (wPairs < wChanged); ++wCount) - { - PSTR pszOption = NULL; - - - // Just go to next item if this OPTITEM hasn't - // changed or isn't a feature OPTITEM. - if( !(OPTIF_CHANGEONCE & pOptItem[wCount].Flags) - || - !IsFeatureOptitem(pOptItem + wCount) - ) - { - continue; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItem[wCount].UserData); - - // Add feature option pair. - pszOption = GetOptionKeywordFromOptItem(hHeap, pOptItem + wCount); - if(NULL != pszOption) - { - if (FAILED(hrResult = StringCbCopyA(pmszPairs + dwOffset, dwNeeded - dwOffset, pData->pszFeatureKeyword))) - { - goto Exit; - } - - DWORD dwTmp = 0; - - if (FAILED(hrResult = SizeTToDWord(strlen(pData->pszFeatureKeyword) + 1, &dwTmp))) - { - goto Exit; - } - - dwOffset += dwTmp; - - if (FAILED(hrResult = StringCbCopyA(pmszPairs + dwOffset, dwNeeded - dwOffset, pszOption))) - { - goto Exit; - } - - if (FAILED(hrResult = SizeTToDWord(strlen(pszOption) + 1, &dwTmp))) - { - goto Exit; - } - - dwOffset += dwTmp; - - // Keep track of number of pairs added, so - // we are able to exit loop as soon as - // we added all changed feature options. - ++wPairs; - - // Need to free option keyword string copy - // allocated in GetOptionKeywordFromOptItem(). - HeapFree(hHeap, 0, pszOption); - pszOption = NULL; - } - } - - -Exit: - - if(SUCCEEDED(hrResult)) - { - // INVARIANT: either successfully build mutli-sz of changed - // feature option pairs, or there are no feature - // that options changed. - - // Return pairs and number of pairs. - *pwPairs = wPairs; - *pdwSize = dwNeeded; - *ppmszPairs = pmszPairs; - } - else - { - // INVARINAT: error. - - // Clean up. - if(NULL == pmszPairs) HeapFree(hHeap, 0, pmszPairs); - - // Return NULL and zero count. - *pwPairs = 0; - *pdwSize = 0; - *ppmszPairs = NULL; - } - - return hrResult; -} - -// Returns pointer to option keyword for a feature OPTITEM. -PSTR GetOptionKeywordFromOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem) -{ - char szNumber[16] = {0}; - PSTR pszOption = NULL; - PFEATUREOPTITEMDATA pData = NULL; - - - // Validate parameter. - if(!IsFeatureOptitem(pOptItem)) - { - ERR(ERRORTEXT("GetOptionKeywordFromOptItem() invalid parameter.\r\n")); - - goto Exit; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItem->UserData); - - // Option selection is based on type of OPTTYPE. - switch(pOptItem->pOptType->Type) - { - // For up down arrow control, selection is just pOptItem->Sel - // converted to string. - case TVOT_UDARROW: - if(FAILED(StringCbPrintfA(szNumber, sizeof(szNumber)/sizeof(szNumber[0]), "%u", pOptItem->Sel))) - { - ERR(ERRORTEXT("GetOptionKeywordFromOptItem() failed to convert number to string.\r\n")); - } - szNumber[sizeof(szNumber)/sizeof(szNumber[0]) - 1] = '\0'; - pszOption = MakeStringCopy(hHeap, szNumber); - break; - - // For combobox, pOptItem->Sel is the index in to the - // option array. - case TVOT_COMBOBOX: - pszOption = MakeStringCopy(hHeap, pData->pOptions->GetKeyword((WORD)pOptItem->Sel)); - break; - - // The default is the option count. - default: - ERR(ERRORTEXT("GetOptionKeywordFromOptItem() OPTTYPE type %d num of OPTPARAMs not handled.\r\n"), - pOptItem->pOptType->Type); - - goto Exit; - break; - } - - -Exit: - - return pszOption; -} - -// Returns pointer to option display name for a feature OPTITEM. -PWSTR GetOptionDisplayNameFromOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem) -{ - WCHAR szNumber[16] = {0}; - PWSTR pszOption = NULL; - PFEATUREOPTITEMDATA pData = NULL; - - - // Validate parameter. - if(!IsFeatureOptitem(pOptItem)) - { - ERR(ERRORTEXT("GetOptionDisplayNameFromOptItem() invalid parameter.\r\n")); - - goto Exit; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItem->UserData); - - // Option selection is based on type of OPTTYPE. - switch(pOptItem->pOptType->Type) - { - // For up down arrow control, selection is just pOptItem->Sel - // converted to string. - case TVOT_UDARROW: - if(FAILED(StringCbPrintfW(szNumber, sizeof(szNumber)/sizeof(szNumber[0]), L"%u", pOptItem->Sel))) - { - ERR(ERRORTEXT("GetOptionDisplayNameFromOptItem() failed to convert number to string.\r\n")); - } - szNumber[sizeof(szNumber)/sizeof(szNumber[0]) - 1] = L'\0'; - pszOption = MakeStringCopy(hHeap, szNumber); - break; - - // For combobox, pOptItem->Sel is the index in to the - // option array. - case TVOT_COMBOBOX: - pszOption = MakeStringCopy(hHeap, pOptItem->pOptType->pOptParam[pOptItem->Sel].pData); - break; - - // The default is the option count. - default: - ERR(ERRORTEXT("GetOptionDisplayNameFromOptItem() OPTTYPE type %d num of OPTPARAMs not handled.\r\n"), - pOptItem->pOptType->Type); - - goto Exit; - break; - } - - -Exit: - - return pszOption; -} - -// Refreshes option selection for each feature OPTITEM -HRESULT RefreshOptItemSelection(CUIHelper *pHelper, - POEMUIOBJ poemuiobj, - POPTITEM pOptItems, - WORD wItems) -{ - HRESULT hrResult = S_OK; - PFEATUREOPTITEMDATA pData = NULL; - - - // Walk OPTITEM array refreshing feature OPTITEMs. - for(WORD wCount = 0; wCount < wItems; ++wCount) - { - // Just go to next item if this OPTITEM isn't a feature OPTITEM. - if(!IsFeatureOptitem(pOptItems + wCount)) - { - continue; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItems[wCount].UserData); - - // Refresh COption selection. - pData->pOptions->RefreshSelection(*pHelper, poemuiobj); - - // Assign COption selection to OPTITEM selection. - pOptItems[wCount].pSel = pData->pOptions->GetSelection(); - - } - - return hrResult; -} - -// Creates array of conflict features. -HRESULT GetFirstConflictingFeature(_In_ HANDLE hHeap, - CUIHelper *pHelper, - POEMUIOBJ poemuiobj, - POPTITEM pOptItem, - WORD wItems, - PCONFLICT pConflict) -{ - WORD wCount = 0; - HRESULT hrResult = S_OK; - PFEATUREOPTITEMDATA pData = NULL; - - - // Walk OPTITEM array looking or changed options that are in conflict. - for(wCount = 0; wCount < wItems; ++wCount) - { - // Just go to next item if this OPTITEM hasn't - // changed or isn't a feature OPTITEM. - if( !(OPTIF_CHANGEONCE & pOptItem[wCount].Flags) - || - !IsFeatureOptitem(pOptItem + wCount) - ) - { - continue; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItem[wCount].UserData); - - // Init conflict record if this feature is in conflict. - pConflict->pszOptionKeyword = GetOptionKeywordFromOptItem(hHeap, pOptItem + wCount); - if(NULL != pConflict->pszOptionKeyword) - { - // Get reason for conflict - // If the feature isn't in conflict, - // then the pmszReasonList will start - // with NULL terminator. - hrResult = GetWhyConstrained(hHeap, - pHelper, - poemuiobj, - pData->pszFeatureKeyword, - pConflict->pszOptionKeyword, - &pConflict->pmszReasons, - &pConflict->dwReasonsSize); - if(!SUCCEEDED(hrResult)) - { - // NOTE: driver features aren't supported by WhyConstrained. - if((E_INVALIDARG == hrResult) && IS_DRIVER_FEATURE(pData->pszFeatureKeyword)) - { - // Need to reset the result in case it is the last - // feature OPTITEM. - hrResult = S_OK; - continue; - } - - ERR(ERRORTEXT("GetConflictingFeatures() failed to get reason for feature %hs option %hs constraint. (hrResult = 0x%x)\r\n"), - pData->pszFeatureKeyword, - pConflict->pszOptionKeyword, - hrResult); - - goto Exit; - } - - // Record conflict if feature is in conflict. - if( (NULL != pConflict->pmszReasons) - && - (pConflict->pmszReasons[0] != '\0') - ) - { - // Save pointer to feature keyword. - pConflict->pszFeatureKeyword = pData->pszFeatureKeyword; - pConflict->pszFeature = pOptItem[wCount].pName; - pConflict->pszOption = GetOptionDisplayNameFromOptItem(hHeap, pOptItem + wCount); - - // Found first conflict. - break; - } - } - } - - -Exit: - - return hrResult; -} - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.h deleted file mode 100644 index 84fee27e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Features.h +++ /dev/null @@ -1,236 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 2001 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Features.h -// - -#pragma once - -//////////////////////////////////////////////////////// -// Defines and Macros -//////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////// -// Type Definitions -//////////////////////////////////////////////////////// - -// Struct used to map keyword to information -// such as display name and stickiness. -typedef struct _tagKeywordMap -{ - PCSTR pszKeyword; - PCWSTR pwszModule; - UINT uDisplayNameID; - DWORD dwMode; - DWORD dwFlags; - -} KEYWORDMAP, *PKEYWORDMAP; - - -// Struct container for info about -// feature that is in conflict. -typedef struct _tagConflict -{ - PCSTR pszFeatureKeyword; - PCWSTR pszFeature; - PSTR pszOptionKeyword; - PWSTR pszOption; - PSTR pmszReasons; - DWORD dwReasonsSize; - -} CONFLICT, *PCONFLICT; - - - -//////////////////////////////////////////////////////// -// Class Definitions -//////////////////////////////////////////////////////// - -// Class wrapper and container for Core Driver Feature Options. -class COptions -{ - private: - - // Option Infomation - class OPTION_INFO - { - public: - PKEYWORDMAP pMapping; - PWSTR pszDisplayName; - - public: - OPTION_INFO() - { - pMapping = NULL; - pszDisplayName = NULL; - } - - virtual ~OPTION_INFO(){} - }; - typedef class OPTION_INFO *POPTION_INFO; - - // Data Members - WORD m_wOptions; // Count of the number of options contained for an instance of the class. - BYTE m_cType; // CPSUI Option Type (i.e. what to set pOptItem->pOptType->Type to). - PSTR m_pmszRaw; // The RAW multi NULL terminated string buffer used for IPrintCoreUI2::EnumOptions(). - PCSTR m_pszFeature; // Pointer to the feature for which the enumerate options belong. - PCSTR *m_ppszOptions; // String list pointer that points to begining of each of the strings in multi-SZ pointed to by m_pmszRaw. - POINT m_ptRange; // Option range for features, such as %JobTimeout, that have a range of possible vaules not a small selection list. - DWORD m_dwSize; // Size of m_pmszRaw buffer. - PWSTR m_pszUnits; // String that contains the unit specifier for options, such as %JobTimeout, which need Units (i.e. seconds). - HANDLE m_hHeap; // Heap to do allocations from. - POPTION_INFO m_pInfo; // Array of Info about each option for a feature. - - union { // Current selected option for a feature. - LONG m_Sel; // This is what pOptItem->m_pSel or pOptItem->m_Sel - LPTSTR m_pSel; // will be set to. - }; - - public: - COptions(); - virtual ~COptions(); - - // Populate Options list for specified keyword. - HRESULT COptions::Acquire(_In_ HANDLE hHeap, - CUIHelper &Helper, - _In_ POEMUIOBJ poemuiobj, - _In_ PCSTR pszFeature); - - // Returns number of feature options contained in class instance. - inline WORD GetCount() const {return m_wOptions;} - - // Returns selection. - inline LPTSTR GetSelection() const {return m_pSel;} - - // Return nth options keyword. - PCSTR GetKeyword(WORD wIndex) const; - - // Return nth option Display Name. - PCWSTR GetName(WORD wIndex) const; - - // Find option with matching keyword string. - WORD FindOption(_In_opt_ PCSTR pszOption, WORD wDefault) const; - - // Initializes options portion of OPTITEM. - HRESULT InitOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem); - - // Refresh option selection. - HRESULT RefreshSelection(CUIHelper &Helper, POEMUIOBJ poemuiobj); - - private: - void Init(); - void Clear(); - void FreeOptionInfo(); - HRESULT GetOptionsForSpecialFeatures(CUIHelper &Helper, POEMUIOBJ poemuiobj); - HRESULT GetOptionsForOutputPSLevel(CUIHelper &Helper, POEMUIOBJ poemuiobj); - HRESULT GetOptionSelectionString(CUIHelper &Helper, POEMUIOBJ poemuiobj, _Outptr_result_maybenull_ PSTR *ppszSel); - HRESULT GetOptionSelectionLong(CUIHelper &Helper, POEMUIOBJ poemuiobj); - HRESULT GetOptionSelectionShort(CUIHelper &Helper, POEMUIOBJ poemuiobj); - HRESULT GetOptionSelectionIndex(CUIHelper &Helper, POEMUIOBJ poemuiobj); -}; - - -// Class wrapper and container for Cor Driver Features. -class CFeatures -{ - private: - - // Feature Infomation - class FEATURE_INFO - { - public: - PKEYWORDMAP pMapping; - PWSTR pszDisplayName; - COptions Options; - DWORD dwMode; - - public: - FEATURE_INFO() - { - pMapping = NULL; - pszDisplayName = NULL; - dwMode = 0; - } - - virtual ~FEATURE_INFO() {} - }; - typedef class FEATURE_INFO *PFEATURE_INFO; - - WORD m_wFeatures; // Count of the number of features. - WORD m_wDocFeatures; // Count of the number of Document sticky features. - WORD m_wPrintFeatures; // Count of the number of Printer sticky features. - PSTR m_pmszRaw; // Buffer for multi-SZ for call to IPrintCoreUI2::EnumFeatures. - PCSTR *m_ppszKeywords; // String list that points to each of the strings in m_pmszRaw. - DWORD m_dwSize; // Size of m_pmszRaw. - HANDLE m_hHeap; // Heap to do allocations from. - PFEATURE_INFO m_pInfo; // Array of feature information about each of the enumerate features. - - public: - CFeatures(); - virtual ~CFeatures(); - - // Populates the Feature list - HRESULT Acquire(_In_ HANDLE hHeap, CUIHelper &Helper, _In_ POEMUIOBJ poemuiobj); - - // Returns number of features contained in class instance. - WORD GetCount(DWORD dwMode = 0) const; - - // Returns feature keyword. - PCSTR GetKeyword(WORD wIndex, DWORD dwMode = 0) const; - - // Return feature Display Name. - PCWSTR GetName(WORD wIndex, DWORD dwMode = 0) const; - - // Returns pointer to option class for nth feature. - COptions* GetOptions(WORD wIndex, DWORD dwMode = 0) const; - - // Initializes OPTITEM for the feature. - HRESULT InitOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem, WORD wIndex, DWORD dwMode); - - private: - void Init(); - void Clear(); - void FreeFeatureInfo(); - WORD GetModelessIndex(WORD wIndex, DWORD dwMode) const; -}; - - - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT DetermineFeatureDisplayName(_In_ HANDLE hHeap, CUIHelper &Helper, POEMUIOBJ poemuiobj, - _In_ PCSTR pszKeyword, const PKEYWORDMAP pMapping, - _Outptr_result_maybenull_ PWSTR *ppszDisplayName); -HRESULT DetermineOptionDisplayName(_In_ HANDLE hHeap, CUIHelper &Helper, POEMUIOBJ poemuiobj, - _In_ PCSTR pszFeature, _In_ PCSTR pszOption, - const PKEYWORDMAP pMapping, _Outptr_result_maybenull_ PWSTR *ppszDisplayName); -HRESULT DetermineStickiness(CUIHelper &Helper, POEMUIOBJ poemuiobj, PCSTR pszKeyword, - const PKEYWORDMAP pMapping,PDWORD pdwMode); - -PKEYWORDMAP FindKeywordMapping(PKEYWORDMAP pKeywordMap, WORD wMapSize, PCSTR pszKeyword); -HRESULT GetDisplayNameFromMapping(_In_ HANDLE hHeap, PKEYWORDMAP pMapping, _Outptr_result_maybenull_ PWSTR *ppszDisplayName); - -BOOL IsFeatureOptitem(POPTITEM pOptItem); -HRESULT SaveFeatureOptItems(_In_ HANDLE hHeap, CUIHelper *pHelper, POEMUIOBJ poemuiobj, - HWND hWnd, POPTITEM pOptItem, WORD wItems); -HRESULT GetWhyConstrained(_In_ HANDLE hHeap, CUIHelper *pHelper, POEMUIOBJ poemuiobj, - _In_ PCSTR pszFeature, _In_ PCSTR pszOption, _Inout_ PSTR *ppmszReason, - _Inout_ PDWORD pdwSize); -HRESULT GetChangedFeatureOptions(_In_ HANDLE hHeap, POPTITEM pOptItem, WORD wItems, - _Outptr_result_maybenull_ PSTR *ppmszPairs, _Out_ PWORD pdwPairs, _Out_ PDWORD pdwSize); -PSTR GetOptionKeywordFromOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem); -PWSTR GetOptionDisplayNameFromOptItem(_In_ HANDLE hHeap, POPTITEM pOptItem); -HRESULT RefreshOptItemSelection(CUIHelper *pHelper, POEMUIOBJ poemuiobj, POPTITEM pOptItems, - WORD wItems); -HRESULT GetFirstConflictingFeature(_In_ HANDLE hHeap, CUIHelper *pHelper, POEMUIOBJ poemuiobj, - POPTITEM pOptItem, WORD wItems, PCONFLICT pConflict); - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.cpp deleted file mode 100644 index 3e1a2da5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.cpp +++ /dev/null @@ -1,457 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 2001 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Helper.cpp -// -// -// PURPOSE: Implementation of wrapper class for Driver UI Helper interface. -// - -#include "precomp.h" -#include "Helper.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal Macros -//////////////////////////////////////////////////////// - - -// Macros for simplifying calling the Driver UI Helper interfaces correctly. - -#define CALL_HELPER(MethodName, args) \ - if (IsEqualGUID(&m_iidUIHelper, &IID_IPrintOemDriverUI)) \ - { \ - return static_cast(m_pUIHelper)->MethodName args; \ - } \ - else if (IsEqualGUID(&m_iidUIHelper, &IID_IPrintCoreUI2)) \ - { \ - return static_cast(m_pUIHelper)->MethodName args; \ - } \ - return E_NOINTERFACE; - -#define CALL_HELPER2(MethodName, args) \ - if (IsEqualGUID(&m_iidUIHelper, &IID_IPrintCoreUI2)) \ - { \ - return static_cast(m_pUIHelper)->MethodName args; \ - } \ - return E_NOINTERFACE; - - -///////////////////////////////////////////////////////////// -// -// CUIHelper Class Methods -// - -// -// Private Methods -// - -// Clears or initializes data members. -void CUIHelper::Clear() -{ - // Clear stored interface - m_pUIHelper = NULL; - m_iidUIHelper = GUID_NULL; -} - - -// -// Public Methods -// - -// Default contructor. -CUIHelper::CUIHelper() -{ - // Initialize the data members. - Clear(); -} - -// Constructor with assignment. -CUIHelper::CUIHelper(const IID &HelperIID, PVOID pHelper) -{ - // Assign the interface. - Assign(HelperIID, pHelper); -} - -// Destructor -CUIHelper::~CUIHelper() -{ - // Release the interface reference. - Release(); -} - -// Stores helper interface in helper entry structure. -void CUIHelper::Assign(const IID &HelperIID, PVOID pHelper) -{ - // If we already have a helper interface, release it. - if(IsValid()) - { - Release(); - } - - // Store helper interface and IID for it. - m_pUIHelper = static_cast(pHelper); - m_iidUIHelper = HelperIID; -} - -// Releases the helper interface and -// our removes the references to it. -ULONG CUIHelper::Release() -{ - ULONG ulRef = 0; - - - if(IsValid()) - { - // Release the interface. - // Since IPrintCoreUI2 inherits from IPrintOemDriverUI, - // it is safe to cast both types of helper interfaces - // to IPrintOemDriverUI for purposes of calling a - // method implemented in IPrintOemDriverUI. - // NOTE: can't cast to IUnknown since it just has pure virtual - // calls for AddRef and Release. - ulRef = static_cast(m_pUIHelper)->Release(); - - // Clear the data members. - Clear(); - } - - return ulRef; -} - - -// -// IPrintOemDriverUI methods -// - -// -// Helper function to get driver settings. This function is only supported -// for UI plugins that do not fully replace core driver's standard UI. -// - -HRESULT __stdcall CUIHelper::DrvGetDriverSetting( - PVOID pci, - PCSTR Feature, - PVOID pOutput, - DWORD cbSize, - PDWORD pcbNeeded, - PDWORD pdwOptionsReturned - ) -{ - CALL_HELPER(DrvGetDriverSetting, - (pci, - Feature, - pOutput, - cbSize, - pcbNeeded, - pdwOptionsReturned - ) - ); -} - -// -// Helper function to allow OEM plugins upgrade private registry -// settings. This function is supported for any UI plugins and should be -// called only by OEM's UpgradePrinter. -// - -HRESULT __stdcall CUIHelper::DrvUpgradeRegistrySetting( - HANDLE hPrinter, - PCSTR pFeature, - PCSTR pOption - ) -{ - CALL_HELPER(DrvUpgradeRegistrySetting, - (hPrinter, - pFeature, - pOption - ) - ); -} - -// -// Helper function to allow OEM plugins to update the driver UI settings. -// This function is only supported for UI plugins that do not fully replace -// core driver's standard UI. It should be called only when the UI is present. -// - -HRESULT __stdcall CUIHelper::DrvUpdateUISetting( - PVOID pci, - PVOID pOptItem, - DWORD dwPreviousSelection, - DWORD dwMode - ) -{ - CALL_HELPER(DrvUpdateUISetting, - (pci, - pOptItem, - dwPreviousSelection, - dwMode - ) - ); -} - -// -// IPrintCoreUI2 new methods -// - -// -// Following four helper functions are only supported for UI plugins that fully -// replace core driver's standard UI. They should only be called by the UI plugin's -// DocumentPropertySheets, DevicePropertySheets and their property sheet callback -// functions. -// -// Helper function to retrieve driver's current setting as a list of -// feature/option keyword pairs. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::GetOptions( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pmszFeaturesRequested, - DWORD cbIn, - PSTR pmszFeatureOptionBuf, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(GetOptions, - (poemuiobj, - dwFlags, - pmszFeaturesRequested, - cbIn, - pmszFeatureOptionBuf, - cbSize, - pcbNeeded - ) - ); -} - -// -// Helper function to change driver's setting using a list of feature/option -// keyword pairs. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::SetOptions( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pmszFeatureOptionBuf, - DWORD cbIn, - PDWORD pdwResult) -{ - CALL_HELPER2(SetOptions, - (poemuiobj, - dwFlags, - pmszFeatureOptionBuf, - cbIn, - pdwResult - ) - ); -} - -// -// Helper function to retrieve the option(s) of a given feature that are -// constrained in driver's current setting. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::EnumConstrainedOptions( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pszFeatureKeyword, - PSTR pmszConstrainedOptionList, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(EnumConstrainedOptions, - (poemuiobj, - dwFlags, - pszFeatureKeyword, - pmszConstrainedOptionList, - cbSize, - pcbNeeded - ) - ); -} - -// -// Helper function to retrieve a list of feature/option keyword pairs from -// driver's current setting that conflict with the given feature/option pair. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::WhyConstrained( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pszFeatureKeyword, - PCSTR pszOptionKeyword, - PSTR pmszReasonList, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(WhyConstrained, - (poemuiobj, - dwFlags, - pszFeatureKeyword, - pszOptionKeyword, - pmszReasonList, - cbSize, - pcbNeeded - ) - ); -} - -// -// Following five helper functions are supported for any UI plugins. -// -// Helper function to retrieve global attribute. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::GetGlobalAttribute( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pszAttribute, - PDWORD pdwDataType, - PBYTE pbData, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(GetGlobalAttribute, - (poemuiobj, - dwFlags, - pszAttribute, - pdwDataType, - pbData, - cbSize, - pcbNeeded - ) - ); -} - - -// -// Helper function to retrieve attribute of a given feature. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::GetFeatureAttribute( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pszFeatureKeyword, - PCSTR pszAttribute, - PDWORD pdwDataType, - PBYTE pbData, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(GetFeatureAttribute, - (poemuiobj, - dwFlags, - pszFeatureKeyword, - pszAttribute, - pdwDataType, - pbData, - cbSize, - pcbNeeded - ) - ); -} - -// -// Helper function to retrieve attribute of a given feature/option selection. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::GetOptionAttribute( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pszFeatureKeyword, - PCSTR pszOptionKeyword, - PCSTR pszAttribute, - PDWORD pdwDataType, - PBYTE pbData, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(GetOptionAttribute, - (poemuiobj, - dwFlags, - pszFeatureKeyword, - pszOptionKeyword, - pszAttribute, - pdwDataType, - pbData, - cbSize, - pcbNeeded - ) - ); -} - -// -// Helper function to retrieve the list of feature keyword. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::EnumFeatures( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PSTR pmszFeatureList, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(EnumFeatures, - (poemuiobj, - dwFlags, - pmszFeatureList, - cbSize, - pcbNeeded - ) - ); -} - -// -// Helper function to retrieve the list of options keyword of a given feature. -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::EnumOptions( - POEMUIOBJ poemuiobj, - DWORD dwFlags, - PCSTR pszFeatureKeyword, - PSTR pmszOptionList, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(EnumOptions, - (poemuiobj, - dwFlags, - pszFeatureKeyword, - pmszOptionList, - cbSize, - pcbNeeded - ) - ); -} - -// -// Helper function to query system simulation support -// -_Use_decl_annotations_ -HRESULT __stdcall CUIHelper::QuerySimulationSupport( - HANDLE hPrinter, - DWORD dwLevel, - PBYTE pCaps, - DWORD cbSize, - PDWORD pcbNeeded) -{ - CALL_HELPER2(QuerySimulationSupport, - (hPrinter, - dwLevel, - pCaps, - cbSize, - pcbNeeded - ) - ); -} - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.h deleted file mode 100644 index 31819dcc..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/Helper.h +++ /dev/null @@ -1,214 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 2001 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Helper.h -// -#pragma once - -class CUIHelper -{ - private: - IUnknown *m_pUIHelper; // pointer to Driver UI's Helper interface - IID m_iidUIHelper; // Driver UI's Helper interface IID - - public: - CUIHelper(); - CUIHelper(const IID &HelperIID, PVOID pHelper); - virtual ~CUIHelper(); - - inline BOOL IsValid() {return NULL != m_pUIHelper;} - - void Assign(const IID &HelperIID, PVOID pHelper); - ULONG Release(); - - // - // IPrintOemDriverUI methods - // - - // - // Helper function to get driver settings. This function is only supported - // for UI plugins that do not fully replace core driver's standard UI. - // - - STDMETHOD(DrvGetDriverSetting) (THIS_ - PVOID pci, - PCSTR Feature, - PVOID pOutput, - DWORD cbSize, - PDWORD pcbNeeded, - PDWORD pdwOptionsReturned - ); - - // - // Helper function to allow OEM plugins upgrade private registry - // settings. This function is supported for any UI plugins and should be - // called only by OEM's UpgradePrinter. - // - - STDMETHOD(DrvUpgradeRegistrySetting) (THIS_ - HANDLE hPrinter, - PCSTR pFeature, - PCSTR pOption - ); - - // - // Helper function to allow OEM plugins to update the driver UI settings. - // This function is only supported for UI plugins that do not fully replace - // core driver's standard UI. It should be called only when the UI is present. - // - - STDMETHOD(DrvUpdateUISetting) (THIS_ - PVOID pci, - PVOID pOptItem, - DWORD dwPreviousSelection, - DWORD dwMode - ); - - // - // IPrintCoreUI2 new methods - // - - // - // Following four helper functions are only supported for UI plugins that fully - // replace core driver's standard UI. They should only be called by the UI plugin's - // DocumentPropertySheets, DevicePropertySheets and their property sheet callback - // functions. - // - // Helper function to retrieve driver's current setting as a list of - // feature/option keyword pairs. - // - - STDMETHOD(GetOptions) (THIS_ - POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _In_reads_bytes_opt_(cbIn) PCSTR pmszFeaturesRequested, - DWORD cbIn, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PSTR pmszFeatureOptionBuf, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - // - // Helper function to change driver's setting using a list of feature/option - // keyword pairs. - // - - STDMETHOD(SetOptions) (THIS_ - POEMUIOBJ poemuiobj, - DWORD dwFlags, - _In_reads_bytes_(cbIn) PCSTR pmszFeatureOptionBuf, - DWORD cbIn, - _Out_ PDWORD pdwResult); - - // - // Helper function to retrieve the option(s) of a given feature that are - // constrained in driver's current setting. - // - - STDMETHOD(EnumConstrainedOptions) (THIS_ - _In_ POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _In_ PCSTR pszFeatureKeyword, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PSTR pmszConstrainedOptionList, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - - // - // Helper function to retrieve a list of feature/option keyword pairs from - // driver's current setting that conflict with the given feature/option pair. - // - - STDMETHOD(WhyConstrained) (THIS_ - POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _In_ PCSTR pszFeatureKeyword, - _In_ PCSTR pszOptionKeyword, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PSTR pmszReasonList, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - // - // Following five helper functions are supported for any UI plugins. - // - // Helper function to retrieve global attribute. - // - - STDMETHOD(GetGlobalAttribute) (THIS_ - POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _In_opt_ PCSTR pszAttribute, - _Out_ PDWORD pdwDataType, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PBYTE pbData, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - // - // Helper function to retrieve attribute of a given feature. - // - - STDMETHOD(GetFeatureAttribute) (THIS_ - POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _In_ PCSTR pszFeatureKeyword, - _In_opt_ PCSTR pszAttribute, - _Out_ PDWORD pdwDataType, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PBYTE pbData, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - // - // Helper function to retrieve attribute of a given feature/option selection. - // - - STDMETHOD(GetOptionAttribute) (THIS_ - POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _In_ PCSTR pszFeatureKeyword, - _In_ PCSTR pszOptionKeyword, - _In_opt_ PCSTR pszAttribute, - _Out_ PDWORD pdwDataType, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PBYTE pbData, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - // - // Helper function to retrieve the list of feature keyword. - // - - STDMETHOD(EnumFeatures) (THIS_ - POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PSTR pmszFeatureList, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - // - // Helper function to retrieve the list of options keyword of a given feature. - // - - STDMETHOD(EnumOptions) (THIS_ - POEMUIOBJ poemuiobj, - _Reserved_ DWORD dwFlags, - _In_ PCSTR pszFeatureKeyword, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PSTR pmszOptionList, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - // - // Helper function to query system simulation support - // - - STDMETHOD(QuerySimulationSupport) (THIS_ - HANDLE hPrinter, - DWORD dwLevel, - _Out_writes_bytes_to_opt_(cbSize, *pcbNeeded) PBYTE pCaps, - DWORD cbSize, - _Out_ _On_failure_(_When_(return == E_OUTOFMEMORY, _Post_valid_)) PDWORD pcbNeeded); - - private: - void Clear(); -}; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/OEMUI.rc b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/OEMUI.rc deleted file mode 100644 index d68603e1..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/OEMUI.rc +++ /dev/null @@ -1,260 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "PS UI Replacement Sample" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "PSUIREP" - VALUE "LegalCopyright", "Copyright © 1998 - 2003 Microsoft Corp." - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "PSUIREP.dll" - VALUE "ProductName", "Microsoft PS UI Replacement Sample" - VALUE "ProductVersion", "1.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DEVICE_PROPPAGE DIALOG 0, 0, 179, 113 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Device Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Added Page",IDC_STATIC,55,14,68,11 - PUSHBUTTON "Calibrate",IDC_CALIBRATE,61,34,50,14 -END - -IDD_DOC_PROPPAGE DIALOG 0, 0, 210, 154 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Document Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Document Property Page",IDC_STATIC,60,73,108,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DEVICE_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 172 - TOPMARGIN, 8 - BOTTOMMARGIN, 106 - END - - IDD_DOC_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_SECTION "OEM UI Added Item" - IDS_CALIBRATED "Printer has been calibrated." - IDS_NAME "OEM UI Customization DLL" - IDS_DEVICE_SETTINGS_NAME "Device Settings" - IDS_CONSTRAINT_CONFLICT "Ther are one or more conflicting settings.\r\nOne of the conflicting is:\r\n\t%1: %2\r\n\t%3: %4\r\n\r\nDo you want driver to automatically resolve conflict?" - IDS_DEV_SECTION "Device Settings OEM UI Added Item" - IDS_ADV_SECTION "Advanced OEM UI Added Item" -END - -STRINGTABLE -BEGIN - IDS_POSTSCRIPT_VM "Available PostScript Memory" - IDS_KBYTES "KB" - IDS_SECONDS "seconds" - IDS_PSTIMEOUTS "PostScript Timeout Values" - IDS_JOBTIMEOUT "Job Timeout" - IDS_WAITTIMEOUT "Wait Timeout" - IDS_PRINTER_DEFAULT "Use Current Setting in the Printer" - IDS_INSTALLABLE_OPTIONS "Installable Options" - IDS_DOWNLOAD_AS_SOFTFONT "" - IDS_USE_DEVFONTS "Use Device Fonts?" - IDS_FONTSUB_OPTION "Font Substitution" - IDS_FONTSUB_DEFAULT "Normal" - IDS_FONTSUB_SLOW "Slow but more accurate" - IDS_FONTSUB_TABLE "Font Substitution Table" - IDS_DEFAULT_TRAY " / Default tray" - IDS_DRAW_ONLY_FROM_SELECTED "Draw selected form only from this tray" -END - -STRINGTABLE -BEGIN - IDS_RESTORE_DEFAULTS "&Restore Defaults" - IDS_PRINTER_FEATURES "Printer Features" - IDS_METAFILE_SPOOLING "Advanced Printing Features" - IDS_ENABLED "&Enabled" - IDS_DISABLED "&Disabled" - IDS_PSOPTIONS "PostScript Options" - IDS_MIRROR "Mirrored Output" - IDS_NEGATIVE_PRINT "Negative Output" - IDS_PAGEINDEP "Page Independence" - IDS_COMPRESSBMP "Compress bitmaps" - IDS_CTRLD_BEFORE "Send CTRL-D Before Each Job" - IDS_CTRLD_AFTER "Send CTRL-D After Each Job" - IDS_JOB_CONTROL "Generate Job Control Code" - IDS_TEXT_ASGRX "Print Optimizations" -END - -STRINGTABLE -BEGIN - IDS_TRUE_GRAY_TEXT "Convert Gray Text to PostScript Gray" - IDS_TRUE_GRAY_GRAPH "Convert Gray Graphics to PostScript Gray" - IDS_ADD_EURO "Add Euro Currency Symbol to PostScript Fonts" -END - -STRINGTABLE -BEGIN - IDS_PAGE_PROTECTION "Page Protection" - IDS_CANCEL_CONFLICT "Restore my previous settings" - IDS_IGNORE_CONFLICT "Keep this setting, and I will change it later" - IDS_RESOLVE_CONFLICT "Resolve this conflict for me automatically" - IDS_DRIVERUI_COLORMODE "Color Mode Option" - IDS_ENVELOPE "Envelope" - IDS_ENV_PREFIX "Env" - IDS_PSPROTOCOL "Output Protocol" - IDS_PSPROTOCOL_ASCII "ASCII" - IDS_PSPROTOCOL_BCP "BCP" - IDS_PSPROTOCOL_TBCP "TBCP" - IDS_PSPROTOCOL_BINARY "Binary" - IDS_TRAY_FORMSOURCE "Automatically Select" - IDS_OEMERR_DLGTITLE "OEM Customization Module Failed" - IDS_OEMERR_OPTITEM "Couldn't add custom items from OEM customization module '%s'.\n\nPlease contact its vendor for support." -END - -STRINGTABLE -BEGIN - IDS_OEMERR_PROPSHEET "Couldn't add custom property sheet pages from OEM customization module '%s'.\n\nPlease contact its vendor for support." - IDS_CANCEL_CONFLICT_FINAL "I will resolve the conflict for myself" - IDS_PSERROR_HANDLER "Send PostScript Error Handler" - IDS_PSMINOUTLINE "Minimum Font Size to Download as Outline" - IDS_PSMAXBITMAP "Maximum Font Size to Download as Bitmap" - IDS_PIXELS "pixel(s)" - IDS_PSOUTPUT_OPTION "PostScript Output Option" - IDS_PSOPT_SPEED "Optimize for Speed" - IDS_PSOPT_PORTABILITY "Optimize for Portability" - IDS_PSOPT_EPS "Encapsulated PostScript (EPS)" - IDS_PSOPT_ARCHIVE "Archive Format" - IDS_PSTT_DLFORMAT "TrueType Font Download Option" - IDS_TTDL_DEFAULT "Automatic" - IDS_TTDL_TYPE1 "Outline" - IDS_TTDL_TYPE3 "Bitmap" - IDS_TTDL_TYPE42 "Native TrueType" -END - -STRINGTABLE -BEGIN - IDS_PSLEVEL "PostScript Language Level" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj deleted file mode 100644 index a8816083..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj +++ /dev/null @@ -1,1066 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {5D63CD51-110C-41B7-B8B0-6AB27398690B} - $(MSBuildProjectName) - Win10 Debug - Win32 - {50E3486C-DFB5-4447-A055-55B51DE6A08C} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - PSUIREP - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - PSUIREP.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj.Filters deleted file mode 100644 index a7adcd57..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/PSUIREP.vcxproj.Filters +++ /dev/null @@ -1,397 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {34758E7D-B1F9-45D1-BF4C-84952A011FD8} - - - h;hpp;hxx;hm;inl;inc;xsd - {5FBB97F9-5E07-46FA-9D57-352EF01D247C} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {B3D9DA9C-3DC0-474A-8E98-121243DA58B3} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.cpp deleted file mode 100644 index 01690f07..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.cpp +++ /dev/null @@ -1,315 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 2001 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: StringUtils.cpp -// -// PURPOSE: Implementation wrapper class for WinXP PS Driver Features and Options. -// - - -#include "precomp.h" -#include "debug.h" -#include "devmode.h" -#include "globals.h" -#include "helper.h" -#include "features.h" -#include "oemui.h" -#include "stringutils.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// Create a list of pointers to the strings -// in a multi-sz. -_Use_decl_annotations_ -HRESULT MakeStrPtrList(HANDLE hHeap, PCSTR pmszMultiSz, PCSTR **pppszList, PWORD pwCount) -{ - PCSTR *ppszList = NULL; - HRESULT hrResult = S_OK; - - - // Validate parameters - if( (NULL == hHeap) - || - (NULL == pmszMultiSz) - || - (NULL == pppszList) - || - (NULL == pwCount) - ) - { - return E_INVALIDARG; - } - - // Get the count of strings in the multi-sz. - *pwCount = mstrcount(pmszMultiSz); - if(0 == *pwCount) - { - WARNING(DLLTEXT("MakeStrPtrList() pmszMultiSz contains no strings.\r\n")); - - *pppszList = NULL; - - goto Exit; - } - - // Allocate pointer list. - *pppszList = (PCSTR *) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, (*pwCount) * sizeof(PCSTR)); - if(NULL == *pppszList) - { - ERR(ERRORTEXT("MakeStrPtrList() failed to allote array of PCSTR.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - ppszList = *pppszList; - - // Walk multi-sz mapping string pointers. - for(WORD wIndex = 0; wIndex < *pwCount; ++wIndex) - { - ppszList[wIndex] = pmszMultiSz; - pmszMultiSz += strlen(pmszMultiSz) + 1; - } - - -Exit: - - return hrResult; -} - - -// Determine how many strings are in the multi-sz. -WORD mstrcount(PCSTR pmszMultiSz) -{ - WORD wCount = 0; - - - // NULL string pointers have no strings. - if(NULL == pmszMultiSz) - { - return 0; - } - - // Walk list of strings counting them. - while(pmszMultiSz[0] != '\0') - { - ++wCount; - pmszMultiSz += strlen(pmszMultiSz) + 1; - } - - return wCount; -} - -// Allocates and converts ANSI string to Unicode. -PWSTR MakeUnicodeString(HANDLE hHeap, PCSTR pszAnsi) -{ - int nSize = 0; - PWSTR pszUnicode = NULL; - - - // Validate parameters - if( (NULL == hHeap) - || - (NULL == pszAnsi) - ) - { - return NULL; - } - - // Get the size needed for UNICODE string. - nSize = MultiByteToWideChar(CP_ACP, 0, pszAnsi, -1, NULL, 0); - if(0 != nSize) - { - // Allocate unicode string. - pszUnicode = (PWSTR) HeapAlloc(hHeap, 0, nSize * sizeof(WCHAR)); - if(NULL != pszUnicode) - { - // Convert ANSI to Unicode - nSize = MultiByteToWideChar(CP_ACP, 0, pszAnsi, -1, pszUnicode, nSize); - if(0 == nSize) - { - // INVARIANT: failed to convert. - - // free buffer and return NULL. - HeapFree(hHeap, 0, pszUnicode); - pszUnicode = NULL; - } - } - } - - return pszUnicode; -} - -// Allocates and copies source string. -PWSTR MakeStringCopy(HANDLE hHeap, PCWSTR pszSource) -{ - PWSTR pszCopy = NULL; - DWORD dwSize; - - - // Validate parameters - if( (NULL == hHeap) - || - (NULL == pszSource) - ) - { - return NULL; - } - - // Allocate memory for string duplication, and duplicate the string. - dwSize = (DWORD)(wcslen(pszSource) + 1) * sizeof(WCHAR); - pszCopy = (PWSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize); - if(NULL != pszCopy) - { - HRESULT hResult; - - - hResult = StringCbCopyW(pszCopy, dwSize, pszSource); - if(FAILED(hResult)) - { - HeapFree(hHeap, 0, pszCopy); - pszCopy = NULL; - SetLastError(hResult); - } - } - - return pszCopy; -} - -// Allocates and copies source string. -PSTR MakeStringCopy(HANDLE hHeap, PCSTR pszSource) -{ - PSTR pszCopy = NULL; - size_t dwSize; - - - // Validate parameters - if( (NULL == hHeap) - || - (NULL == pszSource) - ) - { - return NULL; - } - - // Allocate memory for string duplication, and duplicate the string. - dwSize = (strlen(pszSource) + 1) * sizeof(CHAR); - pszCopy = (PSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize); - if(NULL != pszCopy) - { - HRESULT hResult; - - hResult = StringCbCopyA(pszCopy, dwSize, pszSource); - if(FAILED(hResult)) - { - HeapFree(hHeap, 0, pszCopy); - pszCopy = NULL; - SetLastError(hResult); - } - } - - return pszCopy; -} - -// Frees list of strings. -// NOTE: don't use this for string list made with MakeStrPtrList(), since -// the strings pointed to be list made with MakeStrPtrList() will -// be freed when the multi-sz is freed. -void FreeStringList(HANDLE hHeap, _In_reads_(wCount) PWSTR *ppszList, WORD wCount) -{ - // Validate parameters. - if( (NULL == hHeap) - || - (NULL == ppszList) - ) - { - return; - } - - // Free each of the strings in the list. - for(WORD wIndex = 0; wIndex < wCount; ++wIndex) - { - if(NULL != ppszList[wIndex]) HeapFree(hHeap, 0, ppszList[wIndex]); - } - - // Free list. - HeapFree(hHeap, 0, ppszList); -} - - -// Retrieves pointer to a String resource. -HRESULT GetStringResource(HANDLE hHeap, HMODULE hModule, UINT uResource, _Outptr_result_maybenull_ PWSTR *ppszString) -{ - int nResult; - DWORD dwSize = MAX_PATH; - PWSTR pszString = NULL; - HRESULT hrResult = S_OK; - - - VERBOSE(DLLTEXT("GetStringResource(%#x, %#x, %d) entered.\r\n"), hHeap, hModule, uResource); - - // Validate parameters. - if( (NULL == hHeap) - || - (NULL == ppszString) - ) - { - return E_INVALIDARG; - } - - // Allocate buffer for string resource from heap; let the driver clean it up. - pszString = (PWSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(WCHAR)); - if(NULL == pszString) - { - ERR(ERRORTEXT("GetStringResource() failed to allocate string buffer!\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Load string resource; resize after loading so as not to waste memory. - nResult = LoadString(hModule, uResource, pszString, dwSize); - if(nResult > 0) - { - PWSTR pszTemp; - - - VERBOSE(DLLTEXT("LoadString() returned %d!\r\n"), nResult); - VERBOSE(DLLTEXT("String load was \"%s\".\r\n"), pszString); - - pszTemp = (PWSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszString, (nResult + 1) * sizeof(WCHAR)); - if(NULL != pszTemp) - { - pszString = pszTemp; - } - else - { - WARNING(DLLTEXT("GetStringResource() HeapReAlloc() of string retrieved failed! (Last Error was %d)\r\n"), GetLastError()); - } - } - else - { - DWORD dwError = GetLastError(); - - - ERR(ERRORTEXT("LoadString() returned %d! (Last Error was %d)\r\n"), nResult, GetLastError()); - ERR(ERRORTEXT("GetStringResource() failed to load string resource %d!\r\n"), uResource); - - HeapFree(hHeap, 0, pszString); - pszString = NULL; - hrResult = HRESULT_FROM_WIN32(dwError); - } - - -Exit: - - // Save string pointer to caller. - // NOTE: string pointer will be NULL on failure. - *ppszString = pszString; - - return hrResult; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.h deleted file mode 100644 index 35de69f2..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/StringUtils.h +++ /dev/null @@ -1,23 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 2001 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: StringUtils.h -// -// PURPOSE: Header file for string utility routines. -// -#pragma once - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// -_Success_(return >= 0 && *pwCount > 0) HRESULT MakeStrPtrList(HANDLE hHeap, PCSTR pmszMultiSz, _Outptr_result_buffer_(*pwCount) PCSTR **pppszList, _Out_ PWORD pwCount); -WORD mstrcount(PCSTR pmszMultiSz); -PWSTR MakeUnicodeString(HANDLE hHeap, PCSTR pszAnsi); -PWSTR MakeStringCopy(HANDLE hHeap, PCWSTR pszSource); -PSTR MakeStringCopy(HANDLE hHeap, PCSTR pszSource); -void FreeStringList(HANDLE hHeap, _In_reads_(wCount) PWSTR *ppszList, WORD wCount); -HRESULT GetStringResource(HANDLE hHeap, HMODULE hModule, UINT uResource, _Outptr_result_maybenull_ PWSTR *ppszString); diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.cpp deleted file mode 100644 index f7a3d842..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.cpp +++ /dev/null @@ -1,405 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.cpp -// -// PURPOSE: Debug functions. -// -// - -#include "precomp.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL DEFINES -//////////////////////////////////////////////////////// - -#define DEBUG_BUFFER_SIZE 1024 -#define PATH_SEPARATOR '\\' -#define MAX_LOOP 10 - -// Determine what level of debugging messages to eject. -#ifdef VERBOSE_MSG - #define DEBUG_LEVEL DBG_VERBOSE -#elif TERSE_MSG - #define DEBUG_LEVEL DBG_TERSE -#elif WARNING_MSG - #define DEBUG_LEVEL DBG_WARNING -#elif ERROR_MSG - #define DEBUG_LEVEL DBG_ERROR -#elif RIP_MSG - #define DEBUG_LEVEL DBG_RIP -#elif NO_DBG_MSG - #define DEBUG_LEVEL DBG_NONE -#else - #define DEBUG_LEVEL DBG_WARNING -#endif - - - -//////////////////////////////////////////////////////// -// EXTERNAL GLOBALS -//////////////////////////////////////////////////////// - -INT giDebugLevel = DEBUG_LEVEL; - - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static BOOL DebugMessageV(LPCSTR lpszMessage, va_list arglist); -static BOOL DebugMessageV(DWORD dwSize, LPCWSTR lpszMessage, va_list arglist); - - - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessageV -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// dwSize Size of temp buffer to hold formated string. -// -// lpszMessage Format string. -// -// arglist Variable argument list.. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -static BOOL DebugMessageV(LPCSTR lpszMessage, va_list arglist) -{ - DWORD dwSize = DEBUG_BUFFER_SIZE; - DWORD dwLoop = 0; - LPSTR lpszMsgBuf = NULL; - HRESULT hr; - - - // Parameter checking. - if( (NULL == lpszMessage) - || - (0 == dwSize) - ) - { - return FALSE; - } - - do - { - // Allocate memory for message buffer. - if(NULL != lpszMsgBuf) - { - delete[] lpszMsgBuf; - dwSize *= 2; - } - lpszMsgBuf = new CHAR[dwSize + 1]; - if(NULL == lpszMsgBuf) - { - return FALSE; - } - - hr = StringCbVPrintfA(lpszMsgBuf, (dwSize + 1) * sizeof(CHAR), lpszMessage, arglist); - - // Pass the variable parameters to wvsprintf to be formated. - } while (FAILED(hr) && (STRSAFE_E_INSUFFICIENT_BUFFER == hr) && (++dwLoop < MAX_LOOP) ); - - // Dump string to Debug output. - OutputDebugStringA(lpszMsgBuf); - - // Cleanup. - delete[] lpszMsgBuf; - - return SUCCEEDED(hr); -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessageV -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// dwSize Size of temp buffer to hold formated string. -// -// lpszMessage Format string. -// -// arglist Variable argument list.. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -static BOOL DebugMessageV(DWORD dwSize, LPCWSTR lpszMessage, va_list arglist) -{ - LPWSTR lpszMsgBuf; - HRESULT hResult; - - - // Parameter checking. - if( (NULL == lpszMessage) - || - (0 == dwSize) - ) - { - return FALSE; - } - - // Allocate memory for message buffer. - lpszMsgBuf = new WCHAR[dwSize + 1]; - if(NULL == lpszMsgBuf) - return FALSE; - - // Pass the variable parameters to wvsprintf to be formated. - hResult = StringCbVPrintfW(lpszMsgBuf, (dwSize + 1) * sizeof(WCHAR), lpszMessage, arglist); - - // Dump string to debug output. - OutputDebugStringW(lpszMsgBuf); - - // Clean up. - delete[] lpszMsgBuf; - - return SUCCEEDED(hResult); -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessage -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// lpszMessage Format string. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCSTR lpszMessage, ...) -{ - BOOL bResult; - va_list VAList; - - - // Pass the variable parameters to DebugMessageV for processing. - va_start(VAList, lpszMessage); - bResult = DebugMessageV(lpszMessage, VAList); - va_end(VAList); - - return bResult; -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessage -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// lpszMessage Format string. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCWSTR lpszMessage, ...) -{ - BOOL bResult; - va_list VAList; - - - // Pass the variable parameters to DebugMessageV to be processed. - va_start(VAList, lpszMessage); - bResult = DebugMessageV(MAX_PATH, lpszMessage, VAList); - va_end(VAList); - - return bResult; -} - -void Dump(PPUBLISHERINFO pPublisherInfo) -{ - VERBOSE(TEXT("pPublisherInfo:\r\n")); - if(NULL == pPublisherInfo) - { - VERBOSE(TEXT("\tpPublisherInfo is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tdwMode = %#x\r\n"), pPublisherInfo->dwMode); - VERBOSE(TEXT("\twMinoutlinePPEM = %d\r\n"), pPublisherInfo->wMinoutlinePPEM); - VERBOSE(TEXT("\twMaxbitmapPPEM = %d\r\n"), pPublisherInfo->wMaxbitmapPPEM); -} - -void Dump(POEMDMPARAM pOemDMParam) -{ - VERBOSE(TEXT("pOemDMParam:\r\n")); - if(NULL == pOemDMParam) - { - VERBOSE(TEXT("\tpOemDMParam is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pOemDMParam->cbSize); - VERBOSE(TEXT("\tpdriverobj = %#x\r\n"), pOemDMParam->pdriverobj); - VERBOSE(TEXT("\thPrinter = %#x\r\n"), pOemDMParam->hPrinter); - VERBOSE(TEXT("\thModule = %#x\r\n"), pOemDMParam->hModule); - VERBOSE(TEXT("\tpPublicDMIn = %#x\r\n"), pOemDMParam->pPublicDMIn); - VERBOSE(TEXT("\tpPublicDMOut = %#x\r\n"), pOemDMParam->pPublicDMOut); - VERBOSE(TEXT("\tpOEMDMIn = %#x\r\n"), pOemDMParam->pOEMDMIn); - VERBOSE(TEXT("\tpOEMDMOut = %#x\r\n"), pOemDMParam->pOEMDMOut); - VERBOSE(TEXT("\tcbBufSize = %d\r\n"), pOemDMParam->cbBufSize); -} - -void Dump(PPROPSHEETUI_INFO pPSUIInfo) -{ - VERBOSE(TEXT("pPSUIInfo:\r\n")); - if(NULL == pPSUIInfo) - { - VERBOSE(TEXT("\tpPSUIInfo is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pPSUIInfo->cbSize); - VERBOSE(TEXT("\tVersion = %#x\r\n"), pPSUIInfo->Version); - VERBOSE(TEXT("\tFlags = %#x\r\n"), pPSUIInfo->Flags); - VERBOSE(TEXT("\tReason = %d\r\n"), pPSUIInfo->Reason); - VERBOSE(TEXT("\thComPropSheet = %#x\r\n"), pPSUIInfo->hComPropSheet); - VERBOSE(TEXT("\tpfnComPropSheet = %#x\r\n"), pPSUIInfo->pfnComPropSheet); - VERBOSE(TEXT("\tlParamInit = %#x\r\n"), pPSUIInfo->lParamInit); - VERBOSE(TEXT("\tUserData = %#x\r\n"), pPSUIInfo->UserData); - VERBOSE(TEXT("\tResult = %#x\r\n"), pPSUIInfo->Result); -} - -void Dump(POPTITEM pOptItem) -{ - VERBOSE(TEXT("pOptItem:\r\n")); - if(NULL == pOptItem) - { - VERBOSE(TEXT("\tpOptItem is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pOptItem->cbSize); - VERBOSE(TEXT("\tLevel = %d\r\n"), pOptItem->Level); - VERBOSE(TEXT("\tDlgPageIdx = %d\r\n"), pOptItem->DlgPageIdx); - VERBOSE(TEXT("\tFlags = 0x%x\r\n"), pOptItem->Flags); - VERBOSE(TEXT("\tUserData = 0x%p\r\n"), pOptItem->UserData); - VERBOSE(TEXT("\tpName = %s\r\n"), pOptItem->pName ? pOptItem->pName : TEXT("")); - VERBOSE(TEXT("\tpSel = 0x%p\r\n"), pOptItem->pSel); - VERBOSE(TEXT("\tpExtChkBox = 0x%p\r\n"), pOptItem->pExtChkBox); - VERBOSE(TEXT("\tpExtChkBox = 0x%p\r\n"), pOptItem->pExtChkBox); - VERBOSE(TEXT("\tHelpIndex = 0x%x\r\n"), pOptItem->HelpIndex); - VERBOSE(TEXT("\tDMPubID = 0x%x\r\n"), pOptItem->DMPubID); - VERBOSE(TEXT("\tUserItemID = 0x%x\r\n"), pOptItem->UserItemID); - VERBOSE(TEXT("\twReserved = 0x%x\r\n"), pOptItem->wReserved); - VERBOSE(TEXT("\tpOIExt = 0x%p\r\n"), pOptItem->pOIExt); - - Dump(pOptItem->pOptType); -} - -void Dump(POPTTYPE pOptType) -{ - VERBOSE(TEXT("\tpOptType:\r\n")); - if(NULL == pOptType) - { - VERBOSE(TEXT("\t\tpOptType is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\t\tcbSize = %d\r\n"), pOptType->cbSize); - VERBOSE(TEXT("\t\tType = 0x%x\r\n"), pOptType->Type); - VERBOSE(TEXT("\t\tFlags = 0x%x\r\n"), pOptType->Flags); - VERBOSE(TEXT("\t\tCount = %d\r\n"), pOptType->Count); - VERBOSE(TEXT("\t\tCount = 0x%x\r\n"), pOptType->BegCtrlID); - VERBOSE(TEXT("\t\tStyle = 0x%x\r\n"), pOptType->Style); - - Dump(pOptType->pOptParam, pOptType->Count); -} - -void Dump(POPTPARAM pOptParam, WORD wCount) -{ - if(NULL == pOptParam) - { - VERBOSE(TEXT("\t\tpOptParam is NULL!\r\n")); - return; - } - - for(WORD wIndex = 0; wIndex < wCount; ++wIndex) - { - VERBOSE(TEXT("\t\tpOptParam[wIndex]:\r\n")); - VERBOSE(TEXT("\t\t\tcbSize = %d\r\n"), pOptParam[wIndex].cbSize); - VERBOSE(TEXT("\t\t\tFlags = 0x%x\r\n"), pOptParam[wIndex].Flags); - VERBOSE(TEXT("\t\t\tStyle = 0x%x\r\n"), pOptParam[wIndex].Style); - VERBOSE(TEXT("\t\t\tpData = 0x%p\r\n"), pOptParam[wIndex].pData); - VERBOSE(TEXT("\t\t\tIconID = 0x%p\r\n"), pOptParam[wIndex].IconID); - VERBOSE(TEXT("\t\t\tlParam = 0x%p\r\n"), pOptParam[wIndex].lParam); - } -} - - -PCSTR -StripDirPrefixA( - IN PCSTR pstrFilename - ) - -/*++ - -Routine Description: - - Strip the directory prefix off a filename (ANSI version) - -Arguments: - - pstrFilename - Pointer to filename string - -Return Value: - - Pointer to the last component of a filename (without directory prefix) - ---*/ - -{ - PCSTR pstr; - - pstr = strrchr(pstrFilename, PATH_SEPARATOR); - if (pstr) - return pstr + 1; - - return pstrFilename; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.h deleted file mode 100644 index b4d57b0b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/debug.h +++ /dev/null @@ -1,166 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. -// -// - -#pragma once - -// VC and Build use different debug defines. -// The following makes it so either will -// cause the inclusion of debugging code. -#if !defined(_DEBUG) && defined(DBG) - #define _DEBUG DBG -#elif defined(_DEBUG) && !defined(DBG) - #define DBG _DEBUG -#endif - - - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// - -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// VERBOSE(msg) -// Display a message if the current debug level is <= DBG_VERBOSE. -// -// TERSE(msg) -// Display a message if the current debug level is <= DBG_TERSE. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// ASSERTMSG(cond, msg) -// Verify a condition is true. If not, display a message and -// force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// These macros require extra parantheses for the msg argument -// example, ASSERTMSG(x > 0, ("x is less than 0\n")); -// WARNING(("App passed NULL pointer, ignoring...\n")); -// - -#define DBG_VERBOSE 1 -#define DBG_TERSE 2 -#define DBG_WARNING 3 -#define DBG_ERROR 4 -#define DBG_RIP 5 -#define DBG_NONE 6 - -#if DBG - - #define DebugMsg DebugMessage - - // - // Strip the directory prefix from a filename (ANSI version) - // - - PCSTR - StripDirPrefixA( - IN PCSTR pstrFilename - ); - - extern INT giDebugLevel; - - - #define DBGMSG(level, prefix, msg) { \ - if (giDebugLevel <= (level)) { \ - DebugMsg("%s %s (%d): ", prefix, StripDirPrefixA(__FILE__), __LINE__); \ - DebugMsg(msg); \ - } \ - } - - #define DBGPRINT(level, msg) { \ - if (giDebugLevel <= (level)) { \ - DebugMsg(msg); \ - } \ - } - - #define VERBOSE if(giDebugLevel <= DBG_VERBOSE) DebugMsg - #define TERSE if(giDebugLevel <= DBG_TERSE) DebugMsg - #define WARNING if(giDebugLevel <= DBG_WARNING) DebugMsg - #define ERR if(giDebugLevel <= DBG_ERROR) DebugMsg - - #define ASSERT(cond) { \ - if (! (cond)) { \ - RIP(("\n")); \ - } \ - } - - #define ASSERTMSG(cond, msg) { \ - if (! (cond)) { \ - RIP(msg); \ - } \ - } - - #define RIP(msg) { \ - DBGMSG(DBG_RIP, "RIP", msg); \ - DebugBreak(); \ - } - - -#else // !DBG - - #define DebugMsg NOP_FUNCTION - - #define VERBOSE NOP_FUNCTION - #define TERSE NOP_FUNCTION - #define WARNING NOP_FUNCTION - #define ERR NOP_FUNCTION - - #define ASSERT(cond) - - #define ASSERTMSG(cond, msg) - #define RIP(msg) - #define DBGMSG(level, prefix, msg) - #define DBGPRINT(level, msg) - -#endif - - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCSTR, ...); -BOOL DebugMessage(LPCWSTR, ...); -void Dump(PPUBLISHERINFO pPublisherInfo); -void Dump(POEMDMPARAM pOemDMParam); -void Dump(PPROPSHEETUI_INFO pPSUIInfo); -void Dump(POPTITEM pOptItem); -void Dump(POPTTYPE pOptType); -void Dump(POPTPARAM pOptParam, WORD wCount); - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.cpp deleted file mode 100644 index 43da0361..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.cpp +++ /dev/null @@ -1,193 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - -#include "precomp.h" - -#include "debug.h" -#include "globals.h" -#include "devmode.h" -#include "helper.h" -#include "features.h" -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR(ERRORTEXT("DevMode() ERROR_INVALID_PARAMETER.\r\n")); - VERBOSE(DLLTEXT("\tdwMode = %d, pOemDMParam = %#lx.\r\n"), dwMode, pOemDMParam); - - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - case OEMDM_DEFAULT: - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - VERBOSE(DLLTEXT("pOEMDevOut after setting default values:\r\n")); - Dump(pOEMDevOut); - break; - - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut, pOemDMParam->cbBufSize); - break; - - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut, pOemDMParam->cbBufSize); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - Dump(pOemDMParam); - - return S_OK; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut, DWORD dwSize) -{ - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - || - (dwSize < sizeof(OEMDEV)) - ) - { - ERR(ERRORTEXT("ConvertOEMDevmode() invalid parameters.\r\n")); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE(DLLTEXT("Converting private OEM Devmode.\r\n")); - VERBOSE(DLLTEXT("pOEMDevIn:\r\n")); - Dump(pOEMDevIn); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(dwSize, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize))); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING(DLLTEXT("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n")); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - } - - return TRUE; -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data, if not valid. - if(pOEMDevmode->dwDriverData > 100) - { - pOEMDevmode->dwDriverData = 0; - } - - // Set Advanced driver data, if not valid. - if(pOEMDevmode->dwAdvancedData > 100) - { - pOEMDevmode->dwAdvancedData = 0; - } - - return TRUE; -} - - -void Dump(PCOEMDEV pOEMDevmode) -{ - if( (NULL != pOEMDevmode) - && - (pOEMDevmode->dmOEMExtra.dwSize >= sizeof(OEMDEV)) - && - (OEM_SIGNATURE == pOEMDevmode->dmOEMExtra.dwSignature) - ) - { - VERBOSE(TEXT("\tdmOEMExtra.dwSize = %d\r\n"), pOEMDevmode->dmOEMExtra.dwSize); - VERBOSE(TEXT("\tdmOEMExtra.dwSignature = %#x\r\n"), pOEMDevmode->dmOEMExtra.dwSignature); - VERBOSE(TEXT("\tdmOEMExtra.dwVersion = %#x\r\n"), pOEMDevmode->dmOEMExtra.dwVersion); - VERBOSE(TEXT("\tdwDriverData = %#x\r\n"), pOEMDevmode->dwDriverData); - VERBOSE(TEXT("\tdwAdvancedData = %#x\r\n"), pOEMDevmode->dwAdvancedData); - } - else - { - ERR(ERRORTEXT("Dump(POEMDEV) unknown private OEM DEVMODE.\r\n")); - } -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.h deleted file mode 100644 index 83202d6a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/devmode.h +++ /dev/null @@ -1,56 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - - - - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -// -//Can add info to the private devmode bellow here. -//Note : -// This structure must be prefixed by OEM_DMEXTRAHEADER -// Your plug-in must implement the IPrintOemUI::DevMode method -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - DWORD dwDriverData; - DWORD dwAdvancedData; - - // - //Private DevMode Members - // - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut, DWORD dwSize); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); -void Dump(PCOEMDEV pOEMDevIn); diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/dllentry.cpp deleted file mode 100644 index da0a1885..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/dllentry.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "debug.h" -#include "globals.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.cpp deleted file mode 100644 index 785330cb..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.cpp -// -// PURPOSE: File that contains all the globals. -// - -#include "precomp.h" -#include "globals.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.h deleted file mode 100644 index 70d17f1c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/globals.h +++ /dev/null @@ -1,31 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.h -// -// PURPOSE: Lists of globals declared in Globals.cpp. -// -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -// OEM Signature and version. -#define PROP_TITLE L"OEM PS UI Replacement Page" -#define DLLTEXT(s) TEXT("PSUIREP: ") TEXT(s) - -// OEM UI Misc defines. -#define ERRORTEXT(s) TEXT("ERROR ") DLLTEXT(s) - -// Module's Instance handle from DLLEntry of process. -extern HINSTANCE ghInstance; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.cpp deleted file mode 100644 index 5ab1bffe..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.cpp +++ /dev/null @@ -1,709 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// PLATFORMS: Windows 2000, Windows XP, Windows Server 2003 -// - -#include "precomp.h" - - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "globals.h" -#include "devmode.h" -#include "stringutils.h" -#include "helper.h" -#include "features.h" -#include "oemui.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// Internal Constants -//////////////////////////////////////////////////////// - -// -// List all of the supported Driver UI Helper interface IIDs from the -// latest to the oldest, that's the order we will query for the -// the Driver UI Helper interface to use. -// - -const IID *Helper_IIDs[] = -{ - &IID_IPrintCoreUI2, - &IID_IPrintOemDriverUI, -}; -const NUM_HELPER_IIDs = (sizeof(Helper_IIDs)/sizeof(Helper_IIDs[0])); - - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0 ; // Count of active components -static long g_cServerLocks = 0 ; // Count of locks - - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI2 body -// -IOemUI2::IOemUI2() -{ - VERBOSE(DLLTEXT("IOemUI2:IOemUI2() default constructor called.\r\n\r\n")); - - // Init ref count to 1 on creation, since AddRef() is implied. - m_cRef = 1; - - // The default for UI Hiding is FALSE, since HideStandardUI method - // will only be called by Driver UIs that support it. - // Older Driver UIs don't know about this method and won't call us. - m_bHidingStandardUI = FALSE; - - // Increment component count. - InterlockedIncrement(&g_cComponents); -} - -IOemUI2::~IOemUI2() -{ - VERBOSE(DLLTEXT("IOemUI2:~IOemUI2() destructor called.\r\n\r\n")); - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); - - // Decrement component count. - InterlockedDecrement(&g_cComponents); -} - -HRESULT __stdcall IOemUI2::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE(DLLTEXT("IOemUI2:QueryInterface entry.\r\n\r\n")); - -#if DBG - TCHAR szIID[80] = {0}; - StringFromGUID2(iid, szIID, _countof(szIID)); // can not fail! -#endif - - // Determine what object to return, if any. - if(iid == IID_IUnknown) - { - *ppv = static_cast(this); - } - else if(iid == IID_IPrintOemUI2) - { - *ppv = static_cast(this); - } - else if(iid == IID_IPrintOemUI) - { - *ppv = static_cast(this); - } - else - { - // Interface not supported. -#if DBG - VERBOSE(DLLTEXT("IOemUI2::QueryInterface %s not supported.\r\n"), szIID); -#endif - - *ppv = NULL ; - return E_NOINTERFACE ; - } - -#if DBG - VERBOSE(DLLTEXT("IOemUI2::QueryInterface returning pointer to %s.\r\n"), szIID); -#endif - - reinterpret_cast(*ppv)->AddRef(); - return S_OK ; -} - -ULONG __stdcall IOemUI2::AddRef() -{ - VERBOSE(DLLTEXT("IOemUI2:AddRef entry.\r\n")); - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemUI2::Release() -{ - VERBOSE(DLLTEXT("IOemUI2:Release entry.\r\n")); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -HRESULT __stdcall IOemUI2::PublishDriverInterface( - IUnknown *pIUnknown) -{ - HRESULT hResult = S_OK; - - - VERBOSE(DLLTEXT("IOemUI2:PublishDriverInterface entry.\r\n")); - - // Core Driver UI shouldn't call us more than once if we were successful. - // Thus, if m_Helper is already valid, we shouldn't be getting called. - ASSERT(!m_Helper.IsValid()); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (!m_Helper.IsValid()) - { - PVOID pHelper = NULL; - - - // Try to get the newest version fo the Helper function - // that Driver UI supports. - hResult = E_FAIL; - for(DWORD dwIndex = 0; !SUCCEEDED(hResult) && (dwIndex < NUM_HELPER_IIDs); ++dwIndex) - { - // Query Driver UI for Helper interface. - hResult = pIUnknown->QueryInterface(*Helper_IIDs[dwIndex], &pHelper); - if(SUCCEEDED(hResult)) - { - // INVARIANT: we got a Helper interface. - - - // Store Helper interface. - m_Helper.Assign(*Helper_IIDs[dwIndex], pHelper); - } - } - } - - return hResult; -} - -HRESULT __stdcall IOemUI2::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IOemUI2::GetInfo(%d) entry.\r\r\n"), dwMode); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - WARNING(DLLTEXT("IOemUI2::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER\r\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("IOemUI2::GetInfo() exit insufficient buffer!\r\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IOemUI2::GetInfo() exit mode not supported.\r\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(DLLTEXT("IOemUI2::GetInfo() exit S_OK, (*pBuffer is %#x).\r\r\n"), *(PDWORD)pBuffer); - return S_OK; -} - -HRESULT __stdcall IOemUI2::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE(DLLTEXT("IOemUI2:DevMode(%d, %#x) entry.\r\n"), dwMode, pOemDMParam); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IOemUI2::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam) -{ - VERBOSE(DLLTEXT("IOemUI2:CommonUIProp entry.\r\n")); - - return hrOEMPropertyPage(dwMode, pOemCUIPParam); -} - - -HRESULT __stdcall IOemUI2::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI2:DocumentPropertySheets entry.\r\n")); - - return hrOEMDocumentPropertySheets(pPSUIInfo, - lParam, - m_Helper, - &m_Features, - m_bHidingStandardUI); -} - -HRESULT __stdcall IOemUI2::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI2:DevicePropertySheets entry.\r\n")); - - return hrOEMDevicePropertySheets(pPSUIInfo, - lParam, - m_Helper, - &m_Features, - m_bHidingStandardUI); -} - -HRESULT __stdcall IOemUI2::DeviceCapabilities( - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult) -{ - VERBOSE(DLLTEXT("IOemUI2:DeviceCapabilities entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI2::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM) -{ - VERBOSE(DLLTEXT("IOemUI2:DevQueryPrintEx entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI2::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo) -{ - VERBOSE(DLLTEXT("IOemUI2:UpgradePrinter entry.\r\n")); - - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI2::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI2:PrinterEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI2::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI2:DriverEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -HRESULT __stdcall IOemUI2::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData) -{ - VERBOSE(DLLTEXT("IOemUI2:QueryColorProfile entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(ulQueryMode); - UNREFERENCED_PARAMETER(pvProfileData); - UNREFERENCED_PARAMETER(pcbProfileData); - UNREFERENCED_PARAMETER(pflProfileData); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI2::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI2:FontInstallerDlgProc entry.\r\n")); - - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI2::UpdateExternalFonts( - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges) -{ - VERBOSE(DLLTEXT("IOemUI2:UpdateExternalFonts entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -// *********** IPrintOEMUI2 FUNCTIONS **************** - -// -// QueryJobAttribtues -// - -HRESULT __stdcall IOemUI2::QueryJobAttributes( - HANDLE hPrinter, - PDEVMODE pDevmode, - DWORD dwLevel, - LPBYTE lpAttributeInfo) -{ - TERSE(DLLTEXT("IOemUI2:QueryJobAttributes entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDevmode); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(lpAttributeInfo); - - return E_NOTIMPL; -} - -// -// Hide Standard UI -// - -HRESULT __stdcall IOemUI2::HideStandardUI( - DWORD dwMode) -{ - HRESULT hrReturn = E_NOTIMPL; - - - TERSE(DLLTEXT("IOemUI2:HideStandardUI entry.\r\n")); - - switch(dwMode) - { - // By returning S_OK for both OEMCUIP_DOCPROP and OEMCUIP_PRNPROP, - // we will hide the Standard UI for both Document Properties, - // and Device Properties. - // To not hide one or both, return E_NOTIMPL instead of S_OK, - case OEMCUIP_DOCPROP: - case OEMCUIP_PRNPROP: - // Flag that we are hiding the Standard UI. - // This is so we can tell easily between Driver UI - // that supports HideStandardUI (such as WinXP PS UI), - // or ones that don't (such as Win2K PS or Unidrv UI). - m_bHidingStandardUI = TRUE; - - hrReturn = S_OK; - break; - } - - return hrReturn; -} - -// -// DocumentEvent -// - -HRESULT __stdcall IOemUI2::DocumentEvent( - HANDLE hPrinter, - HDC hdc, - INT iEsc, - ULONG cbIn, - PVOID pbIn, - ULONG cbOut, - PVOID pbOut, - PINT piResult) -{ - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hdc); - UNREFERENCED_PARAMETER(iEsc); - UNREFERENCED_PARAMETER(cbIn); - UNREFERENCED_PARAMETER(pbIn); - UNREFERENCED_PARAMETER(cbOut); - UNREFERENCED_PARAMETER(pbOut); - UNREFERENCED_PARAMETER(piResult); - - return E_NOTIMPL; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this) ; - } - else - { -#if DBG - TCHAR szOutput[80] = {0}; - StringFromGUID2(iid, szOutput, _countof(szOutput)); // can not fail! - WARNING(DLLTEXT("IOemCF::QueryInterface %s not supported.\r\n"), szOutput); -#endif - - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - //DbgPrint(DLLTEXT("Class factory:\t\tCreate component.")) ; - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION ; - } - - // Create component. - IOemUI2* pOemCB = new IOemUI2 ; - if (pOemCB == NULL) - { - return E_OUTOFMEMORY ; - } - // Get the requested interface. - HRESULT hr = pOemCB->QueryInterface(iid, ppv) ; - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release() ; - return hr ; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks) ; - } - else - { - InterlockedDecrement(&g_cServerLocks) ; - } - return S_OK ; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:Create class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE ; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF ; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY ; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv) ; - pFontCF->Release() ; - - return hr ; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.h deleted file mode 100644 index d723cbb7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/intrface.h +++ /dev/null @@ -1,220 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.h -// -// PURPOSE: Header of interface for PScript5UI replacement plug-in. -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI2 -// -class IOemUI2: public IPrintOemUI2 -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - // - // IPrintOemUI2 methods - // - - // - // QueryJobAttributes - // - - STDMETHOD(QueryJobAttributes) (THIS_ - HANDLE hPrinter, - PDEVMODE pDevmode, - DWORD dwLevel, - LPBYTE lpAttributeInfo - ); - - // - // Hide Standard UI - // - - STDMETHOD(HideStandardUI) (THIS_ - DWORD dwMode - ); - - // - // DocumentEvent - // - - STDMETHOD(DocumentEvent) (THIS_ - HANDLE hPrinter, - HDC hdc, - INT iEsc, - ULONG cbIn, - PVOID pbIn, - ULONG cbOut, - PVOID pbOut, - PINT piResult - ); - - - IOemUI2(); - virtual ~IOemUI2(); - -protected: - LONG m_cRef; // Reference count - BOOL m_bHidingStandardUI; // Flag indicating if we are hiding the Standard UI. - // NOTE: Not all Driver UI versions support hinding - // the Standard Driver UI. - CUIHelper m_Helper; // Container for Driver UI Helper interface. - CFeatures m_Features; // Core Driver features and feature options. -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.cpp deleted file mode 100644 index 331be437..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.cpp +++ /dev/null @@ -1,1042 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.cpp -// -// -// PURPOSE: Main file for OEM UI test module. -// - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "globals.h" -#include "devmode.h" -#include "stringutils.h" -#include "helper.h" -#include "features.h" -#include "oemui.h" - - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - -typedef struct _tagCBUserData -{ - HANDLE hComPropSheet; - HANDLE hPropPage; - POEMUIPSPARAM pOEMUIParam; - PFNCOMPROPSHEET pfnComPropSheet; - CUIHelper *pHelper; - POEMUIOBJ poemuiobj; - BOOL bPermission; - BOOL bHidingStandardUI; - -} CBUSERDATA, *PCBUSERDATA; - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUIItemCallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam); -LONG APIENTRY OEMDevUICallBack(PCPSUICBPARAM pCallbackParam); -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam); -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems); - - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM device or document property UI. -// -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hResult = S_OK; - - - VERBOSE(DLLTEXT("hrOEMPropertyPage(%d) entry.\r\n"), dwMode); - - // Validate parameters. - if( (OEMCUIP_DOCPROP != dwMode) - && - (OEMCUIP_PRNPROP != dwMode) - ) - { - ERR(ERRORTEXT("hrOEMPropertyPage() ERROR_INVALID_PARAMETER.\r\n")); - VERBOSE(DLLTEXT("\tdwMode = %d, pOEMUIParam = %#lx.\r\n"), dwMode, pOEMUIParam); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - hResult = hrDocumentPropertyPage(dwMode, pOEMUIParam); - break; - - case OEMCUIP_PRNPROP: - hResult = hrPrinterPropertyPage(dwMode, pOEMUIParam); - break; - - default: - // Should never reach this! - ERR(ERRORTEXT("hrOEMPropertyPage() Invalid dwMode, %d"), dwMode); - SetLastError(ERROR_INVALID_PARAMETER); - hResult = E_FAIL; - break; - } - - return hResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM document property UI. -// -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hrResult = S_OK; - - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM document property UI. - pOEMUIParam->cOEMOptItems = 1; - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() requesting %d number of items.\r\n"), pOEMUIParam->cOEMOptItems); - } - else - { - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() fill out %d items.\r\n"), pOEMUIParam->cOEMOptItems); - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMDocUIItemCallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - - hrResult = GetStringResource(pOEMUIParam->hOEMHeap, - (HMODULE) pOEMUIParam->hModule, - IDS_ADV_SECTION, - &pOEMUIParam->pOEMOptItems[0].pName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrDocumentPropertyPage() failed to get section name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - } - - -Exit: - - return hrResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM printer property UI. -// -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hrResult = S_OK; - - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM printer property UI. - pOEMUIParam->cOEMOptItems = 1; - - VERBOSE(DLLTEXT("hrPrinterPropertyPage() requesting %d number of items.\r\n"), pOEMUIParam->cOEMOptItems); - } - else - { - DWORD dwError; - DWORD dwDeviceValue; - DWORD dwType; - DWORD dwNeeded; - - - VERBOSE(DLLTEXT("hrPrinterPropertyPage() fill out %d items.\r\n"), pOEMUIParam->cOEMOptItems); - - // Get device settings value from printer. - dwError = GetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, &dwType, (PBYTE) &dwDeviceValue, - sizeof(dwDeviceValue), &dwNeeded); - if( (ERROR_SUCCESS != dwError) - || - (dwDeviceValue > 100) - ) - { - // Failed to get the device value or value is invalid, just use the default. - dwDeviceValue = 0; - } - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMPrinterUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - hrResult = GetStringResource(pOEMUIParam->hOEMHeap, - (HMODULE) pOEMUIParam->hModule, - IDS_DEV_SECTION, - &pOEMUIParam->pOEMOptItems[0].pName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrPrinterPropertyPage() failed to get section name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - pOEMUIParam->pOEMOptItems[0].Sel = dwDeviceValue; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - } - -Exit: - - return hrResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to Document property sheet. -// -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam, - CUIHelper &Helper, - CFeatures *pFeatures, - BOOL bHidingStandardUI) -{ - LONG_PTR lResult = 0; - HRESULT hrResult = S_OK; - - VERBOSE(DLLTEXT("OEMDocumentPropertySheets() entry.\r\n")); - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR(ERRORTEXT("OEMDocumentPropertySheets() ERROR_INVALID_PARAMETER.\r\n")); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - WORD wFeatures = 0; - WORD wIndex = 0; - DWORD dwSheets = 0; - PCBUSERDATA pUserData = NULL; - POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM) pPSUIInfo->lParamInit; - BOOL bPermission = ((pOEMUIParam->dwFlags & DM_NOPERMISSION) == 0); - HANDLE hHeap = pOEMUIParam->hOEMHeap; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - COMPROPSHEETUI Sheet; - - - // Make sure that we have the Core Driver Features. - // Only get features if we are hiding the standard - // document property sheets. - if(bHidingStandardUI) - { - pFeatures->Acquire(hHeap, Helper, pOEMUIParam->poemuiobj); - wFeatures = pFeatures->GetCount(OEMCUIP_DOCPROP); - } - - // Init property page. - memset(&Sheet, 0, sizeof(COMPROPSHEETUI)); - Sheet.cbSize = sizeof(COMPROPSHEETUI); - Sheet.Flags = bPermission ? CPSUIF_UPDATE_PERMISSION : 0; - Sheet.hInstCaller = ghInstance; - Sheet.pHelpFile = NULL; - Sheet.pfnCallBack = OEMDocUICallBack; - Sheet.pDlgPage = CPSUI_PDLGPAGE_TREEVIEWONLY; - Sheet.cOptItem = wFeatures + 1; - Sheet.IconID = IDI_CPSUI_PRINTER; - Sheet.CallerVersion = 0x100; - Sheet.OptItemVersion = 0x100; - - // Get Caller's name. - hrResult = GetStringResource(hHeap, ghInstance, IDS_NAME, &Sheet.pCallerName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to get caller name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - // Get section name. - hrResult = GetStringResource(hHeap, ghInstance, IDS_SECTION, &Sheet.pOptItemName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to get section name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - // Init user data. - pUserData = (PCBUSERDATA) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(CBUSERDATA)); - if(NULL == pUserData) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to allocate user data.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - pUserData->hComPropSheet = pPSUIInfo->hComPropSheet; - pUserData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - pUserData->pOEMUIParam = pOEMUIParam; - pUserData->pHelper = &Helper; - pUserData->poemuiobj = pOEMUIParam->poemuiobj; - pUserData->bPermission = bPermission; - pUserData->bHidingStandardUI = bHidingStandardUI; - Sheet.UserData = (ULONG_PTR) pUserData; - - // Create OptItems for page. - Sheet.pOptItem = CreateOptItems(hHeap, Sheet.cOptItem); - if(NULL == Sheet.pOptItem) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to allocate OPTITEMs.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Add Core Driver features. - for(wIndex = 0; wIndex < wFeatures; ++wIndex) - { - // Initialize level and basic state for feature. - Sheet.pOptItem[wIndex].Level = 1; - Sheet.pOptItem[wIndex].Flags = OPTIF_COLLAPSE; - - // Get the OPTITEM for this feature. - hrResult = pFeatures->InitOptItem(hHeap, - Sheet.pOptItem + wIndex, - wIndex, - OEMCUIP_DOCPROP); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to get OPTITEM for feature %hs.\r\n"), - pFeatures->GetKeyword(wIndex, OEMCUIP_DOCPROP)); - - goto Exit; - } - } - - // Initialize Plug-in OptItems - Sheet.pOptItem[wIndex].Level = 1; - Sheet.pOptItem[wIndex].Flags = OPTIF_COLLAPSE; - Sheet.pOptItem[wIndex].Sel = pOEMDev->dwDriverData; - - // get optitem name. - hrResult = GetStringResource(hHeap, ghInstance, IDS_SECTION, &Sheet.pOptItem[wIndex].pName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to get OptItem %d name. (hrResult = 0x%x)\r\n"), - wIndex, - hrResult); - goto Exit; - } - - Sheet.pOptItem[wIndex].pOptType = CreateOptType(hHeap, 2); - - Sheet.pOptItem[wIndex].pOptType->Type = TVOT_UDARROW; - Sheet.pOptItem[wIndex].pOptType->pOptParam[1].IconID = 0; - Sheet.pOptItem[wIndex].pOptType->pOptParam[1].lParam = 100; - - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PCOMPROPSHEETUI, - (LPARAM)&Sheet, (LPARAM)&dwSheets); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - - -Exit: - - pPSUIInfo->Result = lResult; - return hrResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to printer property sheet. -// -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam, - CUIHelper &Helper, - CFeatures *pFeatures, - BOOL bHidingStandardUI) -{ - LONG_PTR lResult = 0; - HRESULT hrResult = S_OK; - - - VERBOSE(DLLTEXT("hrOEMDevicePropertySheets(%#x, %#x) entry\r\n"), pPSUIInfo, lParam); - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() ERROR_INVALID_PARAMETER.\r\n")); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - Dump(pPSUIInfo); - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - PROPSHEETPAGE Page; - - // If hiding standard UI, then - // need to add Device Settings page, too. - if(bHidingStandardUI) - { - POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM) pPSUIInfo->lParamInit; - BOOL bPermission = ((pOEMUIParam->dwFlags & DPS_NOPERMISSION) == 0); - HANDLE hHeap = pOEMUIParam->hOEMHeap; - WORD wFeatures = 0; - WORD wIndex = 0; - DWORD dwSheets = 0; - DLGPAGE DlgPage; - PCBUSERDATA pUserData = NULL; - COMPROPSHEETUI Sheet; - - - // Make sure that we have the Core Driver Features. - pFeatures->Acquire(hHeap, Helper, pOEMUIParam->poemuiobj); - wFeatures = pFeatures->GetCount(OEMCUIP_PRNPROP); - - // Init DlgPage struct for Device Settings replacement page. - memset(&DlgPage, 0, sizeof(DLGPAGE)); - DlgPage.cbSize = sizeof(DLGPAGE); - DlgPage.DlgTemplateID = DP_STD_TREEVIEWPAGE; - - // Get Device Settings display name. - hrResult = GetStringResource(hHeap, ghInstance, IDS_DEVICE_SETTINGS_NAME, &DlgPage.pTabName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to get Device Settings display name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - // Init Device Settings replacement page. - memset(&Sheet, 0, sizeof(COMPROPSHEETUI)); - Sheet.cbSize = sizeof(COMPROPSHEETUI); - Sheet.Flags = bPermission ? CPSUIF_UPDATE_PERMISSION : 0; - Sheet.hInstCaller = ghInstance; - Sheet.pHelpFile = NULL; - Sheet.pfnCallBack = OEMDevUICallBack; - Sheet.pDlgPage = &DlgPage; //CPSUI_PDLGPAGE_TREEVIEWONLY; - Sheet.cOptItem = wFeatures; - Sheet.cDlgPage = 1; - Sheet.IconID = IDI_CPSUI_PRINTER; - Sheet.CallerVersion = 0x100; - Sheet.OptItemVersion = 0x100; - - // Get Caller's name. - hrResult = GetStringResource(hHeap, ghInstance, IDS_NAME, &Sheet.pCallerName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to get caller name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - // Get section name. - hrResult = GetStringResource(hHeap, ghInstance, IDS_SECTION, &Sheet.pOptItemName); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to get section name. (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - // Allocate and init User data used in our callback for this page. - pUserData = (PCBUSERDATA) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(CBUSERDATA)); - if(NULL == pUserData) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to allocate user data.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - pUserData->hComPropSheet = pPSUIInfo->hComPropSheet; - pUserData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - pUserData->pOEMUIParam = pOEMUIParam; - pUserData->pHelper = &Helper; - pUserData->poemuiobj = pOEMUIParam->poemuiobj; - pUserData->bPermission = bPermission; - pUserData->bHidingStandardUI = bHidingStandardUI; - Sheet.UserData = (ULONG_PTR) pUserData; - - // Create OptItems for page. - Sheet.pOptItem = CreateOptItems(hHeap, Sheet.cOptItem); - if(NULL == Sheet.pOptItem) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to allocate OPTITEMs.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Add Core Driver features. - for(wIndex = 0; wIndex < wFeatures; ++wIndex) - { - // Initialize level and basic state for feature. - Sheet.pOptItem[wIndex].Level = 1; - Sheet.pOptItem[wIndex].Flags = OPTIF_COLLAPSE; - - // Get the OPTITEM for this feature. - hrResult = pFeatures->InitOptItem(hHeap, - Sheet.pOptItem + wIndex, - wIndex, - OEMCUIP_PRNPROP); - if(!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to get OPTITEM for feature %hs.\r\n"), - pFeatures->GetKeyword(wIndex, OEMCUIP_PRNPROP)); - - goto Exit; - } - } - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PCOMPROPSHEETUI, - (LPARAM)&Sheet, (LPARAM)&dwSheets); - if(!SUCCEEDED(lResult)) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to add Device Settings replacement page. (lResult = 0x%x)\r\n"), - lResult); - goto Exit; - } - } - - // Init our property page. - memset(&Page, 0, sizeof(PROPSHEETPAGE)); - Page.dwSize = sizeof(PROPSHEETPAGE); - Page.dwFlags = PSP_DEFAULT; - Page.hInstance = ghInstance; - Page.pszTemplate = MAKEINTRESOURCE(IDD_DEVICE_PROPPAGE); - Page.pfnDlgProc = DevicePropPageProc; - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PROPSHEETPAGE, (LPARAM)&Page, 0); - if(!SUCCEEDED(lResult)) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() failed to add our Device Property page. (lResult = 0x%x)\r\n"), - lResult); - goto Exit; - } - - VERBOSE(DLLTEXT("hrOEMDevicePropertySheets() pfnComPropSheet returned %d.\r\n"), lResult); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - - -Exit: - - pPSUIInfo->Result = lResult; - return hrResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM printer property UI. -// -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - - VERBOSE(DLLTEXT("OEMPrinterUICallBack() entry, Reason is %d.\r\n"), pCallbackParam->Reason); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - { - DWORD dwDriverValue = pOEMUIParam->pOEMOptItems[0].Sel; - - // Store OptItems state in printer data. - SetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, REG_DWORD, (PBYTE) &dwDriverValue, sizeof(DWORD)); - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Call back for OEM device property UI. -// -#pragma warning(push) -// 2 MAX_PATH strings just slightly exceed the default threshold for the prefast stack usage warning -#pragma warning( disable : 6262 ) -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uiMsg) - { - case WM_COMMAND: - switch(HIWORD(wParam)) - { - case BN_CLICKED: - switch(LOWORD(wParam)) - { - case IDC_CALIBRATE: - // Just display a message that the printer is calibrated, - // since we don't acutally calibrate anything. - { - TCHAR szName[MAX_PATH]; - TCHAR szCalibrated[MAX_PATH]; - - - LoadString(ghInstance, IDS_NAME, szName, sizeof(szName)/sizeof(szName[0])); - LoadString(ghInstance, IDS_CALIBRATED, szCalibrated, sizeof(szCalibrated)/sizeof(szCalibrated[0])); - MessageBox(hDlg, szCalibrated, szName, MB_OK); - } - break; - } - break; - - default: - return FALSE; - } - return TRUE; - - case WM_NOTIFY: - { - switch (((LPNMHDR)lParam)->code) // type of notification message - { - case PSN_SETACTIVE: - break; - - case PSN_KILLACTIVE: - break; - - case PSN_APPLY: - break; - - case PSN_RESET: - break; - } - } - break; - } - - return FALSE; -} -#pragma warning(pop) - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM document property UI. -// -LONG APIENTRY OEMDocUIItemCallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("OEMDocUIItemCallBack() entry, Reason is %d.\r\n"), pCallbackParam->Reason); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Store OptItems state in DEVMODE. - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_KILLACTIVE: - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pOEMUIParam->pOEMOptItems[0].Sel) != pOEMDev->dwAdvancedData) - { - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - pOEMUIParam->pOEMOptItems[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam) -{ - WORD wItems = pCallbackParam->cOptItem; - LONG lReturn = CPSUICB_ACTION_NONE; - POPTITEM pOptItem = pCallbackParam->pOptItem; - PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData; - HANDLE hHeap = pUserData->pOEMUIParam->hOEMHeap; - POEMDEV pOEMDev = (POEMDEV) pUserData->pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("OEMDocUICallBack() entry, Reason is %d.\r\n"), pCallbackParam->Reason); - - // - // If user has no permission to change anything, then - // simply return without taking any action. - // - - if (!pUserData->bPermission && (pCallbackParam->Reason != CPSUICB_REASON_ABOUT)) - return CPSUICB_ACTION_NONE; - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - if(wItems > 0) - { - // Save feature options if hidig standard UI. - if(pUserData->bHidingStandardUI) - { - HRESULT hrResult; - - - // Save feature OPTITEMs. - hrResult = SaveFeatureOptItems(hHeap, - pUserData->pHelper, - pUserData->poemuiobj, - pCallbackParam->hDlg, - pOptItem, - wItems); - if(!SUCCEEDED(hrResult)) - { - // Return that we didn't save changes. - // NOTE: it is up to SaveFeatureOptItems() to display - // any UI for failure. - return CPSUICB_ACTION_NO_APPLY_EXIT; - } - } - - // Save OPTITEM that we explicitly added. - pOEMDev->dwDriverData = pOptItem[wItems - 1].Sel; - pUserData->pfnComPropSheet(pUserData->hComPropSheet, CPSFUNC_SET_RESULT, - (LPARAM)pUserData->hPropPage, - (LPARAM)CPSUI_OK); - - } - break; - - case CPSUICB_REASON_KILLACTIVE: - if(wItems > 0) - { - // Update OPTITEM that we explicitly added. - pOEMDev->dwDriverData = pOptItem[wItems - 1].Sel; - } - break; - - case CPSUICB_REASON_SETACTIVE: - if(wItems > 0) - { - if((DWORD)(pOptItem[wItems - 1].Sel) != pOEMDev->dwDriverData) - { - // Update OPTITEM that we explicitly added. - pOptItem[wItems - 1].Sel = pOEMDev->dwDriverData; - pOptItem[wItems - 1].Flags |= OPTIF_CHANGED; - } - } - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - break; - - default: - break; - } - - return lReturn; -} - -LONG APIENTRY OEMDevUICallBack(PCPSUICBPARAM pCallbackParam) -{ - WORD wItems = pCallbackParam->cOptItem; - LONG lReturn = CPSUICB_ACTION_NONE; - POPTITEM pOptItem = pCallbackParam->pOptItem; - PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData; - HANDLE hHeap = pUserData->pOEMUIParam->hOEMHeap; - - - VERBOSE(DLLTEXT("OEMDevUICallBack() entry, Reason is %d.\r\n"), pCallbackParam->Reason); - - // - // If user has no permission to change anything, then - // simply return without taking any action. - // - - if (!pUserData->bPermission && (pCallbackParam->Reason != CPSUICB_REASON_ABOUT)) - return CPSUICB_ACTION_NONE; - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - if(wItems > 0) - { - // Save feature options if hidig standard UI. - if(pUserData->bHidingStandardUI) - { - HRESULT hrResult; - - - // Save feature OPTITEMs. - hrResult = SaveFeatureOptItems(hHeap, - pUserData->pHelper, - pUserData->poemuiobj, - pCallbackParam->hDlg, - pOptItem, - wItems); - if(!SUCCEEDED(hrResult)) - { - // Return that we didn't save changes. - // NOTE: it is up to SaveFeatureOptItems() to display - // any UI for failure. - return CPSUICB_ACTION_NO_APPLY_EXIT; - } - } - - - pUserData->pfnComPropSheet(pUserData->hComPropSheet, CPSFUNC_SET_RESULT, - (LPARAM)pUserData->hPropPage, - (LPARAM)CPSUI_OK); - } - break; - - case CPSUICB_REASON_KILLACTIVE: - break; - - case CPSUICB_REASON_SETACTIVE: - break; - - default: - break; - } - - return lReturn; -} - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Creates and Initializes OptItems. -// -POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems) -{ - POPTITEM pOptItems = NULL; - SIZE_T sizeOfOptItems = 0; - - // Compute the size of memory needed for the OptItems: - if (SUCCEEDED(SIZETMult(sizeof(OPTITEM), (SIZE_T)dwOptItems, &sizeOfOptItems))) - { - // Allocate memory for OptItems; - pOptItems = (POPTITEM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeOfOptItems); - if(NULL != pOptItems) - { - InitOptItems(pOptItems, dwOptItems); - } - else - { - ERR(ERRORTEXT("CreateOptItems() failed to allocate memory for OPTITEMs!\r\n")); - } - } - else - { - ERR(ERRORTEXT("CreateOptItems() failed to compute necessary memory size for OPTITEMs!\r\n")); - } - - return pOptItems; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems. -// -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems) -{ - VERBOSE(DLLTEXT("InitOptItems() entry.\r\n")); - - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for(DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OptType for OptItem. -// -POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams) -{ - POPTTYPE pOptType = NULL; - - - VERBOSE(DLLTEXT("CreateOptType() entry.\r\n")); - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - if(NULL != pOptType) - { - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, wOptParams * sizeof(OPTPARAM)); - if(NULL != pOptType->pOptParam) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - ERR(ERRORTEXT("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n")); - - // Free allocated memory and return NULL. - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR(ERRORTEXT("CreateOptType() failed to allocated memory for OPTTYPE!\r\n")); - } - - return pOptType; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.h deleted file mode 100644 index c00b87ef..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/oemui.h +++ /dev/null @@ -1,33 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.H -// -#pragma once - - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - -// Printer registry keys where OEM data is stored. -#define OEMUI_VALUE TEXT("OEMUI_VALUE") -#define OEMUI_DEVICE_VALUE TEXT("OEMUI_DEVICE_VALUE") - - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, CUIHelper &Helper, CFeatures *pFeatures, - BOOL bHidingStandardUI); -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, CUIHelper &Helper, CFeatures *pFeatures, - BOOL bHidingStandardUI); - -POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems); -POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams); diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precomp.h deleted file mode 100644 index 1374db76..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precomp.h +++ /dev/null @@ -1,55 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// PURPOSE: Header files that should be in the precompiled header. -// -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Safe integer functions to detect integer overflow/underflow conditions: -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/psuirep.def b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/psuirep.def deleted file mode 100644 index eacb15a5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/psuirep.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY PSUIREP -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/resource.h deleted file mode 100644 index 958598da..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PSUIRep/resource.h +++ /dev/null @@ -1,92 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by OEMUI.rc -// -#define IDS_SECTION 1 -#define IDS_CALIBRATED 2 -#define IDS_NAME 3 -#define IDS_DEVICE_SETTINGS_NAME 4 -#define IDS_CONSTRAINT_CONFLICT 5 -#define IDS_DEV_SECTION 6 -#define IDS_ADV_SECTION 10 -#define IDD_DEVICE_PROPPAGE 106 -#define IDD_DOC_PROPPAGE 107 -#define IDS_POSTSCRIPT_VM 400 -#define IDS_KBYTES 401 -#define IDS_SECONDS 402 -#define IDS_PSTIMEOUTS 403 -#define IDS_JOBTIMEOUT 404 -#define IDS_WAITTIMEOUT 405 -#define IDS_PRINTER_DEFAULT 406 -#define IDS_INSTALLABLE_OPTIONS 407 -#define IDS_DOWNLOAD_AS_SOFTFONT 408 -#define IDS_USE_DEVFONTS 409 -#define IDS_FONTSUB_OPTION 410 -#define IDS_FONTSUB_DEFAULT 411 -#define IDS_FONTSUB_SLOW 412 -#define IDS_FONTSUB_TABLE 413 -#define IDS_DEFAULT_TRAY 414 -#define IDS_DRAW_ONLY_FROM_SELECTED 415 -#define IDS_RESTORE_DEFAULTS 417 -#define IDS_PRINTER_FEATURES 418 -#define IDS_METAFILE_SPOOLING 419 -#define IDS_ENABLED 420 -#define IDS_DISABLED 421 -#define IDS_PSOPTIONS 422 -#define IDS_MIRROR 423 -#define IDS_NEGATIVE_PRINT 424 -#define IDS_PAGEINDEP 425 -#define IDS_COMPRESSBMP 426 -#define IDS_CTRLD_BEFORE 427 -#define IDS_CTRLD_AFTER 428 -#define IDS_JOB_CONTROL 429 -#define IDS_TEXT_ASGRX 431 -#define IDS_PAGE_PROTECTION 432 -#define IDS_CANCEL_CONFLICT 433 -#define IDS_IGNORE_CONFLICT 434 -#define IDS_RESOLVE_CONFLICT 435 -#define IDS_GETDATA_FAILED 436 -#define IDS_DRIVERUI_COLORMODE 437 -#define IDS_ENVELOPE 438 -#define IDS_ENV_PREFIX 439 -#define IDS_PSPROTOCOL 440 -#define IDS_PSPROTOCOL_ASCII 441 -#define IDS_PSPROTOCOL_BCP 442 -#define IDS_PSPROTOCOL_TBCP 443 -#define IDS_PSPROTOCOL_BINARY 444 -#define IDS_TRAY_FORMSOURCE 445 -#define IDS_OEMERR_DLGTITLE 446 -#define IDS_OEMERR_OPTITEM 447 -#define IDS_OEMERR_PROPSHEET 448 -#define IDS_CANCEL_CONFLICT_FINAL 449 -#define IDS_PSERROR_HANDLER 450 -#define IDS_PSMINOUTLINE 451 -#define IDS_PSMAXBITMAP 452 -#define IDS_PIXELS 453 -#define IDS_PSOUTPUT_OPTION 454 -#define IDS_PSOPT_SPEED 455 -#define IDS_PSOPT_PORTABILITY 456 -#define IDS_PSOPT_EPS 457 -#define IDS_PSOPT_ARCHIVE 458 -#define IDS_PSTT_DLFORMAT 459 -#define IDS_TTDL_DEFAULT 460 -#define IDS_TTDL_TYPE1 461 -#define IDS_TTDL_TYPE3 462 -#define IDS_TTDL_TYPE42 463 -#define IDS_PSLEVEL 471 -#define IDS_TRUE_GRAY_TEXT 507 -#define IDS_TRUE_GRAY_GRAPH 508 -#define IDS_ADD_EURO 509 -#define IDS_PSCRIPT_CUSTOMSIZE 600 -#define IDC_CALIBRATE 1001 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1002 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.gpd b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.gpd deleted file mode 100644 index fa3e7864..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.gpd +++ /dev/null @@ -1,763 +0,0 @@ -*GPDFileName: "ptpcplpr.gpd" -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*Include: "ttfsub.gpd" -*ModelName: "UniDrv PT/PC Plugin Provider" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 -*PrintRate: 16 -*PrintRateUnit: PPM -*PrintRatePPM: 16 - -*%****************************************************************************************** -*% Orientation -*%****************************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l0O" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *Cmd: "<1B>&l1O" - } - } -} - -*%****************************************************************************************** -*% Input Bin -*%****************************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: AUTO - *Option: AUTO - { - *rcNameID: =AUTO_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l0H" - } - } - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l1H" - } - } -} - -*%****************************************************************************************** -*% Resolution -*%****************************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: Option2 - *Option: Option1 - { - *Name: "600 x 600" =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=600<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t600R" - } - } - *Option: Option2 - { - *Name: "300 x 300" =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } - *Option: Option3 - { - *Name: "150 x 150" =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(150, 150) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=150<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t150R" - } - } -} - -*%****************************************************************************************** -*% HP-GL/2 Graphics Support -*%****************************************************************************************** -*Ifdef: WINNT_51 -*Personality: =PERSONALITY_HPGL2 -*Feature: GraphicsMode -{ - *rcNameID: =GRAPHICSMODE_DISPLAY - *DefaultOption: RASTERMODE - *Option: HPGL2MODE - { - *rcNameID: =GRAPHICSMODE_HPGL2_DISPLAY - } - *Option: RASTERMODE - { - *rcNameID: =GRAPHICSMODE_RASTER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "@PJL SET LIMAGEENHANCE=OFF<0A>" - } - } -} -*Endif: - -*%****************************************************************************************** -*% Paper Size -*%****************************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5260x7704Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7332x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5880x8900Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t8900x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(288, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(204, 13824) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t4970x7040Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t6780x4970Y" - } - } - } - } -} - -*%****************************************************************************************** -*% Media Type -*%****************************************************************************************** -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: STANDARD - *Option: STANDARD - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n6WdPlain" - } - } - *Option: CustomPhotographicPaper - { - *Name: "Photographic" - *PrintSchemaKeywordMap: "Photographic" - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n13WdPhotographic" - } - } -} - -*%****************************************************************************************** -*% Color Mode -*%****************************************************************************************** -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *DefaultOption: 24bpp - *Option: Mono - { - *rcNameID: =MONO_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 1 - *Color?: FALSE - } - *Option: Color - { - *rcNameID: =COLOR_DISPLAY - *DevNumOfPlanes: 3 - *DevBPP: 1 - *DrvBPP: 4 - EXTERN_GLOBAL: *RasterSendAllData?: TRUE - *ColorPlaneOrder: LIST(CYAN, MAGENTA, YELLOW) - *Command: CmdSendCyanData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } - *Command: CmdSendMagentaData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } - *Command: CmdSendYellowData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelectBlackColor { *Cmd : "<1B>*v7S" } - *Command: CmdSelectRedColor { *Cmd : "<1B>*v6S" } - *Command: CmdSelectGreenColor { *Cmd : "<1B>*v5S" } - *Command: CmdSelectYellowColor { *Cmd : "<1B>*v4S" } - *Command: CmdSelectBlueColor { *Cmd : "<1B>*v3S" } - *Command: CmdSelectMagentaColor { *Cmd : "<1B>*v2S" } - *Command: CmdSelectCyanColor { *Cmd : "<1B>*v1S" } - *Command: CmdSelectWhiteColor { *Cmd : "<1B>*v0S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*r-3U" - } - } - *Option: 8bpp - { - *rcNameID: =8BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 8 - *DrvBPP: 8 - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*t0I<1B>*l184O<1B>*v6W<000108080808>" - } - } - *Option: 24bpp - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 - *Command: CmdEnableDRC { *Cmd : "<1B>*b3M" } - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSetSrcBmpWidth { *Cmd : "<1B>*r" %d{RasterDataWidthInBytes / 3}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<0003080808081B>*v0a0b0c7i255a255b255c0I<1B>*" -+ "o3W<060400>" - } - } -} - -*%****************************************************************************************** -*% HalfTone -*%****************************************************************************************** -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%****************************************************************************************** -*% Memory -*% -*% Note: Unidrv uses the font memory information to estimate when it needs to stop -*% downloading fonts for a page, and thus driver writers should err on the conservative -*% side. Otherwise, printers will generate "out of memory" device errors for pages with -*% a large number of fonts / unique glyphs. -*%****************************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 32768KB - *Option: 4096KB - { - *Name: "4MB" - *MemoryConfigKB: PAIR(4096, 6750) - } - *Option: 8192KB - { - *Name: "8MB" - *MemoryConfigKB: PAIR(8192, 10350) - } - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 24576KB - { - *Name: "24MB" - *MemoryConfigKB: PAIR(24576, 21150) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } - *Option: 49152KB - { - *Name: "48MB" - *MemoryConfigKB: PAIR(49152, 43050) - } - *Option: 65536KB - { - *Name: "64MB" - *MemoryConfigKB: PAIR(65536, 57150) - } - *Option: 98304KB - { - *Name: "96MB" - *MemoryConfigKB: PAIR(98304, 85950) - } - *Option: 102400KB - { - *Name: "100MB" - *MemoryConfigKB: PAIR(102400, 89700) - } - *Option: 114688KB - { - *Name: "112MB" - *MemoryConfigKB: PAIR(114688, 100550) - } - *Option: 131072KB - { - *Name: "128MB" - *MemoryConfigKB: PAIR(131072, 116250) - } -} - -*%****************************************************************************************** -*% Duplex Unit -*%****************************************************************************************** -*Feature: DuplexUnit -{ - *rcNameID: 429 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *rcNameID: 444 - *DisabledFeatures: LIST(Duplex.VERTICAL, Duplex.HORIZONTAL) - } - *Option: TRUE - { - *rcNameID: 443 - } -} - -*%****************************************************************************************** -*% Duplex Type -*%****************************************************************************************** -*Feature: Duplex -{ - *rcNameID: =TWO_SIDED_PRINTING_DISPLAY - *DefaultOption: NONE - *Option: NONE - { - *rcNameID: =NONE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l0S" - } - } - *Option: VERTICAL - { - *rcNameID: =FLIP_ON_LONG_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l1S" - } - } - *Option: HORIZONTAL - { - *rcNameID: =FLIP_ON_SHORT_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l2S" - } - } -} - -*%****************************************************************************************** -*% Page Photo Printing Intent -*%****************************************************************************************** -*Feature: PhotoPrintingIntent -{ - *Name: "Photo Printing Intent" - *PrintSchemaKeywordMap: "PagePhotoPrintingIntent" - *DefaultOption: None - *Option: None - { - *Name: "None" - *PrintSchemaKeywordMap: "None" - } - *Option: Draft - { - *Name: "Draft" - *PrintSchemaKeywordMap: "PhotoDraft" - } - *Option: Standard - { - *Name: "Standard" - *PrintSchemaKeywordMap: "PhotoStandard" - } - *Option: Best - { - *Name: "Best" - *PrintSchemaKeywordMap: "PhotoBest" - } -} - - -*Feature: OutputQuality -{ - *Name: "Page Output Quality" - *PrintSchemaKeywordMap: "PageOutputQuality" - *DefaultOption: None - *Option: None - { - *Name: "None" - *PrintSchemaKeywordMap: "None" - } - *Option: Draft - { - *Name: "Draft" - *PrintSchemaKeywordMap: "Draft" - } - *Option: High - { - *Name: "High" - *PrintSchemaKeywordMap: "High" - } - *Option: Photographic - { - *Name: "Photographic" - *PrintSchemaKeywordMap: "Photographic" - } -} - -*%****************************************************************************************** -*% Page Protect -*%****************************************************************************************** -*Feature: PageProtect -{ - *rcNameID: =PAGE_PROTECTION_DISPLAY - *DefaultOption: OFF - *Option: ON - { - *rcNameID: =ON_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=LETTER<0A>" - } - } - *Option: OFF - { - *rcNameID: =OFF_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=OFF<0A>" - } - } -} - -*%****************************************************************************************** -*% Doc setup commands -*%****************************************************************************************** -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.7 - *Cmd: "<1B>&u1200D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X@PJL<20>LPORTROTATE<0A><1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.13 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} - -*%****************************************************************************************** -*% Cursor, Page and Color Commands -*%****************************************************************************************** -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT, RASTER, VECTOR) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel) }"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel) }"Y" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*%****************************************************************************************** -*% Font Descriptions and Commands -*%****************************************************************************************** -*TTFSEnabled?: TRUE -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*DeviceFonts: LIST(136,138,146,147,148,149,150,151,152,153,154,155,156,157, -+ 163,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) -*MinFontID: 16534 -*MaxFontID: 32768 -*switch: Resolution -{ - *case: Option1 - { - *FontFormat: HPPCL_OUTLINE - } - *case: Option2 - { - *FontFormat: HPPCL_OUTLINE - } - *case: Option3 - { - *FontFormat: HPPCL_RES - } -} -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } - - -*%******************************************************************************************** -*%* Vector Commands. -*%******************************************************************************************** -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.inf b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.inf deleted file mode 100644 index 067896bd..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.ini b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.ini deleted file mode 100644 index 5535181a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/install/ptpcplpr.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=PTPCPLPR.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj deleted file mode 100644 index 33380c3f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj +++ /dev/null @@ -1,904 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {CED613CF-6666-43FC-9414-02AFBDA83A34} - $(MSBuildProjectName) - Win10 Debug - Win32 - {77D353B7-7DE8-4AB3-A89C-86F5EB1FC56C} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - PTPCPLPR - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - MultiThreaded - MultiThreadedDebug - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;PLUGIN_PRINTTICKET - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib - PTPCPLPR.def - - - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Create - $(IntDir)\precomp.hxx.pch - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj.Filters deleted file mode 100644 index abd9c1c0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/PTPCPLPR.vcxproj.Filters +++ /dev/null @@ -1,272 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {968C24E3-F5FE-4473-9D02-E46A409462B6} - - - h;hpp;hxx;hm;inl;inc;xsd - {D7302931-5FEA-4B5A-B5B1-7B1938023A9E} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {1475CB34-56B8-45D0-9740-D86566D868E6} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/debug.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/debug.hxx deleted file mode 100644 index 877fd6e3..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/debug.hxx +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.hxx -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/dllentry.cxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/dllentry.cxx deleted file mode 100644 index 4934dfc2..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/dllentry.cxx +++ /dev/null @@ -1,48 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cxx -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.hxx" -#include "oem.hxx" -#include "debug.hxx" -#include "globals.hxx" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID ) -{ - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.cxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.cxx deleted file mode 100644 index 75abea62..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.cxx +++ /dev/null @@ -1,21 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: globals.cxx -// - -#include "precomp.hxx" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.hxx deleted file mode 100644 index 72f3aa11..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/globals.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: globals.hxx -// - -#pragma once - -// -// Maximum string length limit for STRSAFE string length function StringCchLength -// Must be less than or equal to maximum upper bound on string length defined by STRSAFE -// library ie STRSAFE_MAX_CCH -// -#define STR_MAX_CCH 10000 - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -extern HINSTANCE ghInstance; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.cxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.cxx deleted file mode 100644 index 3d6f3b90..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.cxx +++ /dev/null @@ -1,493 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.cxx -// -// -// PURPOSE: Implementation of interface for PScript4, PScript5, Unidrv4, -// Unidrv5 UI plug-ins. -// -// - - -#include "precomp.hxx" -#include "debug.hxx" -#include "intrface.hxx" -#include "oem.hxx" -#include "oemptprovider.hxx" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// Private Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0 ; // Count of active components -static long g_cServerLocks = 0 ; // Count of locks - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI body -// - -IOemUI::~IOemUI() -{ - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall IOemUI::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE(DLLTEXT("IOemUI:QueryInterface entry.\r\n\r\n")); - if (IID_IUnknown == iid) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IOemUI:Return pointer to IUnknown.\r\n\r\n")); - } - else if (IID_IPrintOemUI == iid) - { - *ppv = static_cast(this) ; - VERBOSE(DLLTEXT("IOemUI:Return pointer to IPrintOemUI.\r\n")); - } - else - { - VERBOSE(DLLTEXT("IOemUI::QueryInterface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemUI::AddRef() -{ - VERBOSE(DLLTEXT("IOemUI:AddRef entry.\r\n")); - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemUI::Release() -{ - VERBOSE(DLLTEXT("IOemUI:Release entry.\r\n")); - ASSERT (0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - } - return cRef; -} - -HRESULT __stdcall IOemUI::PublishDriverInterface( - IUnknown *) -{ - VERBOSE(DLLTEXT("IOemUI:PublishDriverInterface entry.\r\n")); - - return S_OK; -} - -HRESULT __stdcall IOemUI::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IOemUI::GetInfo entry.\r\r\n")); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - WARNING(DLLTEXT("IOemUI::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER\r\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("IOemUI::GetInfo() exit insufficient buffer!\r\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IOemUI::GetInfo() exit mode not supported.\r\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(DLLTEXT("IOemUI::GetInfo() exit S_OK.\r\r\n")); - return S_OK; -} - -HRESULT __stdcall IOemUI::DevMode( - DWORD , - POEMDMPARAM ) -{ - VERBOSE(DLLTEXT("IOemUI:DevMode entry.\r\n")); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::CommonUIProp( - DWORD , - POEMCUIPPARAM) -{ - VERBOSE(DLLTEXT("IOemUI:CommonUIProp entry.\r\n")); - - return E_NOTIMPL; -} - - -HRESULT __stdcall IOemUI::DocumentPropertySheets( - PPROPSHEETUI_INFO , - LPARAM ) -{ - VERBOSE(DLLTEXT("IOemUI:DocumentPropertySheets entry.\r\n")); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DevicePropertySheets( - PPROPSHEETUI_INFO , - LPARAM ) -{ - VERBOSE(DLLTEXT("IOemUI:DevicePropertySheets entry.\r\n")); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DeviceCapabilities( - POEMUIOBJ , - HANDLE , -_In_ PWSTR , - WORD , - PVOID , - PDEVMODE , - PVOID , - DWORD , - DWORD * ) -{ - VERBOSE(DLLTEXT("IOemUI:DeviceCapabilities entry.\r\n")); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DevQueryPrintEx( - POEMUIOBJ , - PDEVQUERYPRINT_INFO , - PDEVMODE , - PVOID ) -{ - VERBOSE(DLLTEXT("IOemUI:DevQueryPrintEx entry.\r\n")); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::UpgradePrinter( - DWORD , - PBYTE ) -{ - VERBOSE(DLLTEXT("IOemUI:UpgradePrinter entry.\r\n")); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::PrinterEvent( -_In_ PWSTR , - INT , - DWORD , - LPARAM ) -{ - VERBOSE(DLLTEXT("IOemUI:PrinterEvent entry.\r\n")); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DriverEvent( - DWORD , - DWORD , - LPBYTE , - LPARAM ) -{ - VERBOSE(DLLTEXT("IOemUI:DriverEvent entry.\r\n")); - - return E_NOTIMPL; -}; - - -#define PROFILE_NAME L"OEMPROFILE.icm\0" - -HRESULT __stdcall IOemUI::QueryColorProfile( - HANDLE , - POEMUIOBJ , - PDEVMODE , - PVOID , - ULONG , - VOID *, - ULONG *, - FLONG *) -{ - - VERBOSE(DLLTEXT("IOemUI:QueryColorProfile entry.\r\n")); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI::FontInstallerDlgProc( - HWND , - UINT , - WPARAM , - LPARAM ) -{ - VERBOSE(DLLTEXT("IOemUI:FontInstallerDlgProc entry.\r\n")); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI::UpdateExternalFonts( - HANDLE , - HANDLE , -_In_ PWSTR ) -{ - VERBOSE(DLLTEXT("IOemUI:UpdateExternalFonts entry.\r\n")); - - return E_NOTIMPL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) {}; - ~IOemCF() {}; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((IID_IUnknown == iid) || (IID_IClassFactory == iid)) - { - *ppv = static_cast(this) ; - } - else - { - VERBOSE(DLLTEXT("IOemCF::QueryInterface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - HRESULT hr = S_OK; - - //DbgPrint(DLLTEXT("Class factory:\t\tCreate component.")) ; - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (NULL != pUnknownOuter) - { - return CLASS_E_NOAGGREGATION ; - } - - // Create component. - IOemUI* pOemCB = new IOemUI ; - if (NULL == pOemCB) - { - return E_OUTOFMEMORY ; - } - // Get the requested interface. - hr = pOemCB->QueryInterface(iid, ppv) ; - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release() ; - - if (FAILED(hr)) - { - IOEMPTProvider * pOemPT = new IOEMPTProvider(); - - if(NULL == pOemPT) - { - return E_OUTOFMEMORY; - } - - hr = pOemPT->QueryInterface(iid, ppv) ; - - pOemPT->Release(); - } - - return hr ; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks) ; - } - else - { - InterlockedDecrement(&g_cServerLocks) ; - } - return S_OK ; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((0 == g_cComponents) && (0 == g_cServerLocks)) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:Create class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (CLSID_OEMUI != clsid && CLSID_OEMPTPROVIDER != clsid) - { - return CLASS_E_CLASSNOTAVAILABLE ; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF ; // Reference count set to 1 - // in constructor - if (NULL == pFontCF) - { - return E_OUTOFMEMORY ; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv) ; - pFontCF->Release() ; - - return hr ; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.hxx deleted file mode 100644 index 99b950d3..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/intrface.hxx +++ /dev/null @@ -1,178 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.cxx -// -// PURPOSE: Header of interface for PScript4, PScript5, Unidrv4, -// Unidrv5 UI plug-ins. -// -// - -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI -// -class IOemUI: public IPrintOemUI -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - IOemUI() : m_cRef(1) {}; - ~IOemUI(); - -protected: - LONG m_cRef; -}; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oem.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oem.hxx deleted file mode 100644 index a8c7b03c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oem.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: oem.hxx -// - -#pragma once - -//////////////////////////////////////////////////////// -// OEM Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - -// OEM UI Misc defines. -#define DLLTEXT(s) "PTPC Plugin: " s - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.cxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.cxx deleted file mode 100644 index e0e94632..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.cxx +++ /dev/null @@ -1,1145 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: oemptprovider.cxx -// -// -// PURPOSE: Implementation of IOEMPTProvider Class. -// The Provider class implements the -// IPrintOemPrintTicketProvider interface functions that -// provide the plug-in access to Print Ticket and allow the -// plug-in to understand the Unidrv private setting in -// the Print Ticket and expose its private settings to -// Unidrv by putting them publicly in the Print Ticket. The -// various provider methods make use of the -// IPrintCoreHelper Interface methods to -// create instances of XML objects and to communicate -// information with Unidrv. -// -// Functions: -// IPrintOemPrintTicketProvider Interface Functions. -// Private Functions of class IOEMPTProvider. -// - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -#include "precomp.hxx" -#include "globals.hxx" -#include "debug.hxx" -#include "oem.hxx" -#include "xmlhandler.hxx" -#include "oemptprovider.hxx" -#include "printschema.hxx" - -/*++ - -Routine Name: - - IOEMPTProvider constructor - -Routine Description: - - Constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -IOEMPTProvider::IOEMPTProvider() - : m_pCoreHelper(NULL), - m_cRef(1) -{ -} - -/*++ - -Routine Name: - - IOEMPTProvider destructor - -Routine Description: - - Destructor - -Arguments: - - None - -Return Value: - - None - ---*/ - -IOEMPTProvider::~IOEMPTProvider() -{ - - // - // Make sure that helper interface is released. - // - if (m_pCoreHelper) - { - m_pCoreHelper->Release(); - m_pCoreHelper = NULL; - } - - // - // If this instance of the object is being deleted, then the reference - // count should be zero. - // - ASSERT(0 == m_cRef); - -} - -/*++ - -Routine Name: - - IOEMPTProvider QueryInterface - -Routine Description: - - Returns a pointer to a specified interface on an object to which a client currently holds an - interface pointer. - This function must call IUnknown::AddRef on the pointer it returns. - -Arguments: - - riid - Identifier of requested Interface. - ppObj - Output variable that receives the pointer to requested Interface on success - -Return Value: - - HRESULT - S_OK - If the Interface requested is supported - E_NOINTERFACE otherwise - ---*/ - -STDMETHODIMP IOEMPTProvider::QueryInterface( - REFIID riid, - void **ppObj - ) -{ - if ((IID_IUnknown == riid) || (IID_IPrintOemPrintTicketProvider == riid)) - { - *ppObj = static_cast(this); - } - else - { - *ppObj = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppObj)->AddRef(); - return S_OK ; -} - -/*++ - -Routine Name: - - AddRef - -Routine Description: - - The AddRef method increments the reference count for an an interface - on an object. It should be called for every new copy of a pointer to - an interface on a given object. - -Arguments: - - None - -Return Value: - - Returns the value of the new reference count. - ---*/ - -STDMETHODIMP_(ULONG) IOEMPTProvider::AddRef( - VOID - ) -{ - return InterlockedIncrement(&m_cRef); -} - -/*++ - -Routine Name: - - Release - -Routine Description: - - The Release method decrements the reference count for the calling - interface on a object. If the reference count on the object falls - to 0, the object is freed from memory. - -Arguments: - - None - -Return Value: - - Returns the resulting value of the reference count. - ---*/ -_At_(this, __drv_freesMem(object)) -STDMETHODIMP_(ULONG) IOEMPTProvider::Release( - THIS - ) -{ - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (0 == cRef) - { - delete this; - } - return cRef; -} - -/*++ - -Routine Name: - - GetSupportedVersions - -Routine Description: - - The routine returns major versions of Printschema schema supported by the plug-in Provider. - - -Arguments: - hPrinter - Printer Handle - ppVersions - OUT pointer to array of version numbers to be filled in by the plug-in - cVersions - OUT pointer to count of Number of versions supported by plug-in - -Return Value: - HRESULT - S_OK - On Success - E_* - On failure - ---*/ -STDMETHODIMP IOEMPTProvider::GetSupportedVersions -( - _In_ HANDLE , - _Outptr_result_buffer_maybenull_(*cVersions) INT *ppVersions[], - _Out_ INT *cVersions - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::GetSupportedVersions: entry.\r\n")); - - HRESULT hr = S_OK; - - // - // check if input parameters are valid - // - if (!ppVersions || !cVersions) - { - return E_INVALIDARG; - } - - // - // The Plug-in Provider need to allocate memory for the input version array and - // then fill it with version information - // - *ppVersions = (INT *)CoTaskMemAlloc(sizeof(INT)); - - if (!*ppVersions) - { - *cVersions = 0; - return E_OUTOFMEMORY; - } - else - { - // - // version number 1 is the only version supported currently - // - - *cVersions = 1; - (*ppVersions)[0] = PRINTSCHEMA_VERSION_NUMBER; - } - - return hr; -} - -/*++ - -Routine Name: - - BindPrinter - -Routine Description: - - Bind Printer is the part of the Unidrv's activity to bind to a device. It allows the plug-in to cache - certain information that can be used later on. - -Arguments: - - hPrinter - Printer Handle supplied by Unidrv - version - version of Printschema - pOptions - Flags passed out to set configurable options supported by caller - cNamespaces - Count of private namespaces of plug-in - ppNamespaces - OUT pointer to the array of Namespace URIs filled in by plug-in - -Return Value: - - HRESULT - S_OK - On Success - E_VERSION_NOT_SUPPORTED - if printer version specified is not supported by plug-in - E_* - On any other failure - ---*/ - -STDMETHODIMP IOEMPTProvider::BindPrinter -( - _In_ HANDLE hPrinter, - INT version, - _Out_ POEMPTOPTS pOptions, - _Out_ INT *cNamespaces, - _Outptr_result_buffer_maybenull_(*cNamespaces) BSTR **ppNamespaces - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::BindPrinter: entry.\r\n")); - - HRESULT hr = S_OK; - - // - // check if input parameters are NULL - // Printer Handle should be provided by Unidrv in this call, which is cached by plug-in provider and - // is later on used while making calls to Plug-in Helper Interface methods. - // - if (!pOptions || !cNamespaces || !ppNamespaces || !hPrinter) - { - return E_INVALIDARG; - } - - - *ppNamespaces = NULL; - - *cNamespaces = 0; - - // - // Agree on the Printschema version with Unidrv - // Version 1 is the only version currently supported - // - if (PRINTSCHEMA_VERSION_NUMBER != version) - { - return E_VERSION_NOT_SUPPORTED; - } - - // - // Bind to the Physical Printer device - // cache the printer handle for further use - // - m_hPrinterCached = hPrinter; - - // - // Flags to set configurable options, - // OEMPT_DEFAULT defined in prcomoem.h - // - *pOptions = OEMPT_DEFAULT; - - return hr; - -} - -/*++ - -Routine Name: - - PublishPrintTicketHelperInterface - -Routine Description: - - For a number of operations, the plug-in needs to use the Helper Interface utilities provided by - Unidrv. Unidrv uses this method to publish the Print Ticket Helper Interface, IPrintCoreHelper. - Plug-in should return SUCCESS after successfully incrementing the reference count of the interface. - -Arguments: - - pHelper - IPrintCoreHelper interface pointer - -Return Value: - - HRESULT - S_OK - On Success - E_* - On failure - ---*/ -STDMETHODIMP IOEMPTProvider::PublishPrintTicketHelperInterface -( - _In_ IUnknown *pHelper - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::PublishPrintTicketHelperInterface: entry.\r\n")); - - if (!pHelper) - { - return E_INVALIDARG; - } - - HRESULT hr = S_OK; - - // - // Need to store pointer to Driver Helper functions, if we already haven't. - // - if (NULL == m_pCoreHelper) - { - hr = pHelper->QueryInterface(IID_IPrintCoreHelperUni, (VOID**)&m_pCoreHelper); - } - - // - // It's possible that this routine will publish other interfaces in the - // future. If the object published did not support the desired interface, - // this routine should still succeed. - // - // If the helper interface is needed, but for some reason was not - // published (this would be an error on the OS's part), you should - // detect this and fail during the call-back where you intended to - // use the helper interface. - // - - if (E_NOINTERFACE == hr) - { - hr = S_OK; - } - - return hr; -} - -/*++ - -Routine Name: - - QueryDeviceDefaultNamespace - -Routine Description: - - Plug-in should specify the name of Private namespace URI that Unidrv - should be using to handle any features defined in the GPD that Unidrv - does not recognize plug-in may specify a set of namespaces as a result - of the call to BindPrinter method, and Unidrv needs to know which of - them is to be used as default namespace so that, for all the features - that Unidrv does not recognize, it will put them under this namespace - in Print Ticket. - - This method is optional. A plug-in can return E_NOTIMPL from this - method if there are multiple plug-ins and another plug-in is providing - the default, or if the plug-in does not want to change the default - namespace that unidrv provides. - - Note: It is Unidrv's responsibility to add the private namespace URI - that plug-in has specified through this call in the root node of the - DOM document, and also define a prefix for it so that plug-in should - use the prefix defined by Unidrv when it wishes to add any new node to - the Print Ticket under its private namespace. Plug-in should not define - its own prefix for this default private namespace URI. - -Arguments: - - pbstrNamespaceUri - OUT Pointer to namespace URI to be filled in and returned by plug-in - -Return Value: - - HRESULT - S_OK - On success - E_* - On failure - ---*/ - -STDMETHODIMP IOEMPTProvider::QueryDeviceDefaultNamespace -( - _Out_ BSTR * - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::QueryDeviceDefaultNamespace: entry.\r\n")); - - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - ConvertPrintTicketToDevMode - -Routine Description: - - Unidrv will call this routine before it performs its part of PT->DM - conversion. The plug-in is passed with an input Print Ticket that is - fully populated, and Devmode which has default settings in it. For - this conversion, the plug-in needs to undo whatever changes it made to - the Print Ticket during Devmode->PT conversion. - -Arguments: - - pPrintTicket - pointer to input Print Ticket - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - - -Return Value: - - HRESULT - S_OK - On Success - E_* - On failure - ---*/ - -STDMETHODIMP IOEMPTProvider::ConvertPrintTicketToDevMode -( - _In_ IXMLDOMDocument2 *pPrintTicket, - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG , // cbDrvPrivateSize - _Inout_ PVOID // pPrivateDevmode - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::ConvertPrintTicketToDevMode: entry.\r\n")); - - // - // cbDrvPrivateSize will be 0 because this plug-in doesn't - // support a private DEVMODE. - // - if (!cbDevmode || !pDevmode || !pPrintTicket) - { - return E_INVALIDARG; - } - - return S_OK; -} - -/*++ - -Routine Name: - - ConvertDevModeToPrintTicket - -Routine Description: - - Unidrv will call the routine with an Input Print - Ticket that is populated with public and Unidrv private features. For - those features in the GPD that Unidrv does not understand, it puts - them in the PT under the private namespace (either specified by the - plug-in through QueryDeviceDefaultNamespace or created by itself). It - is the plug-in's responsibility to read the corresponding features - from the input PT and put them in public printschema namespace, so - that any higher level application making use of a print ticket can - read and interpret these settings. - - -Arguments: - - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - pPrintTicket - pointer to input Print Ticket - -Return Value: - - HRESULT - S_OK - On Success - E_* - On failure - ---*/ -STDMETHODIMP IOEMPTProvider::ConvertDevModeToPrintTicket -( - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG , // cbDrvPrivateSize - _Inout_ PVOID , // pPrivateDevmode, - _Inout_ IXMLDOMDocument2 *pPrintTicket - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::ConvertDevModeToPrintTicket: entry.\r\n")); - - // - // cbDrvPrivateSize will be 0 because this plug-in doesn't - // support a private DEVMODE. - // - if (!cbDevmode || !pDevmode || !pPrintTicket) - { - return E_INVALIDARG; - } - - HRESULT hr = S_OK; - - OEMPTXMLHandler opxh; - EIntentValue eIntentValue = printschema::photoprintingintent::None; - - // - // Initialize PrintTicketHandler - // - - hr = opxh.SetRoot(pPrintTicket, m_pCoreHelper); - - if (SUCCEEDED(hr)) - { - hr = ReadAndDeletePhotoPrintingIntent(opxh, eIntentValue); - } - - if (S_FALSE == hr) - { - hr = S_OK; - } - - return hr; -} - - -/*++ - -Routine Name: - - CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input Print Ticket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input Print Ticket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - On Success - E_* - On failure - ---*/ -STDMETHODIMP IOEMPTProvider::CompletePrintCapabilities -( - _In_opt_ IXMLDOMDocument2 *, - _Inout_ IXMLDOMDocument2 *pCapabilities - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::CompletePrintCapabilities: entry.\r\n")); - - if (!pCapabilities) - { - return E_INVALIDARG; - } - - return S_OK; -} - -/*++ - -Routine Name: - - ExpandIntentOptions - -Routine Description: - - As part of its Merge and Validate Procedure, the - Unidrv/Postscript driver will call this routine to give the plug-in a - chance to expand options which represent intent into their individual - settings in other features in the print ticket. This has two - important effects: the client sees the results of the intent - expansion, and unidrv resolves constraints against the individual - features which are affected by the intent. - - If the plug-in does not support any intent features, then the plug-in - should simply return S_OK. - -Arguments: - - pPrintTicket - Pointer to input Print Ticket. - -Return Value: - - HRESULT - S_OK - On Success - E_* - On failure - ---*/ - -STDMETHODIMP IOEMPTProvider::ExpandIntentOptions( - _Inout_ IXMLDOMDocument2 *pPrintTicket - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::ExpandIntentOptions: entry.\r\n")); - - if (!pPrintTicket) - { - return E_INVALIDARG; - } - - HRESULT hr = S_OK; - OEMPTXMLHandler opxh; - - // - // Initialize PrintTicketHandler - // - - hr = opxh.SetRoot(pPrintTicket, m_pCoreHelper); - - // - // Read in the photo printing intent value, if it exists. If it - // doesn't, the default value of None is assumed instead. - // - - EIntentValue eIntentValue = printschema::photoprintingintent::None; - - if (SUCCEEDED(hr)) - { - hr = ReadAndDeletePhotoPrintingIntent(opxh, eIntentValue); - } - - if (S_FALSE == hr) - { - hr = S_OK; - } - - if (printschema::photoprintingintent::None != eIntentValue) - { - IOEMPTProvider::IntentConversionEntry entry = IOEMPTProvider::intentConversionTable[eIntentValue]; - - // - // Set appropriate values for PageMediaType and - // PageOutputQuality. Override any existing values of the - // options (by deleting before adding). - // - - if (SUCCEEDED(hr)) - { - hr = AddOrOverridePageMediaType(opxh, entry.pageMediaType); - } - - if (SUCCEEDED(hr)) - { - hr = AddOrOverridePageOutputQuality(opxh, entry.pageOutputQuality); - } - } - - return hr; -} - -/*++ - -Routine Name: - - ValidatePrintTicket - -Routine Description: - - The plug-in might need to delete any feature under private namespace - from input PT that are also in the public namespace because of Merge - and Validate. - - The Validate method should also perform any conflict resolution if - necessary looking at the settings made in public and unidrv private - part of Print Ticket, to make sure that the resultant Print Ticket is a - valid one, and has all constraints resolved. - -Arguments: - - pBaseTicket - Pointer to input Print Ticket. - -Return Value: - - HRESULT - S_NO_CONFLICT/S_CONFLICT_RESOLVED - On Success - E_* - On failure - ---*/ - -STDMETHODIMP IOEMPTProvider::ValidatePrintTicket( - _Inout_ IXMLDOMDocument2 *pPrintTicket - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::ValidatePrintTicket: entry.\r\n")); - - if (!pPrintTicket) - { - return E_INVALIDARG; - } - - // - // If the plug-in performs validation successfully, it needs to - // send either S_NO_CONFLICT or S_CONFLICT_RESOLVED as the result - // code, sending hr = S_OK will not work since Unidrv expects one - // of the above two success codes to interpret successful - // completion of plug-in validate method. - // - - return S_NO_CONFLICT; -} - -// -// Private stuff -// - -IOEMPTProvider::IntentConversionEntry IOEMPTProvider::intentConversionTable[] = -{ - { NULL, NULL, }, - { printschema::pagemediatype::PLAIN, printschema::pageoutputquality::DRAFT, }, - { printschema::pagemediatype::PHOTOGRAPHIC, printschema::pageoutputquality::HIGH, }, - { printschema::pagemediatype::PHOTOGRAPHIC, printschema::pageoutputquality::PHOTOGRAPHIC, }, -}; - -/*++ - -Routine Name: - - ReadAndDeletePhotoPrintingIntent - -Routine Description: - - This function gets the value of the Photo Printing Intent from a Print - Ticket and returns it in eIntentValue. It also deletes the entire - feature from the Ticket. - -Arguments: - - opxh - reference to input XMLHandler - eIntentValue - reference to output intent value - -Return Value: - - HRESULT - S_OK - On success, if intent was found - S_FALSE - On Success, if intent was not found - E_* - On failure - ---*/ - -HRESULT IOEMPTProvider::ReadAndDeletePhotoPrintingIntent( - OEMPTXMLHandler &opxh, - EIntentValue &eIntentValue - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::ReadAndDeletePhotoPrintingIntent: entry.\r\n")); - - HRESULT hr = S_OK; - - IXMLDOMElement *pPhotoPrintingIntentFeature = NULL; - IXMLDOMElement *pPhotoPrintingIntentOption = NULL; - - hr = opxh.GetFeatureNode(NULL, // meaning root is parent - printschema::KEYWORDS_URI, - printschema::photoprintingintent::FEATURE, - &pPhotoPrintingIntentFeature); - - // - // Check for S_OK == hr and not SUCCEEDED(hr) because - // GetFeatureNode returns S_FALSE if feature is not found - // - - if (S_OK == hr && pPhotoPrintingIntentFeature) - { - hr = opxh.GetOptionNode(pPhotoPrintingIntentFeature, - &pPhotoPrintingIntentOption); - } - - BSTR bstrIntentNamespace = NULL; - BSTR bstrIntentValue = NULL; - - if (S_OK == hr && pPhotoPrintingIntentOption) - { - hr = opxh.GetXMLAttribute(pPhotoPrintingIntentOption, &bstrIntentNamespace, &bstrIntentValue); - } - - if (S_OK == hr && NULL != bstrIntentNamespace) - { - if (0 != wcscmp(bstrIntentNamespace, printschema::KEYWORDS_URI)) - { - // - // We do not delete the node if it specifies a different - // namespace - // - hr = S_FALSE; - } - } - - // - // Search for intent, looping across all possible (valid) values, and store it in eIntentValue - // - - if (S_OK == hr && NULL != bstrIntentValue) - { - EIntentValue e = EIntentValue(0); - - for (; e < printschema::photoprintingintent::EIntentValueMax; ++e) - { - if (0 == wcscmp(bstrIntentValue, printschema::photoprintingintent::OPTIONS[e])) - { - eIntentValue = e; - break; - } - } - - if (printschema::photoprintingintent::EIntentValueMax == e) - { - // - // We do not delete the node if the attribute name - // in the Print Ticket is not one of the valid ones - // - hr = S_FALSE; - } - } - - // - // If found, delete intent - // - - if (S_OK == hr) - { - hr = opxh.DeleteFeatureNode(NULL, pPhotoPrintingIntentFeature); - } - - // - // Make sure all BSTRs are freed, ... - // - - if (bstrIntentNamespace) - { - SysFreeString(bstrIntentNamespace); - bstrIntentNamespace = NULL; - } - - if (bstrIntentValue) - { - SysFreeString(bstrIntentValue); - bstrIntentValue = NULL; - } - - // - // ... and interface pointers released - // - - if (pPhotoPrintingIntentFeature) - { - pPhotoPrintingIntentFeature->Release(); - } - - if (pPhotoPrintingIntentOption) - { - pPhotoPrintingIntentOption->Release(); - } - - return hr; -} - -/*++ - -Routine Name: - - AddOrOverridePageMediaType - -Routine Description: - - This routine takes in the value of the PageMediaType to be set, - depending on the intent that was present. It then deletes any existing - PageMediaType value in the ticket, and then adds the new PageMediaType - value. - -Arguments: - - opxh - reference to input XMLHandler - lpcwstrPageMediaType - input PageMediaType string - -Return Value: - - HRESULT - S_OK - On success - E_* - On failure - ---*/ - -HRESULT IOEMPTProvider::AddOrOverridePageMediaType( - OEMPTXMLHandler &opxh, - LPCWSTR lpcwstrPageMediaType - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::AddOrOverridePageMediaType: entry.\r\n")); - - HRESULT hr = S_OK; - - if (NULL == lpcwstrPageMediaType) - { - return S_OK; - } - - IXMLDOMElement *pPageMediaTypeOld = NULL; - IXMLDOMElement *pPageMediaTypeNew = NULL; - - // - // Search for, and delete any old PageMediaType option, since we're - // going to override it - // - - hr = opxh.GetFeatureNode(NULL, - printschema::KEYWORDS_URI, - printschema::pagemediatype::FEATURE, - &pPageMediaTypeOld); - - if (S_OK == hr) - { - hr = opxh.DeleteFeatureNode(NULL, pPageMediaTypeOld); - } - - // - // GetFeatureNode might have returned S_FALSE if it couldn't find - // such a node, so from now on, we check for SUCCEEDED - // - - // - // Create PageMediaType feature node - // - - if (SUCCEEDED(hr)) - { - hr = opxh.CreateFeatureNode(NULL, - printschema::KEYWORDS_URI, - printschema::pagemediatype::FEATURE, - &pPageMediaTypeNew); - } - - // - // Create option node under the feature node above - // - - if (SUCCEEDED(hr)) - { - hr = opxh.CreateOptionNode(pPageMediaTypeNew, - printschema::KEYWORDS_URI, - lpcwstrPageMediaType, - NULL); - } - - if (pPageMediaTypeOld) - { - pPageMediaTypeOld->Release(); - } - - if (pPageMediaTypeNew) - { - pPageMediaTypeNew->Release(); - } - - return hr; -} - -/*++ - -Routine Name: - - AddOrOverridePageOutputQuality - -Routine Description: - - This routine, similar to AddOrOverridePageMediaType, takes in the - value of the PageOutputQuality to be set, depending on the intent that - was present. It then deletes any existing PageOutputQuality value in - the ticket, and then adds the new PageOutputQuality value. - -Arguments: - - opxh - reference to input XMLHandler - lpcwstrPageOutputQuality - input PageOutputQuality string - -Return Value: - - HRESULT - S_OK - On success - E_* - On failure - ---*/ - -HRESULT IOEMPTProvider::AddOrOverridePageOutputQuality( - OEMPTXMLHandler &opxh, - LPCWSTR lpcwstrPageOutputQuality - ) -{ - VERBOSE(DLLTEXT("IOEMPTProvider::AddOrOverridePageOutputQuality: entry.\r\n")); - - HRESULT hr = S_OK; - - if (NULL == lpcwstrPageOutputQuality) - { - return S_OK; - } - - IXMLDOMElement *pPageOutputQualityOld = NULL; - IXMLDOMElement *pPageOutputQualityNew = NULL; - - // - // Search for, and delete any old PageOutputQuality option, since we're - // going to override it - // - - hr = opxh.GetFeatureNode(NULL, - printschema::KEYWORDS_URI, - printschema::pageoutputquality::FEATURE, - &pPageOutputQualityOld); - - if (S_OK == hr) - { - hr = opxh.DeleteFeatureNode(NULL, pPageOutputQualityOld); - } - - // - // GetFeatureNode might have returned S_FALSE if it couldn't find - // such a node, so from now on, we check for SUCCEEDED - // - - // - // Create PageOutputQuality feature node - // - - if (SUCCEEDED(hr)) - { - hr = opxh.CreateFeatureNode(NULL, - printschema::KEYWORDS_URI, - printschema::pageoutputquality::FEATURE, - &pPageOutputQualityNew); - } - - // - // Create option node under the feature node above - // - - if (SUCCEEDED(hr)) - { - hr = opxh.CreateOptionNode(pPageOutputQualityNew, - printschema::KEYWORDS_URI, - lpcwstrPageOutputQuality, - NULL); - } - - if (pPageOutputQualityOld) - { - pPageOutputQualityOld->Release(); - } - - if (pPageOutputQualityNew) - { - pPageOutputQualityNew->Release(); - } - - return hr; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.hxx deleted file mode 100644 index 77b54be1..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/oemptprovider.hxx +++ /dev/null @@ -1,143 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: oemptprovider.hxx -// -// -// PURPOSE: Definition of IOEMPTProvider Class. -// -// - -#pragma once - -#include "xmlhandler.hxx" -#include "printschema.hxx" - -using printschema::photoprintingintent::EIntentValue; - -// -// The Provider class to Implement IPrintOemPrintTicketProvider Interface -// - -class IOEMPTProvider : public IPrintOemPrintTicketProvider -{ -public: - - // - // Public Methods go here - // - IOEMPTProvider(); - virtual ~IOEMPTProvider(); - - // - // Basic COM Methods - // - STDMETHODIMP QueryInterface(THIS_ REFIID riid, void **ppvObj); - - STDMETHODIMP_(ULONG) AddRef(THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHODIMP_(ULONG) Release(THIS); - - - // - // IPrintOemPrintTicketProvider methods - // - - STDMETHOD(GetSupportedVersions)(THIS_ - _In_ HANDLE hPrinter, - _Outptr_result_buffer_maybenull_(*cVersions) INT *ppVersions[], - _Out_ INT *cVersions - ); - - STDMETHOD(BindPrinter)(THIS_ - _In_ HANDLE hPrinter, - INT version, - _Out_ POEMPTOPTS pOptions, - _Out_ INT *cNamespaces, - _Outptr_result_buffer_maybenull_(*cNamespaces) BSTR **ppNamespaces - ); - - STDMETHOD(PublishPrintTicketHelperInterface)(THIS_ - _In_ IUnknown *pHelper - ); - - STDMETHOD(QueryDeviceDefaultNamespace)(THIS_ - _Out_ BSTR *pbstrNamespaceUri - ); - - STDMETHOD(ConvertPrintTicketToDevMode)(THIS_ - _In_ IXMLDOMDocument2 *pPrintTicket, - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode - ); - - STDMETHOD(ConvertDevModeToPrintTicket)(THIS_ - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2 *pPrintTicket - ); - - STDMETHOD(CompletePrintCapabilities)(THIS_ - _In_opt_ IXMLDOMDocument2 *pPrintTicket, - _Inout_ IXMLDOMDocument2 *pCapabilities - ); - - STDMETHOD(ExpandIntentOptions)(THIS_ - _Inout_ IXMLDOMDocument2 *pPrintTicket - ); - - STDMETHOD(ValidatePrintTicket)(THIS_ - _Inout_ IXMLDOMDocument2 *pPrintTicket - ); - -private: - - // - // Data members go here - // - LONG m_cRef; // COM reference count - HANDLE m_hPrinterCached; // cached printer handle - IPrintCoreHelperUni *m_pCoreHelper; // cached pointer to plug-in helper interface - - struct IntentConversionEntry - { - LPCWSTR pageMediaType; - LPCWSTR pageOutputQuality; - }; - - static IntentConversionEntry intentConversionTable[printschema::photoprintingintent::EIntentValueMax]; - - // - // Private Methods - // - - HRESULT ReadAndDeletePhotoPrintingIntent( - OEMPTXMLHandler &opxh, - EIntentValue &eIntentValue - ); - - HRESULT AddOrOverridePageMediaType( - OEMPTXMLHandler &opxh, - LPCWSTR lpcwstrPageMediaType - ); - - HRESULT AddOrOverridePageOutputQuality( - OEMPTXMLHandler &opxh, - LPCWSTR lpcwstrPageOutputQuality - ); - -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precomp.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precomp.hxx deleted file mode 100644 index fc8cb4be..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precomp.hxx +++ /dev/null @@ -1,49 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.hxx -// -// PURPOSE: Header files that should be in the precompiled header. -// - -#pragma once - -// Required header files that shouldn't change often. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include -#include - -#include "common.ver" - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precompsrc.cpp deleted file mode 100644 index 5d84a122..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.hxx" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.cxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.cxx deleted file mode 100644 index d22ffc10..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.cxx +++ /dev/null @@ -1,64 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: printschema.cxx -// -// PURPOSE: Constant definitions for print schema names. -// -// - -#include "precomp.hxx" -#include "printschema.hxx" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -LPCWSTR printschema::FRAMEWORK_URI = - L"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework"; - -LPCWSTR printschema::KEYWORDS_URI = - L"http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"; - -// -// Element types defined in Printschema framework -// - -LPCWSTR printschema::FEATURE_ELEMENT_NAME = L"Feature"; -LPCWSTR printschema::OPTION_ELEMENT_NAME = L"Option"; -LPCWSTR printschema::NAME_ATTRIBUTE_NAME = L"name"; - -// -// Elements described as Printschema keywords -// - -LPCWSTR printschema::photoprintingintent::FEATURE = L"PagePhotoPrintingIntent"; -LPCWSTR printschema::photoprintingintent::OPTIONS[] = { L"None", L"PhotoDraft", L"PhotoStandard", L"PhotoBest", }; - -namespace printschema -{ - namespace photoprintingintent - { - // - // operator prefix increment - // - const EIntentValue & operator++(EIntentValue &e) - - { - e = (EIntentValue)(e + 1); - return e; - } - } -} - -LPCWSTR printschema::pagemediatype::FEATURE = L"PageMediaType"; -LPCWSTR printschema::pagemediatype::PLAIN = L"Plain"; -LPCWSTR printschema::pagemediatype::PHOTOGRAPHIC = L"Photographic"; - -LPCWSTR printschema::pageoutputquality::FEATURE = L"PageOutputQuality"; -LPCWSTR printschema::pageoutputquality::DRAFT = L"Draft"; -LPCWSTR printschema::pageoutputquality::HIGH = L"High"; -LPCWSTR printschema::pageoutputquality::PHOTOGRAPHIC = L"Photographic"; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.hxx deleted file mode 100644 index e6bd73b4..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/printschema.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: printschema.hxx -// -// PURPOSE: Constant declarations for print schema names. -// - -#pragma once - -typedef -enum tagPrintschemaVersion -{ - PRINTSCHEMA_VERSION_NUMBER = 1 -} EPrintschemaVersion; - - -namespace printschema -{ - - extern LPCWSTR FRAMEWORK_URI; - - extern LPCWSTR KEYWORDS_URI; - - // - // Element types defined in Printschema framework - // - - extern LPCWSTR FEATURE_ELEMENT_NAME; - extern LPCWSTR OPTION_ELEMENT_NAME; - extern LPCWSTR NAME_ATTRIBUTE_NAME; - - // - // Elements described as Printschema keywords - // - - namespace photoprintingintent - { - extern LPCWSTR FEATURE; - - enum EIntentValue - { - None = 0, - Draft, - Standard, - Best, - EIntentValueMax, // size of enum list - }; - - extern LPCWSTR OPTIONS[EIntentValueMax]; - - const EIntentValue & operator++(EIntentValue &e); - } - - namespace pagemediatype - { - extern LPCWSTR FEATURE; - extern LPCWSTR PLAIN; - extern LPCWSTR PHOTOGRAPHIC; - } - - namespace pageoutputquality - { - extern LPCWSTR FEATURE; - extern LPCWSTR DRAFT; - extern LPCWSTR HIGH; - extern LPCWSTR PHOTOGRAPHIC; - } - -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.def b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.def deleted file mode 100644 index 20165c2d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY PTPCPLPR -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.rc b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.rc deleted file mode 100644 index c40881de..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/ptpcplpr.rc +++ /dev/null @@ -1,24 +0,0 @@ -#include "winres.h" -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "PT/PC Plugin Provider Module" -#define VER_INTERNALNAME_STR "PTPCPlPr" -#define VER_ORIGINALFILENAME_STR "PTPCPlPr.dll" - -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.cxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.cxx deleted file mode 100644 index 4bbee2e8..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.cxx +++ /dev/null @@ -1,1612 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: xmlhandler.cxx -// -// -// PURPOSE: Helper Class that handles all functionality related to -// processing of input PrintTicket/PrintCapabilities XML documents. -// -// -// Functions: Public and Private functions of class OEMPTXMLHandler. -// - -#include "precomp.hxx" - -#include "globals.hxx" -#include "printschema.hxx" -#include "xmlhandler.hxx" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//Disable the warnings generated by PFEFAST for conversion between wchar_t * and BSTR -//because MSXML defines all its interfaces parameters as BSTR but officially declares itself -//to be wchar_t safe. - -#pragma prefast(disable:__WARNING_WCHAR_TO_BSTR) - -// -// MSXML makes the guarantee that we can call it's methods with LPTSTRs instead -// of BSTRs, so we need to do a const cast whenever we pass our strings to MSXML. -// -#define MSXMLSTR(lptstr_value) (const_cast(lptstr_value)) - -/*++ -Routine Name: - OEMPTXMLHandler -Routine Description: - Print Ticket Handler Constructor - - -Arguments: - None - -Return Value: - None - ---*/ - -OEMPTXMLHandler::OEMPTXMLHandler() : - m_pRootDocument(NULL), - m_pRootElement(NULL), - m_pNSManager(NULL), - m_dwNextIndex(0) -{ -} - -/*++ -Routine Name: - ~OEMPTXMLHandler( -Routine Description: - Print Ticket Handler Destructor - -Arguments: - None - -Return Value: - None - ---*/ - -OEMPTXMLHandler::~OEMPTXMLHandler() -{ - if (m_pRootDocument) - { - m_pRootDocument->Release(); - m_pRootDocument = NULL; - } - if (m_pRootElement) - { - m_pRootElement->Release(); - m_pRootElement = NULL; - } - if (m_pNSManager) - { - m_pNSManager->Release(); - m_pNSManager = NULL; - } -} - -/*++ -Routine Name: - SetRoot - -Routine Description: - - Initialization routine. Sets root of the DOM tree. Alos creates an instance of xml namespace manager - using plug-in helper interface method. - - Note: This routine MUST BE called before any other xml handling routines are called. - Note also that it is not necessary to call CoInitializeEx because Unidrv has already - made that call while creating the DOM tree with appropriate arguments passed on to it - and when Unidrv makes a call to one of plug-in interface routines, since plug-in is - running in the same thread, it does not need to make that call again - In fact the plug-in SHOULD NOT make that call to CoInitializeEx , because Unidrv must have made - that call with some particular concurrency model settings which plug-in cannot find out, - so the plug-in might end up changing the concurrency setting made by Unidrv. - -Arguments: - pRoot - Root of the input DOM tree. - - -Return Value: - HRESULT Completion status code - ---*/ -HRESULT -OEMPTXMLHandler::SetRoot( - _In_ IXMLDOMDocument2 *pRoot, - _In_ IPrintCoreHelper *pHelper - ) -{ - HRESULT hr = S_OK; - - // - // check if input paramters are not NULL - // - if (!pRoot || !pHelper) - { - return E_INVALIDARG; - } - - m_pRootDocument = pRoot; - - m_pRootDocument->AddRef(); - - - // - // Make use of Plug-in Helper Interface method provided by Unidrv to create an Instance of MSXML Namespace Manager. - // The plug-in must make use of Helper Interface provided by Unidrv while creating instance of namespacemanager - // of MSXML DOM document, the plug-in should not load MSXML6.DLL by itself but should rely on Unidrv for - // doing that - // - if (SUCCEEDED(hr)) - { - // - // Note: Current versions of Unidrv support MSXML6 hence plug-in should also support that and write its - // code in compliance with MSXML6 - // - hr = pHelper->CreateInstanceOfMSXMLObject(CLSID_MXNamespaceManager60, NULL, NULL, IID_IMXNamespaceManager, (void**)&m_pNSManager); - } - - // - // Get the Root Element of the document and store it in pRootElement. - // - if (SUCCEEDED(hr)) - { - hr = m_pRootDocument->get_documentElement(&m_pRootElement); - } - - if (FAILED(hr)) - { - if (m_pRootDocument) - { - m_pRootDocument->Release(); - m_pRootDocument = NULL; - } - - if (m_pRootElement) - { - m_pRootElement->Release(); - m_pRootElement = NULL; - } - - if (m_pNSManager) - { - m_pNSManager->Release(); - m_pNSManager = NULL; - } - } - - return hr; -} - -/*++ -Routine Name: - CreateFeatureNode - -Routine Description: - - Creates a new Feature Node - -Arguments: - pParent - parent node of the new feature node, if NULL, root is considered as parent - pszNamespaceURI - namesapce URI to which new node belongs - pszFeatureName - local name of the new feature node - ppFeatureNode - out pointer to newly created node - -Return Value: - HRESULT Completion status code - S_OK on success - E_* on failure - ---*/ - -HRESULT OEMPTXMLHandler::CreateFeatureNode( - _In_opt_ IXMLDOMElement *pParent, - _In_ PCWSTR pszNamespaceURI, - _In_ PCWSTR pszFeatureName, - _Out_opt_ IXMLDOMElement **ppFeatureNode - ) -{ - HRESULT hr = S_OK; - IXMLDOMElement *pNewElement = NULL; - BSTR qName = NULL; - - if (!pszFeatureName) - { - return E_INVALIDARG; - } - - if (!pParent) - { - pParent = m_pRootElement; - } - - - hr = CreateXMLElement(pParent, printschema::FEATURE_ELEMENT_NAME, printschema::FRAMEWORK_URI, &pNewElement); - - if (SUCCEEDED(hr)) - { - hr = CreateQName(pNewElement, pszNamespaceURI, pszFeatureName, &qName); - } - - if (SUCCEEDED(hr)) - { - - // The 'name' attibute node is not namespace qualified; it - // belongs to the namespace of its parent (feature/option) - // node. - - hr = CreateXMLAttribute(pNewElement, printschema::NAME_ATTRIBUTE_NAME, L"", qName); - } - - if (qName) - { - SysFreeString(qName); - qName = NULL; - } - - if (SUCCEEDED(hr) && ppFeatureNode) - { - *ppFeatureNode = pNewElement; - } - else if (pNewElement) - { - pNewElement->Release(); - } - - return hr; - -} - -/*++ -Routine Name: - CreateOptionNode - -Routine Description: - - Creates a new Option Node - -Arguments: - pParent - parent node of the new Option node - pszNamespaceURI - namesapce URI to which new node belongs - pszFeatureName - local name of the new Option node - ppOptionElement - out pointer to newly created node - -Return Value: - HRESULT Completion status code - S_OK on success - E_* on failure - ---*/ - -HRESULT OEMPTXMLHandler::CreateOptionNode( - _In_ IXMLDOMElement *pParent, - _In_ PCWSTR pszNamespaceURI, //print schema URI that corresponds to prefix "prn:" - _In_ PCWSTR pszOptionName, //"TopLeft" etc - _Out_opt_ IXMLDOMElement **ppOptionElement - ) -{ - HRESULT hr = S_OK; - IXMLDOMElement *pNewElement = NULL; - BSTR qName = NULL; - - if (!pParent) - { - return E_INVALIDARG; - } - - hr = CreateXMLElement(pParent, printschema::OPTION_ELEMENT_NAME, printschema::FRAMEWORK_URI, &pNewElement); - - if (SUCCEEDED(hr)) - { - hr = CreateQName(pNewElement, pszNamespaceURI, pszOptionName, &qName); - } - - if (SUCCEEDED(hr)) - { - // The 'name' attibute node is not namespace qualified; it - // belongs to the namespace of its parent (feature/option) - // node. - - hr = CreateXMLAttribute(pNewElement, printschema::NAME_ATTRIBUTE_NAME, L"", qName); - } - - if (qName) - { - SysFreeString(qName); - qName = NULL; - } - - if (SUCCEEDED(hr) && ppOptionElement) - { - *ppOptionElement = pNewElement; - } - else if (pNewElement) - { - pNewElement->Release(); - } - - return hr; -} - -/*++ -Routine Name: - CreateXMLElement - -Routine Description: - Generic method to create new XML element node - -Arguments: - - pParent - pointer to the parent node of the new nod eto be created, if NULL root of DOM tree is considered as parent - pszElementName - local name of the newly created element - pszNamespaceURI - namespace URI that the new element belongs to, the caller can only specify the namespace URI - and not the prefix - ppCreatedElement - double pointer to the newly created element returned by the procedure - -Return Value: - HRESULT Completion status code - S_OK - If the new element node is created successfully - E_* - on failure - ---*/ - -HRESULT OEMPTXMLHandler::CreateXMLElement( - _In_ IXMLDOMElement *pParent, - _In_ PCWSTR pszElementName, - _In_ PCWSTR pszNamespaceURI, - _Out_ IXMLDOMElement **ppCreatedElement - ) -{ - HRESULT hr = S_OK; - IXMLDOMNode *pNewNode = NULL; - BSTR bstrQName = NULL; - - if (!pParent || !pszElementName || !pszNamespaceURI || !ppCreatedElement) - { - return E_INVALIDARG; - } - - // - // create XML Qname - // - hr = CreateQName(pParent, pszNamespaceURI, pszElementName, &bstrQName); - - if (SUCCEEDED(hr)) - { - VARIANT nodeType; - VariantInit(&nodeType); - V_VT(&nodeType) = VT_I4; - V_I4(&nodeType) = NODE_ELEMENT; - hr = m_pRootDocument->createNode(nodeType, bstrQName, MSXMLSTR(pszNamespaceURI), &pNewNode); - if (SUCCEEDED(hr)) - VariantClear(&nodeType); - } - - if (SUCCEEDED(hr)) - hr = pParent->appendChild(pNewNode, NULL); - - - if (SUCCEEDED(hr)) - { - // - // we need to return Interface ptr to IXMLDOMElement. - // - hr = pNewNode->QueryInterface(IID_IXMLDOMElement, (void **)ppCreatedElement); - - // - // if interface is not supported, E_* will be returned in hr, - // we simply return that to the caller. - // - } - - if (pNewNode) - { - // - // release reference to local node Created since it is no longer being used - // - pNewNode->Release(); - } - - if (bstrQName) - { - SysFreeString(bstrQName); - bstrQName = NULL; - } - - return hr; - -} - -/*++ -Routine Name: - CreateQName - -Routine Description: - - Creates XML qname for given local name and namespace URI - Note: It is assumed that a prefix for given URI is already defined in root of DOM document - either by Unidrv or by plug-in itself. - Routine fails if it doesnot find a predefined prefix for given URI. - -Arguments: - pElement - context node - pszUri - Uri - pszLocalName - local name - pQName - a pointer to resultant qname string defined by the routine - -Return Value: - HRESULT Completion status code - - S_OK - On success - E_FAIL - on failure to create Qname - ---*/ -HRESULT OEMPTXMLHandler::CreateQName( - _In_ IXMLDOMElement *pElement, - _In_ PCWSTR pszUri, - _In_ PCWSTR pszLocalName, - _Out_ BSTR *pQName - ) -{ - HRESULT hr = S_OK; - BSTR bstrPrefixString = NULL; - size_t prefixLen = 0; - // Is it the default namespace? If so, don't stick a semicolon in the string - size_t localNameLen = 0; - - if (!pszUri || !pszLocalName || !pQName) - { - return E_INVALIDARG; - } - - *pQName = NULL; - - // - // See if a prefix is already defined for the given URI - // - - hr = getPrefix(pElement, pszUri, &bstrPrefixString); - - // - // It is possible that during validation the prefix might not - // already be defined if we're converting public features to GPD - // features. In that case, we need to add a definition for the - // feature namespace. - // - - if (S_FALSE == hr) - { - hr = declarePrefix(pElement, pszUri, NULL, &bstrPrefixString); - } - - if (SUCCEEDED(hr)) - { - // - // StrSafe function StringCchLength checks if the length of string is less than - // maximum length specified, and returns S_OK if the input string is non NULL and - // length is less that maximum length specified. - // It returns length of string EXCLUDING null terminator - // - hr = StringCchLength(pszLocalName, STR_MAX_CCH, &localNameLen); - } - - if (SUCCEEDED(hr)) - { - if (bstrPrefixString) - { - hr = StringCchLength(bstrPrefixString, STR_MAX_CCH, &prefixLen); - } - } - - if (SUCCEEDED(hr)) - { - if (prefixLen > 0) - { - // non-default namespace - - UINT cchLength = 0; - - if (SUCCEEDED(hr = SizeTAdd(prefixLen, localNameLen, &localNameLen)) && - SUCCEEDED(hr = SizeTAdd(localNameLen, 2, &localNameLen)) && - SUCCEEDED(hr = SizeTToUInt(localNameLen, &cchLength))) - { - - *pQName = SysAllocStringLen(NULL, cchLength); - - if (*pQName) - { - // we got a terminator character as part of SysAllocString. - hr = StringCchPrintf(*pQName, cchLength, L"%s:%s", bstrPrefixString, pszLocalName); - } - else - { - hr = E_OUTOFMEMORY; - } - } - } - else - { - // Default namespace ... - - UINT cchLength = 0; - - if (SUCCEEDED(hr = SizeTAdd(localNameLen, 1, &localNameLen)) && - SUCCEEDED(hr = SizeTToUInt(localNameLen, &cchLength))) - { - *pQName = SysAllocStringLen(NULL, cchLength); - - if (*pQName) - { - // we got a terminator character as part of SysAllocString. - hr = StringCchPrintf(*pQName, cchLength, L"%s", pszLocalName); - } - else - { - hr = E_OUTOFMEMORY; - } - } - } - } - - if (bstrPrefixString) - { - SysFreeString(bstrPrefixString); - bstrPrefixString = NULL; - } - - if (FAILED(hr)) - { - if (*pQName) - { - SysFreeString(*pQName); - *pQName = NULL; - } - } - - return hr; -} - -/*++ -Routine Name: - CreateXMLAttribute - -Routine Description: - Creates an attribute for the given XML element. - -Arguments: - - pElement - pointer to the element node to which an attribute is to be added - pszAttributeName - local name of the attribute - pszNamespaceURI - namespace URI to which the attribute belongs - pszAttributeValue - value of the attribute - -Return Value: - HRESULT Completion status code - S_OK - on success - E_* - on failure - ---*/ - -HRESULT OEMPTXMLHandler::CreateXMLAttribute( - _In_ IXMLDOMElement *pElement, - _In_ PCWSTR pszAttributeName, //"name=" - _In_ PCWSTR pszNamespaceURI, //"pt:" - _In_ PCWSTR pszAttributeValue //"prn:" - ) -{ - HRESULT hr = S_OK; - IXMLDOMAttribute *pNewAttribute = NULL ; - IXMLDOMNode *pNewNode = NULL ; - - if (!pElement || !pszAttributeName || ! pszNamespaceURI || !pszAttributeValue) - { - return E_INVALIDARG; - } - - VARIANT nodeType; - VariantInit(&nodeType); - V_VT(&nodeType) = VT_I4; - V_I4(&nodeType) = NODE_ATTRIBUTE; - hr = m_pRootDocument->createNode(nodeType, MSXMLSTR(pszAttributeName), MSXMLSTR(pszNamespaceURI), &pNewNode); - if (SUCCEEDED(hr)) - VariantClear(&nodeType); - - if (SUCCEEDED(hr)) - { - hr = pNewNode->QueryInterface(IID_IXMLDOMAttribute, (void **)&pNewAttribute); - } - - if (SUCCEEDED(hr)) - { - VARIANT attrType; - VariantInit(&attrType); - V_VT(&attrType) = VT_BSTR; - V_BSTR(&attrType) = SysAllocString(pszAttributeValue); - hr = pNewAttribute->put_value(attrType); - if (SUCCEEDED(hr)) - VariantClear(&attrType); - } - - if (SUCCEEDED(hr)) - { - hr = pElement->setAttributeNode(pNewAttribute, NULL); - } - - if (SUCCEEDED(hr)) - { - if (pNewAttribute) - { - pNewAttribute->Release(); - } - - } - else if (pNewAttribute) - pNewAttribute->Release(); - - if (pNewNode) - pNewNode->Release(); - - return hr; -} - -/*++ -Routine Name: - GetXMLElement -Routine Description: - Returns an XML element with given namespace URI and given attribute - -Arguments: - - pParent - Parent of node to be found - pszElementNamespaceURI - Namespace URI to which the element belongs - pszElementName - Local Name of the element - pszAttrNamespaceURI - Namespace URI to which the attribute of the element belongs - pszAttrName - local name of the element attribute - ppElement - out pointer to xml element so retrieved - -Return Value: - HRESULT Completion status code - S_OK - On Successfully locating XML node specified - S_FALSE - If the specified XML node is not found - E_* - On Failure - - Note: Since the module returns S_FALSE if the specified node is not found, the caller must be - careful to check hr status to be S_OK before proceeding, just checking for SUCCEEDED(hr) might - give wrong results - ---*/ -HRESULT OEMPTXMLHandler::GetXMLElement( - _In_ IXMLDOMElement *pParent, - _In_ PCWSTR pszElementNamespaceURI, - _In_ PCWSTR pszElementName, - _In_ PCWSTR pszAttrNamespaceURI, - _In_ PCWSTR pszAttrName, - _Outptr_result_maybenull_ IXMLDOMElement **ppElement - ) const -{ - HRESULT hr = S_OK; - LONG cChildren = 0; - IXMLDOMNodeList *pChildren = NULL; - - - if (!pParent || !pszElementNamespaceURI || !pszElementName || !pszAttrNamespaceURI || !pszAttrName) - { - return E_INVALIDARG; - } - - *ppElement = NULL; - - // - // Get a list of child nodes for the current DOM node - // - hr = pParent->get_childNodes(&pChildren); - - // - // Get number of child nodes - // - if (SUCCEEDED(hr)) - { - hr = pChildren->get_length(&cChildren); - } - - if (SUCCEEDED(hr)) - { - LONG i = 0; - BOOL bFound = FALSE; - - for(i = 0;i < cChildren && !bFound;i++) - { - IXMLDOMNode *pCurNode; - IXMLDOMElement *pCurElement = NULL; - - hr = pChildren->get_item(i, &pCurNode); - - if (SUCCEEDED(hr)) - { - hr = pCurNode->QueryInterface(IID_IXMLDOMElement, (void **)&pCurElement); - } - if (S_OK == hr) - { - BSTR bstrElementName = NULL; - BSTR bstrElementNamespaceURI = NULL; - - // - // retrieve element name and namespace URI - // - hr = pCurElement->get_baseName(&bstrElementName); - - if (SUCCEEDED(hr)) - { - hr = pCurElement->get_namespaceURI(&bstrElementNamespaceURI); - } - - if (SUCCEEDED(hr) && bstrElementNamespaceURI && bstrElementName) - { - - if (0 == wcscmp(bstrElementName, pszElementName) && 0 == wcscmp(bstrElementNamespaceURI, pszElementNamespaceURI)) - { - // - //check if element name matches - // - BSTR bstrAttrName = NULL; - BSTR bstrAttrNamespaceURI = NULL; - hr = GetXMLAttribute(pCurElement,&bstrAttrNamespaceURI,&bstrAttrName); - if (SUCCEEDED(hr) && bstrAttrName && bstrAttrNamespaceURI) - { - if (0 == wcscmp(bstrAttrName, pszAttrName) && 0 == wcscmp(pszAttrNamespaceURI, bstrAttrNamespaceURI)) - { - bFound = TRUE; - *ppElement = pCurElement; - (*ppElement)->AddRef(); - } - else - { - hr = S_FALSE; - } - } - - SysFreeString(bstrAttrName); - bstrAttrName = NULL; - - SysFreeString(bstrAttrNamespaceURI); - bstrAttrNamespaceURI = NULL; - } - } - - SysFreeString(bstrElementName); - bstrElementName = NULL; - - SysFreeString(bstrElementNamespaceURI); - bstrElementNamespaceURI = NULL; - - if (pCurElement) - { - pCurElement->Release(); - } - } - - if (pCurNode) - { - pCurNode->Release(); - } - } - } - - if (pChildren) - pChildren->Release(); - - if (SUCCEEDED(hr) && (*ppElement)) - { - hr = S_OK; - } - else - { - hr = S_FALSE; - } - - return hr; - -} - -/*++ -Routine Name: - GetXMLElementWithoutAttribute - -Routine Description: - Returns an XML element with given namespace URI. - -Arguments: - - pParent - Parent of node to be found - pszElementNamespaceURI - Namespace URI to which the element belongs - pszElementName - Local Name of the element - ppChildElement - out pointer to xml element so retrieved - -Return Value: - HRESULT Completion status code - S_OK - On Successfully locating XML node specified - S_FALSE - If the specified XML node is not found - E_* - On Failure - - Note: Since the module returns S_FALSE if the specified node is not found, the caller must be - careful to check hr status before proceeding, just checking for SUCCEEDED(hr) might - give wrong results - ---*/ -HRESULT OEMPTXMLHandler::GetXMLElementWithoutAttribute( - _In_ IXMLDOMElement *pContext, - _In_ PCWSTR pszElementNamespace, - _In_ PCWSTR pszElementName, - _Outptr_result_maybenull_ IXMLDOMElement **ppChildElement - ) const -{ - if (!pContext || !pszElementName || !pszElementNamespace || !ppChildElement) - { - return E_INVALIDARG; - } - - HRESULT hr = S_OK; - LONG cChildren = 0; - IXMLDOMNodeList *pContextChildren; - *ppChildElement = NULL; - - // - // Get the list of child nodes - // - hr = pContext->get_childNodes(&pContextChildren); - - if (SUCCEEDED(hr)) - hr = pContextChildren->get_length(&cChildren); - - if (SUCCEEDED(hr)) - { - for(LONG i = 0;i < cChildren && !(*ppChildElement);i++) - { - - IXMLDOMNode *pCurrentNode; - IXMLDOMElement *pCurrentElement; - hr = pContextChildren->get_item(i, &pCurrentNode); - - // - // See if its a DOM Element. Don't set hr here because we - // fully expect that not everything in the context is an element. - // - if (SUCCEEDED(hr) && S_OK == pCurrentNode->QueryInterface(IID_IXMLDOMElement, (void**)&pCurrentElement)) - { - BSTR pbstrBaseName = NULL; - BSTR pbstrNamespaceURI = NULL; - - hr = pCurrentElement->get_baseName(&pbstrBaseName); - - if (SUCCEEDED(hr)) - { - hr = pCurrentElement->get_namespaceURI(&pbstrNamespaceURI); - } - if (SUCCEEDED(hr) && - pbstrNamespaceURI && - pbstrBaseName && - 0 == wcscmp(pbstrNamespaceURI, pszElementNamespace) && - 0 == wcscmp(pbstrBaseName, pszElementName)) - { - *ppChildElement = pCurrentElement; - (*ppChildElement)->AddRef(); - } - - pCurrentElement->Release(); - - SysFreeString(pbstrBaseName); - pbstrBaseName = NULL; - - SysFreeString(pbstrNamespaceURI); - pbstrNamespaceURI = NULL; - } - - if (pCurrentNode) - { - pCurrentNode->Release(); - } - } - } - - if (pContextChildren) - { - pContextChildren->Release(); - } - - if (SUCCEEDED(hr)) - { - if (*ppChildElement) - { - hr = S_OK; - } - else - { - hr = S_FALSE; - } - } - - return hr; -} - -/*++ -Routine Name: - GetXMLAttribute - -Routine Description: - Returns an XML Attribute node with given namespace URI. - -Arguments: - - pParent - Parent of node to be found - pszAttrNamespaceURI - Namespace URI to which the attribute belongs - pszAttrName - Local Name of the attribute - ppChildElement - out pointer to xml node so retrieved - -Return Value: - HRESULT Completion status code - S_OK - On Success - E_* - On Failure - ---*/ -HRESULT OEMPTXMLHandler::GetXMLAttribute( - _In_ IXMLDOMElement *pElement, - _Outptr_result_maybenull_ BSTR *ppAttrNamespaceURI, - _Outptr_result_maybenull_ BSTR *ppAttrName - ) const -{ - HRESULT hr = S_OK; - IXMLDOMNamedNodeMap *pAttrMap = NULL; - IXMLDOMNode *pAttrNode = NULL; - - if (!pElement || !ppAttrNamespaceURI || !ppAttrName) - { - return E_INVALIDARG; - } - - *ppAttrNamespaceURI = NULL; - *ppAttrName = NULL; - - hr = pElement->get_attributes(&pAttrMap); - - if (SUCCEEDED(hr)) - { - hr = pAttrMap->getNamedItem(MSXMLSTR(printschema::NAME_ATTRIBUTE_NAME),&pAttrNode); - } - - if (S_OK == hr) - { - BSTR bstrAttrQName = NULL; - IXMLDOMAttribute *pAttribute = NULL; - - hr = pAttrNode->QueryInterface(IID_IXMLDOMAttribute, (void **)&pAttribute); - - if (SUCCEEDED(hr)) - hr = pAttribute->get_text(&bstrAttrQName); - - if (S_OK == hr && bstrAttrQName) - hr = getUri(pElement, bstrAttrQName, ppAttrNamespaceURI); - - if (S_OK == hr && bstrAttrQName) - hr = getLocalName(bstrAttrQName, ppAttrName); - - if (pAttribute) - pAttribute->Release(); - - if (bstrAttrQName) - { - SysFreeString(bstrAttrQName); - bstrAttrQName = NULL; - } - } - - if (pAttrMap) - pAttrMap->Release(); - if (pAttrNode) - pAttrNode->Release(); - - if (FAILED(hr)) - { - if (*ppAttrNamespaceURI) - { - SysFreeString(*ppAttrNamespaceURI); - *ppAttrNamespaceURI = NULL; - } - if (*ppAttrName) - { - SysFreeString(*ppAttrName); - *ppAttrName = NULL; - } - } - return hr; -} - -/*++ -Routine Name: - GetFeatureNode - -Routine Description: - - Returns the feature node with specified attribute under printschema namespace - -Arguments: - pParent - parent node of the feature node to be located - pszAttrNamespaceURI - namespace URI for the attribute node of given feature node - pszAttrName - attribute name for given feature node - ppElement - OUT pointer to feature node to be returned - -Return Value: - HRESULT Completion status code - S_OK - On Successfully locating Feature node - S_FALSE - If Feature node is not found - E_* - On Failure - - ---*/ -HRESULT OEMPTXMLHandler::GetFeatureNode( - _In_opt_ IXMLDOMElement *pParent, - _In_ PCWSTR pszAttrNamespaceURI, - _In_ PCWSTR pszAttrName, - _Out_ _When_(return == S_FALSE, _At_(*ppElement, _Post_maybenull_)) - _When_(return != S_FALSE, _At_(*ppElement, _Post_valid_)) - IXMLDOMElement **ppElement - ) const -{ - HRESULT hr = S_OK; - - // - // If no parent is specified, set root of DOM tree as parent - // - if (!pParent) - { - pParent = m_pRootElement; - } - - hr = GetXMLElement(pParent, printschema::FRAMEWORK_URI, printschema::FEATURE_ELEMENT_NAME, pszAttrNamespaceURI, pszAttrName, ppElement); - - return hr; -} - -/*++ -Routine Name: - GetOptionNode - -Routine Description: - - Returns the option node under printschema namespace - -Arguments: - pParent - parent node of the option node to be located - ppElement - OUT pointer to option node to be returned - -Return Value: - HRESULT Completion status code - S_OK - On Successfully locating Option node - S_FALSE - If Option node is not found - E_* - On Failure - ---*/ -HRESULT -OEMPTXMLHandler::GetOptionNode( - _In_ IXMLDOMElement *pParent, - _Outptr_result_maybenull_ IXMLDOMElement **ppElement - ) const -{ - return GetXMLElementWithoutAttribute(pParent, printschema::FRAMEWORK_URI, printschema::OPTION_ELEMENT_NAME, ppElement); -} - -/*++ - -Routine Name: - getLocalName -Routine Description: - Returns Local name for input XML Qname. - -Arguments: - pszQName - Qname for which local name is to be found out - ppbstrLocalName - OUT pointer to local name - -Return Value: - HRESULT Completion status code - S_OK - On Success - E_* - On Failure - ---*/ -HRESULT -OEMPTXMLHandler::getLocalName( - _In_ PCWSTR pszQName, - _Out_ BSTR *ppbstrLocalName - ) const -{ - HRESULT hr = S_OK; - - if (!pszQName || !ppbstrLocalName) - { - return E_INVALIDARG; - } - - *ppbstrLocalName = NULL; - - PCWSTR pszStartPos = wcschr(pszQName,L':'); - - if (pszStartPos) - { - pszStartPos++; - } - else - { - pszStartPos = pszQName; - } - - *ppbstrLocalName = SysAllocString(pszStartPos); - - if (!(*ppbstrLocalName)) - { - hr = E_OUTOFMEMORY; - } - - return hr; -} - - -/*++ -Routine Name: - getUri -Routine Description: - Returns namespace URI for given input Qname and in context of given XML DOM node. -Arguments: - pContext - Input XML DOM node for current context - pszQName - input qname - pbstrURI - OUT pointer to URI to be returned -Return Value: - - S_OK if found - S_FALSE if not found - E_OUTOFMEMORY if the string could not be allocated - E_INVALIDARG if a non-optional param is null. - -Notes: - - This routine assumes that the string has already been - validated, which should have happened in the managed code base. - The string should either be of the form "prefix:localname", - or "localname" - ---*/ -HRESULT -OEMPTXMLHandler::getUri( - IXMLDOMElement *pContext, - _In_ PCWSTR pszQName, - _Out_ BSTR *pbstrURI - ) const - -{ - HRESULT hr = S_OK; - BOOL bNodePushed = FALSE; - - if (!(pContext && pbstrURI && pszQName)) - { - return E_INVALIDARG; - } - - PWSTR pszSplitPos = (_TCHAR*) wcschr(pszQName, L':'); - INT cchUri = 0; - *pbstrURI = NULL; - - // - // if splitpos is null, then there is no namespace - // prefix, which means return the default namespace. - // - wchar_t wchSwapChar = L'\0'; - if (pszSplitPos) - { - wchSwapChar = *pszSplitPos; - *pszSplitPos = (wchar_t)0; - } - else - { - pszQName = L""; - } - - hr = m_pNSManager->pushNodeContext(pContext, TRUE); - - if (SUCCEEDED(hr)) - { - bNodePushed = TRUE; - // get the length first, then alloc the string -#pragma prefast(suppress:__WARNING_INVALID_PARAM_VALUE_1, "According to MSDN, it is acceptable to pass a NULL buffer to getURI.") - hr = m_pNSManager->getURI(pszQName, NULL, NULL, &cchUri); - } - - if (S_OK == hr) - { - if (SUCCEEDED(hr)) - { - // account for null terminator - cchUri += 1; - - *pbstrURI = SysAllocStringLen(NULL, cchUri); - if (!(*pbstrURI)) - { - hr = E_OUTOFMEMORY; - } - } - - if (SUCCEEDED(hr)) - { - hr = m_pNSManager->getURI(pszQName, NULL, *pbstrURI, &cchUri); - } - - if (pszSplitPos) - { - *pszSplitPos = wchSwapChar; - } - - if (FAILED(hr) && (*pbstrURI)) - { - SysFreeString(*pbstrURI); - *pbstrURI = NULL; - } - } - - if (bNodePushed) - { - hr = m_pNSManager->popContext(); - } - - return hr; -} - -/*++ - -Routine Name: - getPrefix -Routine Description: - - Returns predefined Prefix for the input namespace URI if one already exists - -Arguments: - pContext - Current context node - pszUri - namespace URI for which prefix is to be obtained - pbstrPrefix - prefix string to be returned, if NULL routine just checks for - existence of prefix - -Return Value: - HRESULT Completion status code - S_OK - on success - S_FALSE - on failure - ---*/ -HRESULT -OEMPTXMLHandler::getPrefix( - _In_ IXMLDOMElement *pContext, - _In_ PCWSTR pszUri, - _Outptr_opt_result_maybenull_ BSTR *pbstrPrefix - ) const -{ - HRESULT hr = S_OK; - BOOL bNodePushed = FALSE; - INT cchPrefix = 0; - - if (!pContext || !pszUri) - return E_INVALIDARG; - - if (pbstrPrefix) - { - *pbstrPrefix = NULL; - } - - //Push context "Deep" to get info abt all URI prefix mappings defined so far in the current DOM document - hr = m_pNSManager->pushNodeContext(pContext, TRUE); - - if (SUCCEEDED(hr)) - { - bNodePushed = TRUE; - - // get the length first, then alloc the string - - hr = m_pNSManager->getPrefix(pszUri, 0, NULL, &cchPrefix); - } - - - if (S_OK == hr && pbstrPrefix) - { - - *pbstrPrefix = NULL; - cchPrefix++; - - if (SUCCEEDED(hr)) - { - *pbstrPrefix = SysAllocStringLen(NULL, cchPrefix); - - if (!(*pbstrPrefix)) - hr = E_OUTOFMEMORY; - } - - if (SUCCEEDED(hr)) - { - hr = m_pNSManager->getPrefix(pszUri, 0, *pbstrPrefix, &cchPrefix); - - } - - if (FAILED(hr) && (*pbstrPrefix)) - { - SysFreeString(*pbstrPrefix); - *pbstrPrefix = NULL; - } - } - - // Note: MSXML NSManager returns S_FALSE for an undeclared URI, and E_FAIL for an undeclared - // prefix, hence it is safe to check for both here. - - if (E_FAIL == hr || S_FALSE == hr) - { - // NS manager didn't find the prefix. Tweak the result to S_FALSE - hr = S_FALSE; - } - - if (bNodePushed) - { - m_pNSManager->popContext(); - } - - return hr; -} - -/*++ - -Routine Name: - declarePrefix - -Routine Description: - - This declares a new prefix for a given URI. This routine will always generate a new - prefix definition, regardless of whether the URI is already defined. Use getPrefix - to prevent duplicate definitions of namespace URI prefixes. If the preferred prefix is - already in use or no preferred prefix is supplied the namespace will be declared using - a generated namespace name. - -Arguments: - pContext - The context in which you want to ensure that the prefix is properly declared - in. This is where we check to see if the prefix is already in use. However, if not - in use, the prefix will always be declared in the root of the document. This gaurantees - 2 things: The prefix is declared in the entire document (though it may be overridden - locally in other places), and the prefix has the expected meaning at the passed in pContext. - pszUri - The URI to associate with the prefix. - pszPreferredPrefix - prefix to use if not already defined, can be a BSTR or PCWSTR, either - is acceptable - pbstrNewPrefix - The actual prefix that was declared, which may be different from the - preferred prefix - -Return Value: - HRESULT Completion status code - S_OK - on success - S_FALSE - on failure - ---*/ -HRESULT -OEMPTXMLHandler::declarePrefix( - _In_ IXMLDOMElement *pContext, - _In_ PCWSTR pszUri, - _In_opt_ PCWSTR pszPreferredPrefix, - _Out_ BSTR *pbstrNewPrefix - ) -{ - HRESULT hr = S_OK; - - // These two strings are tied ... the second string is used to print the number over top of a - // copy of the first string, so chances are, if you change one, you need to change the other. - PCWSTR szPrefixChars = L"ns0000"; - PCWSTR szPrefixPrintfPattern = L"ns%.4X"; - - if (!(pContext && pszUri && pbstrNewPrefix)) - { - return E_INVALIDARG; - } - - *pbstrNewPrefix = NULL; - - // Check if the preferred prefix exists... - // - // If we got S_OK, the prefix exists, if we got E_*, bail out - // anyway. Only declare the prefix if we successfully decided - // it doesn't exist. - - if (pszPreferredPrefix) - { - INT unused = 0; - - if (SUCCEEDED(hr)) - { - hr = m_pNSManager->pushNodeContext(pContext, TRUE); - } - - if (SUCCEEDED(hr)) - { -#pragma prefast(suppress:__WARNING_INVALID_PARAM_VALUE_1, "According to MSDN, it is acceptable to pass a NULL buffer to getURI.") - hr = m_pNSManager->getURI(pszPreferredPrefix, NULL, NULL, &unused); - - // If the prefix is already defined, MSXML will return S_FALSE. In that - // case, we don't want to declare another namespace with the same prefix - if (S_FALSE != hr) - { - pszPreferredPrefix = NULL; - } - - hr = m_pNSManager->popContext(); - } - - if (SUCCEEDED(hr) && pszPreferredPrefix) - { - *pbstrNewPrefix = SysAllocStringLen(pszPreferredPrefix, (UINT) wcslen(pszPreferredPrefix)); - } - } - - // If we don't have a workable prefix, try to generate a namespace - // Namespaces are in the form of NSxxxx where the x's are hex digits, - // and there are sizeof(m_nextPrefix)*2 of them - if (SUCCEEDED(hr) && !(*pbstrNewPrefix)) - { - BOOL bFound = TRUE; - UINT cchLength = (UINT) wcslen(szPrefixChars); - *pbstrNewPrefix = SysAllocStringLen(NULL, cchLength); - if (!(*pbstrNewPrefix)) - { - hr = E_OUTOFMEMORY; - } - if (SUCCEEDED(hr)) - { - do - { - INT unused = 0; - - // We're really unlikely to hit this. If we do we probably - // have bigger problems. but put a reasonable cap on the - // generated namespaces anyway. - if (((UINT)m_dwNextIndex) >= (UINT)0xFFFF) - { - // We could reset the counter here, but it's very unlikely to - // help matters, and could end up costing tons of CPU time if - // caller ignored the error or retried. - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - // now fill in the real value. - hr = StringCchPrintf(*pbstrNewPrefix, cchLength+1, szPrefixPrintfPattern, (INT)m_dwNextIndex); - } - - if (SUCCEEDED(hr)) - { - // look up the URI associated with the prefix. -#pragma prefast(suppress:__WARNING_INVALID_PARAM_VALUE_1, "According to MSDN, it is acceptable to pass a NULL buffer to getURI.") - bFound = (S_OK == m_pNSManager->getURI(*pbstrNewPrefix, pContext, NULL, &unused)); - } - - m_dwNextIndex++; - - } while(SUCCEEDED(hr) && bFound); - - if (bFound) - { - SysFreeString(*pbstrNewPrefix); - *pbstrNewPrefix = NULL; - } - } - } - - if (SUCCEEDED(hr) && *pbstrNewPrefix) - { - // We'll always put declarations at the root - if (SUCCEEDED(hr)) - { - // Create the namespace declaration string - UINT cchDeclLength = (UINT)(wcslen(L"xmlns:") + wcslen(*pbstrNewPrefix)); - - BSTR bstrDecl = SysAllocStringLen(NULL, cchDeclLength); - if (!bstrDecl) - { - hr = E_OUTOFMEMORY; - } - - // Add the new declaration to the root of the document. This is important because - // we really don't want to re-declare the namespace at every element. Just starts - // to look really messy, and adds a lot of bloat. - if (SUCCEEDED(hr)) - { - hr = StringCchPrintf(bstrDecl, cchDeclLength+1, L"xmlns:%s", *pbstrNewPrefix); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(m_pRootElement, bstrDecl, L"", pszUri); - } - - SysFreeString(bstrDecl); - bstrDecl = NULL; - - // Explicitly let the namespace manager know about our prefix - - if (SUCCEEDED(hr)) - { - hr = m_pNSManager->declarePrefix(*pbstrNewPrefix, pszUri); - } - } - } - - if (FAILED(hr)) - { - SysFreeString(*pbstrNewPrefix); - *pbstrNewPrefix = NULL; - } - - return hr; -} - -/*++ -Routine Name: - DeleteFeatureNode -Routine Description: - - Deletes given input Feature node and all its children from DOM tree - -Arguments: - - pParent - Parent node of the XML DOM node to be deleted - pElement - XML DOM node to be deleted - -Return Value: - HRESULT Completion status code - S_OK - On Success - E_* - On failure ---*/ -HRESULT -OEMPTXMLHandler::DeleteFeatureNode( - _In_opt_ IXMLDOMNode *pParent, - _In_ IXMLDOMNode *pElement - ) -{ - HRESULT hr = S_OK; - - IXMLDOMNode *pRemovedElement = NULL; - - if (!pElement) - { - return E_INVALIDARG; - } - - // - // if no parent node specified assume root of DOM tree as parent - // - - if (!pParent) - { - pParent = m_pRootElement; - } - - // - // MSXML function removeChild removes the given child of the XML - // element and all its children, even the Attribute nodes defined - // for given element node if any are removed. Hence we do not need - // to worry about recursively removing all the children of the - // given node before removing it - // - - hr = pParent->removeChild(pElement, &pRemovedElement); - - if (pRemovedElement) - { - pRemovedElement->Release(); - } - - return hr ; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.hxx b/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.hxx deleted file mode 100644 index 2767c282..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/PTPCPlPr/src/xmlhandler.hxx +++ /dev/null @@ -1,162 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: xmlhandler.hxx -// -// -// PURPOSE: Helper Class that handles all functionality related to -// processing of input PrintTicket/PrintCapabilities XML document -// -// - -#pragma once - -// -// Print ticket handler class that performs all XML handling for the -// sample code -// - -class OEMPTXMLHandler -{ - -public: - - OEMPTXMLHandler(); - virtual ~OEMPTXMLHandler(); - - HRESULT SetRoot( - _In_ IXMLDOMDocument2 *pRoot, - _In_ IPrintCoreHelper *pHelper - ); - - // - // Node creation methods - // - - HRESULT CreateFeatureNode( - _In_opt_ IXMLDOMElement *pParent, - _In_ PCWSTR pszNamespaceURI, - _In_ PCWSTR pszFeatureName, - _Out_opt_ IXMLDOMElement **ppFeatureNode - ); - - HRESULT CreateOptionNode( - _In_ IXMLDOMElement *pParent, - _In_ PCWSTR pszNamespaceURI, - _In_ PCWSTR pszOptionName, - _Out_opt_ IXMLDOMElement **ppOptionElement - ); - - // - // Get methods - // - - HRESULT GetXMLAttribute( - _In_ IXMLDOMElement *pElement, - _Outptr_result_maybenull_ BSTR *pszAttrNamespaceURI, - _Outptr_result_maybenull_ BSTR *pszAttrName - ) const; - - HRESULT GetFeatureNode( - _In_opt_ IXMLDOMElement *pParent, - _In_ PCWSTR pszAttrNamespaceURI, - _In_ PCWSTR pszAttrName, - _Out_ _When_(return == S_FALSE, _At_(*ppElement, _Post_maybenull_)) - _When_(return != S_FALSE, _At_(*ppElement, _Post_valid_)) - IXMLDOMElement **ppElement - ) const; - - HRESULT GetOptionNode( - _In_ IXMLDOMElement *pParent, - _Outptr_result_maybenull_ IXMLDOMElement **ppElement - ) const; - - HRESULT DeleteFeatureNode( - _In_opt_ IXMLDOMNode *pParent, - _In_ IXMLDOMNode *pElement - ); - -private: - - IXMLDOMDocument2 *m_pRootDocument; - IXMLDOMElement *m_pRootElement; - IMXNamespaceManager *m_pNSManager; - DWORD m_dwNextIndex; - - HRESULT GetXMLElement( - _In_ IXMLDOMElement *pParent, - _In_ PCWSTR pszElementNamespaceURI, - _In_ PCWSTR pszElementName, - _In_ PCWSTR pszAttrNamespaceURI, - _In_ PCWSTR pszAttrName, - _Outptr_result_maybenull_ IXMLDOMElement **ppElement - ) const; - - HRESULT GetXMLElementWithoutAttribute( - _In_ IXMLDOMElement *pContext, - _In_ PCWSTR pszElementNamespaceURI, - _In_ PCWSTR pszElementName, - _Outptr_result_maybenull_ IXMLDOMElement **ppChildElement - ) const; - - HRESULT getPrefix( - _In_ IXMLDOMElement *pContext, - _In_ PCWSTR pszUri, - _Outptr_opt_result_maybenull_ BSTR *pbstrPrefix - ) const; - - HRESULT declarePrefix( - _In_ IXMLDOMElement *pContext, - _In_ LPCWSTR pszUri, - _In_opt_ LPCWSTR pszPreferredPrefix, - _Out_ BSTR *newPrefix - ); - - HRESULT CreateQName( - _In_ IXMLDOMElement *pElement, - _In_ PCWSTR pszUri, - _In_ PCWSTR pszLocalName, - _Out_ BSTR *pQName - ); - - // - // Adds attributes to existing XML element - // - - HRESULT CreateXMLAttribute( - _In_ IXMLDOMElement *pElement, - _In_ PCWSTR pszAttributeName, - _In_ PCWSTR pszNamespaceURI, - _In_ PCWSTR pszAttributeValue - ); - - // - // Creates new XML element node - // - HRESULT CreateXMLElement( - _In_ IXMLDOMElement *pParent, - _In_ PCWSTR pszElementName, - _In_ PCWSTR pszNamespaceURI, - _Out_ IXMLDOMElement **ppCreatedElement - ); - - // - // Helpers - // - HRESULT getLocalName( - _In_ PCWSTR pszQName, - _Out_ BSTR *ppbstrLocalName - ) const; - - HRESULT getUri( - IXMLDOMElement *pContext, - _In_ PCWSTR pszQName, - _Out_ BSTR *pbstrURI - ) const; - -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj deleted file mode 100644 index cf56c5f6..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj +++ /dev/null @@ -1,1066 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8} - $(MSBuildProjectName) - Win10 Debug - Win32 - {A7A17685-16BD-4A90-9E09-A46B09CF3A1F} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - SYNCSET - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;_DEBUG - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - SYNCSET.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj.Filters deleted file mode 100644 index 9737750a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SYNCSET.vcxproj.Filters +++ /dev/null @@ -1,272 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {72226DBB-2FE2-4E91-99A5-A18952A112EB} - - - h;hpp;hxx;hm;inl;inc;xsd - {C3708A9B-9215-44CC-96A2-0C0B656486BF} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {D44A3AF2-69E5-4F32-BC8A-7636FB947722} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - Header Files - - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SyncSet.def b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SyncSet.def deleted file mode 100644 index 68bdffc0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/SyncSet.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY OEMUI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.cpp b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.cpp deleted file mode 100644 index f7a3d842..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.cpp +++ /dev/null @@ -1,405 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.cpp -// -// PURPOSE: Debug functions. -// -// - -#include "precomp.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL DEFINES -//////////////////////////////////////////////////////// - -#define DEBUG_BUFFER_SIZE 1024 -#define PATH_SEPARATOR '\\' -#define MAX_LOOP 10 - -// Determine what level of debugging messages to eject. -#ifdef VERBOSE_MSG - #define DEBUG_LEVEL DBG_VERBOSE -#elif TERSE_MSG - #define DEBUG_LEVEL DBG_TERSE -#elif WARNING_MSG - #define DEBUG_LEVEL DBG_WARNING -#elif ERROR_MSG - #define DEBUG_LEVEL DBG_ERROR -#elif RIP_MSG - #define DEBUG_LEVEL DBG_RIP -#elif NO_DBG_MSG - #define DEBUG_LEVEL DBG_NONE -#else - #define DEBUG_LEVEL DBG_WARNING -#endif - - - -//////////////////////////////////////////////////////// -// EXTERNAL GLOBALS -//////////////////////////////////////////////////////// - -INT giDebugLevel = DEBUG_LEVEL; - - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static BOOL DebugMessageV(LPCSTR lpszMessage, va_list arglist); -static BOOL DebugMessageV(DWORD dwSize, LPCWSTR lpszMessage, va_list arglist); - - - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessageV -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// dwSize Size of temp buffer to hold formated string. -// -// lpszMessage Format string. -// -// arglist Variable argument list.. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -static BOOL DebugMessageV(LPCSTR lpszMessage, va_list arglist) -{ - DWORD dwSize = DEBUG_BUFFER_SIZE; - DWORD dwLoop = 0; - LPSTR lpszMsgBuf = NULL; - HRESULT hr; - - - // Parameter checking. - if( (NULL == lpszMessage) - || - (0 == dwSize) - ) - { - return FALSE; - } - - do - { - // Allocate memory for message buffer. - if(NULL != lpszMsgBuf) - { - delete[] lpszMsgBuf; - dwSize *= 2; - } - lpszMsgBuf = new CHAR[dwSize + 1]; - if(NULL == lpszMsgBuf) - { - return FALSE; - } - - hr = StringCbVPrintfA(lpszMsgBuf, (dwSize + 1) * sizeof(CHAR), lpszMessage, arglist); - - // Pass the variable parameters to wvsprintf to be formated. - } while (FAILED(hr) && (STRSAFE_E_INSUFFICIENT_BUFFER == hr) && (++dwLoop < MAX_LOOP) ); - - // Dump string to Debug output. - OutputDebugStringA(lpszMsgBuf); - - // Cleanup. - delete[] lpszMsgBuf; - - return SUCCEEDED(hr); -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessageV -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// dwSize Size of temp buffer to hold formated string. -// -// lpszMessage Format string. -// -// arglist Variable argument list.. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -static BOOL DebugMessageV(DWORD dwSize, LPCWSTR lpszMessage, va_list arglist) -{ - LPWSTR lpszMsgBuf; - HRESULT hResult; - - - // Parameter checking. - if( (NULL == lpszMessage) - || - (0 == dwSize) - ) - { - return FALSE; - } - - // Allocate memory for message buffer. - lpszMsgBuf = new WCHAR[dwSize + 1]; - if(NULL == lpszMsgBuf) - return FALSE; - - // Pass the variable parameters to wvsprintf to be formated. - hResult = StringCbVPrintfW(lpszMsgBuf, (dwSize + 1) * sizeof(WCHAR), lpszMessage, arglist); - - // Dump string to debug output. - OutputDebugStringW(lpszMsgBuf); - - // Clean up. - delete[] lpszMsgBuf; - - return SUCCEEDED(hResult); -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessage -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// lpszMessage Format string. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCSTR lpszMessage, ...) -{ - BOOL bResult; - va_list VAList; - - - // Pass the variable parameters to DebugMessageV for processing. - va_start(VAList, lpszMessage); - bResult = DebugMessageV(lpszMessage, VAList); - va_end(VAList); - - return bResult; -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessage -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// lpszMessage Format string. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCWSTR lpszMessage, ...) -{ - BOOL bResult; - va_list VAList; - - - // Pass the variable parameters to DebugMessageV to be processed. - va_start(VAList, lpszMessage); - bResult = DebugMessageV(MAX_PATH, lpszMessage, VAList); - va_end(VAList); - - return bResult; -} - -void Dump(PPUBLISHERINFO pPublisherInfo) -{ - VERBOSE(TEXT("pPublisherInfo:\r\n")); - if(NULL == pPublisherInfo) - { - VERBOSE(TEXT("\tpPublisherInfo is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tdwMode = %#x\r\n"), pPublisherInfo->dwMode); - VERBOSE(TEXT("\twMinoutlinePPEM = %d\r\n"), pPublisherInfo->wMinoutlinePPEM); - VERBOSE(TEXT("\twMaxbitmapPPEM = %d\r\n"), pPublisherInfo->wMaxbitmapPPEM); -} - -void Dump(POEMDMPARAM pOemDMParam) -{ - VERBOSE(TEXT("pOemDMParam:\r\n")); - if(NULL == pOemDMParam) - { - VERBOSE(TEXT("\tpOemDMParam is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pOemDMParam->cbSize); - VERBOSE(TEXT("\tpdriverobj = %#x\r\n"), pOemDMParam->pdriverobj); - VERBOSE(TEXT("\thPrinter = %#x\r\n"), pOemDMParam->hPrinter); - VERBOSE(TEXT("\thModule = %#x\r\n"), pOemDMParam->hModule); - VERBOSE(TEXT("\tpPublicDMIn = %#x\r\n"), pOemDMParam->pPublicDMIn); - VERBOSE(TEXT("\tpPublicDMOut = %#x\r\n"), pOemDMParam->pPublicDMOut); - VERBOSE(TEXT("\tpOEMDMIn = %#x\r\n"), pOemDMParam->pOEMDMIn); - VERBOSE(TEXT("\tpOEMDMOut = %#x\r\n"), pOemDMParam->pOEMDMOut); - VERBOSE(TEXT("\tcbBufSize = %d\r\n"), pOemDMParam->cbBufSize); -} - -void Dump(PPROPSHEETUI_INFO pPSUIInfo) -{ - VERBOSE(TEXT("pPSUIInfo:\r\n")); - if(NULL == pPSUIInfo) - { - VERBOSE(TEXT("\tpPSUIInfo is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pPSUIInfo->cbSize); - VERBOSE(TEXT("\tVersion = %#x\r\n"), pPSUIInfo->Version); - VERBOSE(TEXT("\tFlags = %#x\r\n"), pPSUIInfo->Flags); - VERBOSE(TEXT("\tReason = %d\r\n"), pPSUIInfo->Reason); - VERBOSE(TEXT("\thComPropSheet = %#x\r\n"), pPSUIInfo->hComPropSheet); - VERBOSE(TEXT("\tpfnComPropSheet = %#x\r\n"), pPSUIInfo->pfnComPropSheet); - VERBOSE(TEXT("\tlParamInit = %#x\r\n"), pPSUIInfo->lParamInit); - VERBOSE(TEXT("\tUserData = %#x\r\n"), pPSUIInfo->UserData); - VERBOSE(TEXT("\tResult = %#x\r\n"), pPSUIInfo->Result); -} - -void Dump(POPTITEM pOptItem) -{ - VERBOSE(TEXT("pOptItem:\r\n")); - if(NULL == pOptItem) - { - VERBOSE(TEXT("\tpOptItem is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pOptItem->cbSize); - VERBOSE(TEXT("\tLevel = %d\r\n"), pOptItem->Level); - VERBOSE(TEXT("\tDlgPageIdx = %d\r\n"), pOptItem->DlgPageIdx); - VERBOSE(TEXT("\tFlags = 0x%x\r\n"), pOptItem->Flags); - VERBOSE(TEXT("\tUserData = 0x%p\r\n"), pOptItem->UserData); - VERBOSE(TEXT("\tpName = %s\r\n"), pOptItem->pName ? pOptItem->pName : TEXT("")); - VERBOSE(TEXT("\tpSel = 0x%p\r\n"), pOptItem->pSel); - VERBOSE(TEXT("\tpExtChkBox = 0x%p\r\n"), pOptItem->pExtChkBox); - VERBOSE(TEXT("\tpExtChkBox = 0x%p\r\n"), pOptItem->pExtChkBox); - VERBOSE(TEXT("\tHelpIndex = 0x%x\r\n"), pOptItem->HelpIndex); - VERBOSE(TEXT("\tDMPubID = 0x%x\r\n"), pOptItem->DMPubID); - VERBOSE(TEXT("\tUserItemID = 0x%x\r\n"), pOptItem->UserItemID); - VERBOSE(TEXT("\twReserved = 0x%x\r\n"), pOptItem->wReserved); - VERBOSE(TEXT("\tpOIExt = 0x%p\r\n"), pOptItem->pOIExt); - - Dump(pOptItem->pOptType); -} - -void Dump(POPTTYPE pOptType) -{ - VERBOSE(TEXT("\tpOptType:\r\n")); - if(NULL == pOptType) - { - VERBOSE(TEXT("\t\tpOptType is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\t\tcbSize = %d\r\n"), pOptType->cbSize); - VERBOSE(TEXT("\t\tType = 0x%x\r\n"), pOptType->Type); - VERBOSE(TEXT("\t\tFlags = 0x%x\r\n"), pOptType->Flags); - VERBOSE(TEXT("\t\tCount = %d\r\n"), pOptType->Count); - VERBOSE(TEXT("\t\tCount = 0x%x\r\n"), pOptType->BegCtrlID); - VERBOSE(TEXT("\t\tStyle = 0x%x\r\n"), pOptType->Style); - - Dump(pOptType->pOptParam, pOptType->Count); -} - -void Dump(POPTPARAM pOptParam, WORD wCount) -{ - if(NULL == pOptParam) - { - VERBOSE(TEXT("\t\tpOptParam is NULL!\r\n")); - return; - } - - for(WORD wIndex = 0; wIndex < wCount; ++wIndex) - { - VERBOSE(TEXT("\t\tpOptParam[wIndex]:\r\n")); - VERBOSE(TEXT("\t\t\tcbSize = %d\r\n"), pOptParam[wIndex].cbSize); - VERBOSE(TEXT("\t\t\tFlags = 0x%x\r\n"), pOptParam[wIndex].Flags); - VERBOSE(TEXT("\t\t\tStyle = 0x%x\r\n"), pOptParam[wIndex].Style); - VERBOSE(TEXT("\t\t\tpData = 0x%p\r\n"), pOptParam[wIndex].pData); - VERBOSE(TEXT("\t\t\tIconID = 0x%p\r\n"), pOptParam[wIndex].IconID); - VERBOSE(TEXT("\t\t\tlParam = 0x%p\r\n"), pOptParam[wIndex].lParam); - } -} - - -PCSTR -StripDirPrefixA( - IN PCSTR pstrFilename - ) - -/*++ - -Routine Description: - - Strip the directory prefix off a filename (ANSI version) - -Arguments: - - pstrFilename - Pointer to filename string - -Return Value: - - Pointer to the last component of a filename (without directory prefix) - ---*/ - -{ - PCSTR pstr; - - pstr = strrchr(pstrFilename, PATH_SEPARATOR); - if (pstr) - return pstr + 1; - - return pstrFilename; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.h deleted file mode 100644 index b4d57b0b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/debug.h +++ /dev/null @@ -1,166 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. -// -// - -#pragma once - -// VC and Build use different debug defines. -// The following makes it so either will -// cause the inclusion of debugging code. -#if !defined(_DEBUG) && defined(DBG) - #define _DEBUG DBG -#elif defined(_DEBUG) && !defined(DBG) - #define DBG _DEBUG -#endif - - - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// - -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// VERBOSE(msg) -// Display a message if the current debug level is <= DBG_VERBOSE. -// -// TERSE(msg) -// Display a message if the current debug level is <= DBG_TERSE. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// ASSERTMSG(cond, msg) -// Verify a condition is true. If not, display a message and -// force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// These macros require extra parantheses for the msg argument -// example, ASSERTMSG(x > 0, ("x is less than 0\n")); -// WARNING(("App passed NULL pointer, ignoring...\n")); -// - -#define DBG_VERBOSE 1 -#define DBG_TERSE 2 -#define DBG_WARNING 3 -#define DBG_ERROR 4 -#define DBG_RIP 5 -#define DBG_NONE 6 - -#if DBG - - #define DebugMsg DebugMessage - - // - // Strip the directory prefix from a filename (ANSI version) - // - - PCSTR - StripDirPrefixA( - IN PCSTR pstrFilename - ); - - extern INT giDebugLevel; - - - #define DBGMSG(level, prefix, msg) { \ - if (giDebugLevel <= (level)) { \ - DebugMsg("%s %s (%d): ", prefix, StripDirPrefixA(__FILE__), __LINE__); \ - DebugMsg(msg); \ - } \ - } - - #define DBGPRINT(level, msg) { \ - if (giDebugLevel <= (level)) { \ - DebugMsg(msg); \ - } \ - } - - #define VERBOSE if(giDebugLevel <= DBG_VERBOSE) DebugMsg - #define TERSE if(giDebugLevel <= DBG_TERSE) DebugMsg - #define WARNING if(giDebugLevel <= DBG_WARNING) DebugMsg - #define ERR if(giDebugLevel <= DBG_ERROR) DebugMsg - - #define ASSERT(cond) { \ - if (! (cond)) { \ - RIP(("\n")); \ - } \ - } - - #define ASSERTMSG(cond, msg) { \ - if (! (cond)) { \ - RIP(msg); \ - } \ - } - - #define RIP(msg) { \ - DBGMSG(DBG_RIP, "RIP", msg); \ - DebugBreak(); \ - } - - -#else // !DBG - - #define DebugMsg NOP_FUNCTION - - #define VERBOSE NOP_FUNCTION - #define TERSE NOP_FUNCTION - #define WARNING NOP_FUNCTION - #define ERR NOP_FUNCTION - - #define ASSERT(cond) - - #define ASSERTMSG(cond, msg) - #define RIP(msg) - #define DBGMSG(level, prefix, msg) - #define DBGPRINT(level, msg) - -#endif - - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCSTR, ...); -BOOL DebugMessage(LPCWSTR, ...); -void Dump(PPUBLISHERINFO pPublisherInfo); -void Dump(POEMDMPARAM pOemDMParam); -void Dump(PPROPSHEETUI_INFO pPSUIInfo); -void Dump(POPTITEM pOptItem); -void Dump(POPTTYPE pOptType); -void Dump(POPTPARAM pOptParam, WORD wCount); - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.cpp deleted file mode 100644 index 2a19310c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.cpp +++ /dev/null @@ -1,214 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - -#include "precomp.h" -#include "oemui.h" -#include "debug.h" -#include "devmode.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -// -//Performs operation on UI Plugins Private DevMode Members. -//Called via IOemUI::DevMode -// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR(ERRORTEXT("DevMode() ERROR_INVALID_PARAMETER.\r\n")); - VERBOSE(DLLTEXT("\tdwMode = %d, pOemDMParam = %#lx.\r\n"), dwMode, pOemDMParam); - - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - // - //The Method should return the size of the memory allocation needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - // - //Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - // - //OEM_DMEXTRAHEADER Members - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - - // - //Private members - // - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - - VERBOSE(DLLTEXT("pOEMDevOut after setting default values:\r\n")); - Dump(pOEMDevOut); - break; - - // - //The method should convert private DEVMODE members to the current version, if necessary. - // - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - // - //The method should validate the information contained in private DEVMODE members and merge validated values into a private DEVMODE structure containing default values - // - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - Dump(pOemDMParam); - - return S_OK; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut) -{ - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR(ERRORTEXT("ConvertOEMDevmode() invalid parameters.\r\n")); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE(DLLTEXT("Converting private OEM Devmode.\r\n")); - VERBOSE(DLLTEXT("pOEMDevIn:\r\n")); - Dump(pOEMDevIn); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING(DLLTEXT("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n")); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - } - - return TRUE; -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data, if not valid. - if(pOEMDevmode->dwDriverData > 100) - { - pOEMDevmode->dwDriverData = 0; - } - - // Set Advanced driver data, if not valid. - if(pOEMDevmode->dwAdvancedData > 100) - { - pOEMDevmode->dwAdvancedData = 0; - } - - return TRUE; -} - - -void Dump(PCOEMDEV pOEMDevmode) -{ - if( (NULL != pOEMDevmode) - && - (pOEMDevmode->dmOEMExtra.dwSize >= sizeof(OEMDEV)) - && - (OEM_SIGNATURE == pOEMDevmode->dmOEMExtra.dwSignature) - ) - { - VERBOSE(TEXT("\tdmOEMExtra.dwSize = %d\r\n"), pOEMDevmode->dmOEMExtra.dwSize); - VERBOSE(TEXT("\tdmOEMExtra.dwSignature = %#x\r\n"), pOEMDevmode->dmOEMExtra.dwSignature); - VERBOSE(TEXT("\tdmOEMExtra.dwVersion = %#x\r\n"), pOEMDevmode->dmOEMExtra.dwVersion); - VERBOSE(TEXT("\tdwDriverData = %#x\r\n"), pOEMDevmode->dwDriverData); - VERBOSE(TEXT("\tdwAdvancedData = %#x\r\n"), pOEMDevmode->dwAdvancedData); - } - else - { - ERR(ERRORTEXT("Dump(POEMDEV) unknown private OEM DEVMODE.\r\n")); - } -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.h deleted file mode 100644 index e2f9c6b7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/devmode.h +++ /dev/null @@ -1,57 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - - - - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -// -//Can add info to the private devmode bellow here. -//Note : -// This structure must be prefixed by OEM_DMEXTRAHEADER -// Your plug-in must implement the IPrintOemUI::DevMode method -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - DWORD dwDriverData; - DWORD dwAdvancedData; - - // - //Private DevMode Members - // - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); -void Dump(PCOEMDEV pOEMDevIn); - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/dllentry.cpp deleted file mode 100644 index dcac51ef..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/dllentry.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "oemui.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.cpp b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.cpp deleted file mode 100644 index 9e77a228..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.cpp -// -// -// PURPOSE: File that contains all the globals. -// -// -#include "precomp.h" - -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.h deleted file mode 100644 index b6c7d0ee..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/globals.h +++ /dev/null @@ -1,22 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.h -// -// -// PURPOSE: Lists of globals declared in Globals.cpp. -// -// -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -extern HINSTANCE ghInstance; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.cpp deleted file mode 100644 index 493d36f7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.cpp +++ /dev/null @@ -1,612 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.cpp -// -// PURPOSE: UI plug-in implementation. -// -// - -#include "precomp.h" - -#include "oemui.h" -#include "debug.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0 ; // Count of active components -static long g_cServerLocks = 0 ; // Count of locks - - - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI body -// -IOemUI::~IOemUI() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall IOemUI::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE(DLLTEXT("IOemUI:QueryInterface entry.\r\n\r\n")); - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IOemUI:Return pointer to IUnknown.\r\n\r\n")); - } - else if (iid == IID_IPrintOemUI) - { - *ppv = static_cast(this) ; - VERBOSE(DLLTEXT("IOemUI:Return pointer to IPrintOemUI.\r\n")); - } - else - { - *ppv = NULL ; - VERBOSE(DLLTEXT("IOemUI:No Interface. Return NULL.\r\n")); - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemUI::AddRef() -{ - VERBOSE(DLLTEXT("IOemUI:AddRef entry.\r\n")); - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemUI::Release() -{ - VERBOSE(DLLTEXT("IOemUI:Release entry.\r\n")); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// -//(Implamentation is required) Supplies a pointer to UNIDRIVE /PScript IPrintOemDriverUI -// -HRESULT __stdcall IOemUI::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE(DLLTEXT("IOemUI:PublishDriverInterface entry.\r\n")); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (m_pOEMHelp == NULL) - { - HRESULT hResult; - - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUI, (void** ) &(m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - -// -//(Implamentation is required) Returns the UI Plugin's identification information -// -HRESULT __stdcall IOemUI::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IOemUI::GetInfo(%d) entry.\r\r\n"), dwMode); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - WARNING(DLLTEXT("IOemUI::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER\r\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("IOemUI::GetInfo() exit insufficient buffer!\r\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IOemUI::GetInfo() exit mode not supported.\r\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(DLLTEXT("IOemUI::GetInfo() exit S_OK, (*pBuffer is %#x).\r\r\n"), *(PDWORD)pBuffer); - return S_OK; -} - - -// -//Performs operation on UI Plugins Private DevMode Members. -// -HRESULT __stdcall IOemUI::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE(DLLTEXT("IOemUI:DevMode(%d, %#x) entry.\r\n"), dwMode, pOemDMParam); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - - -// -//Allows UI Plugin to Modifiy Existing printer porp sheet and document property sheet page.. -// -HRESULT __stdcall IOemUI::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam) -{ - VERBOSE(DLLTEXT("IOemUI:CommonUIProp entry.\r\n")); - - // - //We want to keep this pointer so the we can modifie the data and OPTITEMS from the OEM plugin page. - // - m_OemSheetData.pOEMCUIParam = pOemCUIPParam; - return hrOEMPropertyPage(dwMode, pOemCUIPParam); -} - - -// -//Adds a New page to the device Documment property sheet. -// - -HRESULT __stdcall IOemUI::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:DocumentPropertySheets entry.\r\n")); - - return hrOEMDocumentPropertySheets(pPSUIInfo, lParam, m_pOEMHelp); -} - -// -//Adds a New page to the device printer property page. -// -HRESULT __stdcall IOemUI::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:DevicePropertySheets entry.\r\n")); - - // - //Store the This pointer in the OEMSHEETDATA - // - m_OemSheetData.pOEMHelp = m_pOEMHelp; - return hrOEMDevicePropertySheets(pPSUIInfo, lParam, &(m_OemSheetData)); -} - - -// -//Allows the UI plugin to spec Customized device capabilaties (TODO) -// -HRESULT __stdcall IOemUI::DeviceCapabilities( - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult) -{ - VERBOSE(DLLTEXT("IOemUI:DeviceCapabilities entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - return E_NOTIMPL; -} - - -// -//Allows the UI plugin to help determine if a print Job is printable. -// -HRESULT __stdcall IOemUI::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM) -{ - VERBOSE(DLLTEXT("IOemUI:DevQueryPrintEx entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - - -// -//Allows the UI Plugin to upgrade its dev options stored in the registry. -// -HRESULT __stdcall IOemUI::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo) -{ - VERBOSE(DLLTEXT("IOemUI:UpgradePrinter entry.\r\n")); - - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:PrinterEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:DriverEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -#define PROFILE_NAME L"OEMPROFILE.icm\0" - -HRESULT __stdcall IOemUI::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData) -{ - HRESULT Result = E_FAIL; - - VERBOSE(DLLTEXT("IOemUI:QueryColorProfile entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - if(QCP_DEVICEPROFILE == ulQueryMode) - { - if(NULL == pvProfileData) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - if(*pcbProfileData < sizeof(PROFILE_NAME)) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - Result = StringCbCopy((LPWSTR)pvProfileData, *pcbProfileData, PROFILE_NAME); - *pcbProfileData = sizeof(PROFILE_NAME); - *pflProfileData = QCP_PROFILEDISK; - - if(FAILED(Result)) - { - SetLastError(Result); - } - } - } - } - - return Result; -}; - -HRESULT __stdcall IOemUI::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:FontInstallerDlgProc entry.\r\n")); - - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI::UpdateExternalFonts( - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges) -{ - VERBOSE(DLLTEXT("IOemUI:UpdateExternalFonts entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this) ; - } - else - { - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - //DbgPrint(DLLTEXT("Class factory:\t\tCreate component.")) ; - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION ; - } - - // Create component. - IOemUI* pOemCB = new IOemUI ; - if (pOemCB == NULL) - { - return E_OUTOFMEMORY ; - } - // Get the requested interface. - HRESULT hr = pOemCB->QueryInterface(iid, ppv) ; - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release() ; - return hr ; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks) ; - } - else - { - InterlockedDecrement(&g_cServerLocks) ; - } - return S_OK ; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:Create class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE ; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF ; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY ; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv) ; - pFontCF->Release() ; - - return hr ; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.h deleted file mode 100644 index 6ec38f73..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/intrface.h +++ /dev/null @@ -1,192 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.h -// -// PURPOSE: UI plug-in definition. -// -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI -// -class IOemUI: public IPrintOemUI -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - IOemUI() - { - m_cRef = 1; - m_pOEMHelp = NULL; - m_OemSheetData.pfnComPropSheet = NULL; - m_OemSheetData.pOEMCUIParam=NULL; - m_OemSheetData.hComPropSheet=INVALID_HANDLE_VALUE; - m_OemSheetData.hmyPlugin=INVALID_HANDLE_VALUE; - }; - - ~IOemUI(); - -protected: - LONG m_cRef; - IPrintOemDriverUI* m_pOEMHelp; - - // - //Used to link common ui in device settings tab and the OEM plugin tab. - // - OEMSHEETDATA m_OemSheetData; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oem.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oem.h deleted file mode 100644 index daad3e27..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oem.h +++ /dev/null @@ -1,24 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: oem.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debug.cpp. -// - -#pragma once - -//////////////////////////////////////////////////////// -// OEM Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.cpp b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.cpp deleted file mode 100644 index 5802a776..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.cpp +++ /dev/null @@ -1,1099 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.cpp -// -// PURPOSE: Main file for OEM UI test module. -// - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - -typedef struct _tagCBUserData -{ - HANDLE hComPropSheet; - HANDLE hPropPage; - POEMUIPSPARAM pOEMUIParam; - PFNCOMPROPSHEET pfnComPropSheet; - -} CBUSERDATA, *PCBUSERDATA; - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); - -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam); -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam); - -void SetOEMUiState (HWND hDlg, POEMSHEETDATA pOEMSheetData); -void SetOEMCommonDataIntoOptItem (POEMSHEETDATA pOEMSheetData, _In_ PSTR PName, LONG Sel); -void ChangeOpItem (IPrintOemDriverUI *pIPrintOEMDrvUI, POEMUIOBJ pOEMObj, POPTITEM pOptItem, int iSel); -POPTITEM FindDrvOptItem (POPTITEM pDrvOptItems, DWORD dwItemCount, _In_ PSTR pKeyWordName, BYTE dmPubID = DMPUB_NONE); - -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems); -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems); -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams); -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource); - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM device or document property UI. -// Called via IOemUI::CommonUIProp -// -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hResult = S_OK; - - - VERBOSE(DLLTEXT("hrOEMPropertyPage(%d) entry.\r\n"), dwMode); - - // Validate parameters. - if( (OEMCUIP_DOCPROP != dwMode) - && - (OEMCUIP_PRNPROP != dwMode) - ) - { - ERR(ERRORTEXT("hrOEMPropertyPage() ERROR_INVALID_PARAMETER.\r\n")); - VERBOSE(DLLTEXT("\tdwMode = %d, pOEMUIParam = %#lx.\r\n"), dwMode, pOEMUIParam); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - hResult = hrDocumentPropertyPage(dwMode, pOEMUIParam); - break; - - case OEMCUIP_PRNPROP: - hResult = hrPrinterPropertyPage(dwMode, pOEMUIParam); - break; - - default: - // Should never reach this! - ERR(ERRORTEXT("hrOEMPropertyPage() Invalid dwMode, %d"), dwMode); - SetLastError(ERROR_INVALID_PARAMETER); - hResult = E_FAIL; - break; - } - - return hResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM document property UI. -// -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM document property UI. - pOEMUIParam->cOEMOptItems = 1; - VERBOSE(DLLTEXT("hrDocumentPropertyPage() requesting %d number of items.\r\n"), pOEMUIParam->cOEMOptItems); - } - else - { - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() fill out %d items.\r\n"), pOEMUIParam->cOEMOptItems); - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMDocUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_ADV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - // - //Setup the Optional Item - // - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - } - - return S_OK; -} - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM printer property UI. -// -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - // - //This is null the first time the interface is called. - // - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM printer property UI. - pOEMUIParam->cOEMOptItems = 1; - VERBOSE(DLLTEXT("hrPrinterPropertyPage() requesting %d number of items.\r\n"), pOEMUIParam->cOEMOptItems); - } - else - { - // - //This is the second time we are called Now setup the optional items. - // - DWORD dwError; - DWORD dwDeviceValue; - DWORD dwType; - DWORD dwNeeded; - - VERBOSE(DLLTEXT("hrPrinterPropertyPage() fill out %d items.\r\n"), pOEMUIParam->cOEMOptItems); - - // - //Add OEM Optitem to the Device - // - - // Get device settings value from printer. - dwError = GetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, &dwType, (PBYTE) &dwDeviceValue, - sizeof(dwDeviceValue), &dwNeeded); - if( (ERROR_SUCCESS != dwError) - || - (dwDeviceValue > 100) - ) - { - // Failed to get the device value or value is invalid, just use the default. - dwDeviceValue = 0; - } - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMPrinterUICallBack; - - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_DEV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = dwDeviceValue; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - // - //Setup the Optional Item - // - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - - - } - return S_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to Document property sheet. Called via IOemUI::DocumentPropertySheets -// -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, - IPrintOemDriverUI* pOEMHelp) -{ - LONG_PTR lResult = 0; - HRESULT hrResult = S_OK; - - VERBOSE(DLLTEXT("hrOEMDocumentPropertySheets() entry.\r\n")); - - UNREFERENCED_PARAMETER(pOEMHelp); - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() ERROR_INVALID_PARAMETER.\r\n")); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - DWORD dwSheets = 0; - PCBUSERDATA pUserData; - POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM) pPSUIInfo->lParamInit; - HANDLE hHeap = pOEMUIParam->hOEMHeap; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - COMPROPSHEETUI Sheet; - - - // Init property page. - memset(&Sheet, 0, sizeof(COMPROPSHEETUI)); - Sheet.cbSize = sizeof(COMPROPSHEETUI); - Sheet.Flags = CPSUIF_UPDATE_PERMISSION; - Sheet.hInstCaller = ghInstance; - Sheet.pCallerName = GetStringResource(hHeap, ghInstance, IDS_NAME); - Sheet.pHelpFile = NULL; - Sheet.pfnCallBack = OEMDocUICallBack2; - Sheet.pDlgPage = CPSUI_PDLGPAGE_TREEVIEWONLY; - Sheet.cOptItem = 1; - Sheet.IconID = IDI_CPSUI_PRINTER; - Sheet.pOptItemName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.CallerVersion = 0x100; - Sheet.OptItemVersion = 0x100; - - // Init user data. - pUserData = (PCBUSERDATA) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(CBUSERDATA)); - if (NULL == pUserData) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to allocate user data.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - pUserData->hComPropSheet = pPSUIInfo->hComPropSheet; - pUserData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - pUserData->pOEMUIParam = pOEMUIParam; - Sheet.UserData = (ULONG_PTR) pUserData; - - // Create OptItems for page. - Sheet.pOptItem = CreateOptItems(hHeap, Sheet.cOptItem); - if (NULL == Sheet.pOptItem) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to allocate OPTITEMs.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Initialize OptItems - Sheet.pOptItem[0].Level = 1; - Sheet.pOptItem[0].Flags = OPTIF_COLLAPSE; - Sheet.pOptItem[0].pName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.pOptItem[0].Sel = pOEMDev->dwDriverData; - - Sheet.pOptItem[0].pOptType = CreateOptType(hHeap, 2); - if (NULL == Sheet.pOptItem[0].pOptType) - { - ERR(ERRORTEXT("hrOEMDocumentPropertySheets() failed to allocate OPTTYPE.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // - //Set the UI prop of this OPTYPE item. - // - Sheet.pOptItem[0].pOptType->Type = TVOT_UDARROW; - Sheet.pOptItem[0].pOptType->pOptParam[1].IconID = 0; - Sheet.pOptItem[0].pOptType->pOptParam[1].lParam = 100; - - // Adds the property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PCOMPROPSHEETUI, - (LPARAM)&Sheet, (LPARAM)&dwSheets); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - -Exit: - - pPSUIInfo->Result = lResult; - return hrResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to printer property sheet. Called via IOemUI::DevicePropertySheets -// -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, POEMSHEETDATA pOemSheetData) -{ - LONG_PTR lResult = 0; - - - VERBOSE(DLLTEXT("hrOEMDevicePropertySheets(%#x, %#x) entry\r\n"), pPSUIInfo, lParam); - - // Validate parameters. - if( (NULL == pPSUIInfo) - - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR(ERRORTEXT("hrOEMDevicePropertySheets() ERROR_INVALID_PARAMETER.\r\n")); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - Dump(pPSUIInfo); - - - // Do action. - switch(pPSUIInfo->Reason) - { - - case PROPSHEETUI_REASON_INIT: - { - PROPSHEETPAGE Page; - - // Init property page. - memset(&Page, 0, sizeof(PROPSHEETPAGE)); - Page.dwSize = sizeof(PROPSHEETPAGE); - Page.dwFlags = PSP_DEFAULT; - Page.hInstance = ghInstance; - Page.pszTemplate = MAKEINTRESOURCE(IDD_DEVICE_PROPPAGE); - Page.pfnDlgProc = DevicePropPageProc; - - // - //This is the OEMPlugIN Sheets Shared Data. Use this Pointer to gain access to shared driver data - // - pOemSheetData->hComPropSheet = pPSUIInfo->hComPropSheet; - pOemSheetData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - Page.lParam = (LPARAM)pOemSheetData; - - // Add property sheets. - pOemSheetData->hmyPlugin = (HANDLE)(pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PROPSHEETPAGE, (LPARAM)&Page, 0)); - - VERBOSE(DLLTEXT("hrOEMDevicePropertySheets() pfnComPropSheet returned %d.\r\n"), pOemSheetData->hmyPlugin); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - - pPSUIInfo->Result = lResult; - return S_OK; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM printer property UI. -// -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - - VERBOSE(DLLTEXT("OEMPrinterUICallBack() entry, Reason is %d.\r\n"), pCallbackParam->Reason); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - { - DWORD dwDriverValue = pOEMUIParam->pOEMOptItems[0].Sel; - - // - // Store OptItems state in printer data. - // - SetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, REG_DWORD, (PBYTE) &dwDriverValue, sizeof(DWORD)); - } - break; - - // - //Because the plugin page is changing items in this CPSUI page we need to rinitalise the data on the page. - // - case CPSUICB_REASON_SETACTIVE: - return CPSUICB_ACTION_OPTIF_CHANGED; - break; - - default: - break; - } - - return lReturn; -} - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Call back for OEM device property UI. -// -// This OEM plugin page is using the OPTITEMS in the Device tab to store data. (Installabale Options) -// If you hide these option in the device tab and only access them from your UI you dont have to worry about sync the views. -// If you want the Options in both tabs you need to have a CPSUICALLBACK function defined for the Device tab. (OEMPrinterUICallBack) -// OEMPrinterUICallBack will return CPSUICB_ACTION_OPTIF_CHANGED; to indicate that some of the controls have change. Resulting in CPSUI to refresh the view. -// -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) -{ - - VERBOSE(DLLTEXT("DevicePropPageProc() entry, Reason is %d.\r\n"), uiMsg); - - POEMSHEETDATA pOEMSheetData = NULL; - LONG lState = 0; - DWORD fDataValid = 0; - WORD dlgControl = 0; - PSTR pControlName = NULL; - - - if ( uiMsg != WM_INITDIALOG ) - { - // - //Retrieves Application data storded by the call to SetWindowLongPtr. - // - pOEMSheetData = (POEMSHEETDATA)GetWindowLongPtr( hDlg, DWLP_USER); - - - if (!pOEMSheetData) - { - // - //Failed to get the OEM Prop Page Data Pointer. - // - ERR(ERRORTEXT("DevicePropPageProc : GetWindowLongPtr Failed (%d)\r\n"), GetLastError()); - return FALSE; - } - } - - switch (uiMsg) - { - case WM_INITDIALOG: - // - //PROPSHEETPAGE structure is passed to the dialog box procedure with a WM_INITDIALOG message. - //The lParam member is provided to allow you to pass application-specific information to the dialog box procedure - // - SetWindowLongPtr (hDlg, DWLP_USER, (LONG_PTR)((LPPROPSHEETPAGE)lParam)->lParam); - break; - - case WM_COMMAND: - switch(HIWORD(wParam)) - { - - case BN_CLICKED: - - // - //Change the UI to activate the apply button Send the prop dailog a change message. - // - PropSheet_Changed(GetParent(hDlg), hDlg); - - switch(LOWORD(wParam)) - { - - // - //USER modified OEM Controls on the plugin page. - // - case IDC_CHECK_DUPLPEX: - dlgControl = IDC_CHECK_DUPLPEX; - fDataValid = TRUE; - pControlName = (PSTR)DUPLEXUNIT; - break; - - case IDC_CHECK_HDRIVE: - dlgControl = IDC_CHECK_HDRIVE; - fDataValid = TRUE; - pControlName = (PSTR)PRINTERHDISK; - break; - - case IDC_CHECK_ENVFEEDER: - dlgControl = IDC_CHECK_ENVFEEDER; - fDataValid = TRUE; - pControlName = (PSTR)ENVFEEDER; - break; - - default: - fDataValid = 0; - break; - - } - - // - //If the Control is valid Get the ctrl state and UPdate the OPTITEM. - // - if ( fDataValid ) - { - lState = (LONG)(SendDlgItemMessage (hDlg, dlgControl, BM_GETSTATE, 0, 0) & 0x0003); - VERBOSE(DLLTEXT("DevicePropPageProc : Clicked dlgControl (%d)\r\n"), lState); - - // - //Saves the Data to the OPTITEMS in the device settings page. - // - SetOEMCommonDataIntoOptItem (pOEMSheetData, pControlName, lState); - } - break; - - - default: - return FALSE; - } - return TRUE; - - // - //Dailog is going to paint set up the UI controls to match the relavent OPTITEMS Data. - // - case WM_CTLCOLORDLG: - { - VERBOSE(DLLTEXT("DevicePropPageProc : WM_CTLCOLORDLG \r\n")); - SetOEMUiState (hDlg, pOEMSheetData); - } - return TRUE; - - - case WM_NOTIFY: - { - switch (((LPNMHDR)lParam)->code) // type of notification message - { - case PSN_SETACTIVE: - return TRUE; - break; - - case PSN_KILLACTIVE: - return TRUE; - break; - - case PSN_APPLY: - - // - //Calls ComPropSheet - //causes the ComPropSheet function to pass a specified result value to all PFNPROPSHEETUI-typed functions associated with a specified page and its parents - // - pOEMSheetData->pfnComPropSheet(pOEMSheetData->hComPropSheet, - CPSFUNC_SET_RESULT, - (LPARAM) pOEMSheetData->hmyPlugin, - (LPARAM)CPSUI_OK); - - // - //Accept the apply if the data was invalid and you are checking for this set PSNRET_INVALID | PSNRET_INVALID_NOCHANGEPAGE - //Disables the APPLY button and saves the Data. - // - PropSheet_UnChanged(GetParent(hDlg), hDlg); - SetWindowLongPtr(hDlg,DWLP_MSGRESULT,PSNRET_NOERROR); - return TRUE; - break; - - // - // Need To undo the changes - // - case PSN_RESET: - break; - } - } - break; - } - - return FALSE; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Update the OEM page controls to match the Device settings page -// - -void SetOEMUiState (HWND hDlg, POEMSHEETDATA pOEMSheetData) -{ - LRESULT lstate = 0; - POEMCUIPPARAM pOEMCUIParam = NULL; - PUSERDATA pUserData = NULL; - POPTITEM pOptItem = NULL; - DWORD cDrvOptItems = 0; - - - if (pOEMSheetData->pOEMCUIParam) - { - pOEMCUIParam = pOEMSheetData->pOEMCUIParam; - cDrvOptItems = pOEMCUIParam->cDrvOptItems; - } - - // - //loop down the OPITEMS and retrieve the data that is needed from the control - //(all Optitesm are ref from DMPubID of the UserData->pKeyWordName) - // - for (DWORD i=0; i < cDrvOptItems; i++) - { - pOptItem = &(pOEMCUIParam->pDrvOptItems[i]); - if (pOptItem->UserData) - { - pUserData = (PUSERDATA)(pOptItem->UserData); - if ( pUserData->pKeyWordName ) - { - // - //Get the Selection of the OPITEM - // - if (pOptItem->Sel) - { - lstate = BST_CHECKED; - } - else - { - lstate = BST_UNCHECKED; - } - - // - //Update the Data in OEM Page to mactch the data in the Device Settings TAB. - //Send a message to the Cntrol to update its State. - // - - //Set the Duplex Option - if ( strcmp(pUserData->pKeyWordName, DUPLEXUNIT ) == 0 ) - { - SendDlgItemMessage (hDlg, IDC_CHECK_DUPLPEX, BM_SETCHECK, lstate, 0); - } - - //Set HardDrive Option - if ( strcmp (pUserData->pKeyWordName, PRINTERHDISK ) == 0 ) - { - SendDlgItemMessage (hDlg, IDC_CHECK_HDRIVE, BM_SETCHECK, lstate, 0); - } - - //Set the Env Feeder Option - if ( strcmp (pUserData->pKeyWordName, ENVFEEDER ) == 0 ) - { - SendDlgItemMessage (hDlg, IDC_CHECK_ENVFEEDER, BM_SETCHECK, lstate, 0); - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Save the OEM change into the correct OPTITEM. -// The UI data is been stored in the driver supplied OPTITEM -// -void SetOEMCommonDataIntoOptItem (POEMSHEETDATA pOEMSheetData, _In_ PSTR PName, LONG Sel) -{ - - VERBOSE(DLLTEXT("SetOEMCommonDataIntoOptItem (%S) \r\n"), PName); - - POEMCUIPPARAM pOEMCUIParam = pOEMSheetData->pOEMCUIParam; - POPTITEM pOptItem = NULL; - - // - //Find the OPTITEM that needs to be Updated. - // - pOptItem = FindDrvOptItem (pOEMCUIParam->pDrvOptItems, - pOEMCUIParam->cDrvOptItems, - PName, - DMPUB_NONE); - - if (pOptItem) - { - ChangeOpItem (pOEMSheetData->pOEMHelp, - pOEMCUIParam->poemuiobj, - pOptItem, - Sel); - } - else - { - ERR(ERRORTEXT("SetOEMCommonDataIntoOptItem Item Not Found OPTITEM(%S) \r\n"), PName); - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Help Change the data set in the OPTITEM -// -void ChangeOpItem (IPrintOemDriverUI *pIPrintOEMDrvUI, POEMUIOBJ pOEMUIObj, POPTITEM pOptItem, int iSel) -{ - HRESULT hRestult = S_OK; - - // - //Change the Item (Change which OPTPARAM is selected fot the required OPTTYPE) - // - pOptItem->Sel = iSel; - - // - //Set the Flag indicating it is changed - // - pOptItem->Flags |= OPTIF_CHANGED; - - // - //Update the Driver UI. (this updates the UI but it does not cause CPSUI to update the its pages), - //Look at OEMPrinterUICallBack to see how CPSUI pages are updated - //The IPrintOemDriverUI::DrvUpdateUISetting method is provided by the - //Unidrv and Pscript5 minidrivers so that user interface plug-ins can - //notify the driver of a modified user interface option. - // - hRestult = pIPrintOEMDrvUI->DrvUpdateUISetting((PVOID)pOEMUIObj, (PVOID)pOptItem, 0, OEMCUIP_PRNPROP); - - if (hRestult != S_OK) - { - ERR(ERRORTEXT("ChangeOpItem DrvUpdateUISetting FAILED \r\n") ); - } - -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Help Find a OPTITEM from the array based on USERDATA->pKeyWordName or DMPubID -// -POPTITEM FindDrvOptItem (POPTITEM pDrvOptItems, DWORD dwItemCount, _In_ PSTR pKeyWordName, BYTE dmPubID ) -{ - VERBOSE(DLLTEXT("FindDrvOptItem Looking (%S) (%d) \r\n"), pKeyWordName, dmPubID); - - POPTITEM pOptItem = NULL; - PUSERDATA pUserData = NULL; - - for (DWORD i=0; i < dwItemCount; i++) - { - // - //OPTITEM has valid data compare these now (Search on DMPubID) - // - if (pKeyWordName == NULL) - { - if (dmPubID == pDrvOptItems[i].DMPubID) - { - pOptItem = &(pDrvOptItems[i]); - break; - } - } - else - { - // - //(Search a printer freature pKeyWordName) - // - //For Common Printer Features the key name is set to a common non localised string - //Note the these are only ansi strings ie PSTR - // - if (pDrvOptItems[i].UserData) - { - pUserData = (PUSERDATA)pDrvOptItems[i].UserData; - if (pUserData->pKeyWordName) - { - // - //OPTITEM has valid data compare these now - // - if ( strcmp (pUserData->pKeyWordName, pKeyWordName) == 0) - { - pOptItem = &(pDrvOptItems[i]); - break; - } - } - } - } - } - - if (!pOptItem) - { - ERR(ERRORTEXT("FindDrvOptItem OPTITEM NOT Found \r\n") ); - } - - return pOptItem; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM document property UI. -// -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("OEMDocUICallBack() entry, Reason is %d.\r\n"), pCallbackParam->Reason); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Store OptItems state in DEVMODE. - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_KILLACTIVE: - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - // - //Refress the Data in the view and tell CPUSI that the data has changed by ret CPSUICB_ACTION_OPTIF_CHANGED - // - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pOEMUIParam->pOEMOptItems[0].Sel) != pOEMDev->dwAdvancedData) - { - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - pOEMUIParam->pOEMOptItems[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData; - POEMDEV pOEMDev = (POEMDEV) pUserData->pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("OEMDocUICallBack2() entry, Reason is %d.\r\n"), pCallbackParam->Reason); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - pUserData->pfnComPropSheet(pUserData->hComPropSheet, CPSFUNC_SET_RESULT, - (LPARAM)pUserData->hPropPage, - (LPARAM)CPSUI_OK); - break; - - case CPSUICB_REASON_KILLACTIVE: - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pCallbackParam->pOptItem[0].Sel) != pOEMDev->dwDriverData) - { - pCallbackParam->pOptItem[0].Sel = pOEMDev->dwDriverData; - pCallbackParam->pOptItem[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Creates and Initializes OptItems. -// -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems) -{ - POPTITEM pOptItems = NULL; - SIZE_T sizeOfOptItems = 0; - - // Compute the size of memory needed for the OptItems: - if (SUCCEEDED(SIZETMult(sizeof(OPTITEM), (SIZE_T)dwOptItems, &sizeOfOptItems))) - { - // Allocate memory for OptItems; - pOptItems = (POPTITEM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeOfOptItems); - if(NULL != pOptItems) - { - InitOptItems(pOptItems, dwOptItems); - } - else - { - ERR(ERRORTEXT("CreateOptItems() failed to allocate memory for OPTITEMs!\r\n")); - } - } - else - { - ERR(ERRORTEXT("CreateOptItems() failed to compute necessary memory size for OPTITEMs!\r\n")); - } - - return pOptItems; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems. -// -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems) -{ - VERBOSE(DLLTEXT("InitOptItems() entry.\r\n")); - - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for(DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OptType for OptItem. -// -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams) -{ - POPTTYPE pOptType = NULL; - - - VERBOSE(DLLTEXT("CreateOptType() entry.\r\n")); - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - if(NULL != pOptType) - { - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, wOptParams * sizeof(OPTPARAM)); - if(NULL != pOptType->pOptParam) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - ERR(ERRORTEXT("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n")); - - // Free allocated memory and return NULL. - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR(ERRORTEXT("CreateOptType() failed to allocated memory for OPTTYPE!\r\n")); - } - - return pOptType; -} - -//////////////////////////////////////////////////////////////////////////////////// -// -// Retrieves pointer to a String resource. -// -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource) -{ - int nResult; - DWORD dwSize = MAX_PATH; - PTSTR pszString = NULL; - - - VERBOSE(DLLTEXT("GetStringResource(%#x, %#x, %d) entered.\r\n"), hHeap, hModule, uResource); - - // Allocate buffer for string resource from heap; let the driver clean it up. - pszString = (PTSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(TCHAR)); - if(NULL != pszString) - { - // Load string resource; resize after loading so as not to waste memory. - nResult = LoadString((HMODULE)hModule, uResource, pszString, dwSize); - if(nResult > 0) - { - PTSTR pszTemp; - - - VERBOSE(DLLTEXT("LoadString() returned %d!\r\n"), nResult); - VERBOSE(DLLTEXT("String load was \"%s\".\r\n"), pszString); - - pszTemp = (PTSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszString, (nResult + 1) * sizeof(TCHAR)); - if(NULL != pszTemp) - { - pszString = pszTemp; - } - else - { - ERR(ERRORTEXT("GetStringResource() HeapReAlloc() of string retrieved failed! (Last Error was %d)\r\n"), GetLastError()); - } - } - else - { - ERR(ERRORTEXT("LoadString() returned %d! (Last Error was %d)\r\n"), nResult, GetLastError()); - ERR(ERRORTEXT("GetStringResource() failed to load string resource %d!\r\n"), uResource); - - pszString = NULL; - } - } - else - { - ERR(ERRORTEXT("GetStringResource() failed to allocate string buffer!\r\n")); - } - - return pszString; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.h deleted file mode 100644 index 1c07802f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.h +++ /dev/null @@ -1,74 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for OEMUI Test Module. -// -// -#pragma once - -#include "OEM.H" -#include "DEVMODE.H" -#include "globals.h" - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - - -// OEM Signature and version. -#define PROP_TITLE L"OEM UI Page" -#define DLLTEXT(s) __TEXT("UI: ") __TEXT(s) - -// OEM UI Misc defines. -#define ERRORTEXT(s) __TEXT("ERROR ") DLLTEXT(s) - - -// Printer registry keys where OEM data is stored. -#define OEMUI_VALUE TEXT("OEMUI_VALUE") -#define OEMUI_DEVICE_VALUE TEXT("OEMUI_DEVICE_VALUE") - -// -//KeyWordNames for OPTITEMS (These are nonlocalised keywords assocaited with driver features. in the OPTITEMS) -// -const char DUPLEXUNIT[] = "DuplexUnit"; -const char ENVFEEDER[] = "EnvFeeder"; -const char PRINTERHDISK[] = "PrinterHardDisk"; - -// -//This structure is used to link the common pages and the OEM plugin page. -// -typedef struct _OEMSHEETDATA { - - // - //Any other OEM Data you may want to store. - // - - - // - //Hold Pointers you may need. - // - HANDLE hComPropSheet; //Handle to the Prop Sheet Parent Page Used when calling ComPropSheet - HANDLE hmyPlugin; //Handle to the OEM Plugin page. Page Used when calling ComPropSheet - PFNCOMPROPSHEET pfnComPropSheet; //Is the Pointer to ComPropSheet This is needed when APPLY is clicked (CPSFUNC_SET_RESULT) - - POEMCUIPPARAM pOEMCUIParam; //Holds links to the DEVMODE and OPTITEMS needed. - IPrintOemDriverUI* pOEMHelp; - -} OEMSHEETDATA, *POEMSHEETDATA; - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, IPrintOemDriverUI* pOEMHelp); -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, POEMSHEETDATA pOemSheetData); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.rc b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.rc deleted file mode 100644 index e87badbe..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/oemui.rc +++ /dev/null @@ -1,175 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "OEM UI Test Module." - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "OEMUI" - VALUE "LegalCopyright", "Copyright © 1998 - 2003 Microsoft Corp." - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "OEMUI.dll" - VALUE "ProductName", "Microsoft OEMUI" - VALUE "ProductVersion", "1.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DEVICE_PROPPAGE DIALOG 0, 0, 179, 113 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Device Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - GROUPBOX "Oem Install Options",IDC_STATIC,15,29,81,59 - LTEXT "OEM UI Controls",IDC_STATIC,55,14,68,11,WS_TABSTOP - CONTROL "Duplex Unit",IDC_CHECK_DUPLPEX,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,42,54,10 - CONTROL "Printer Hard Drive",IDC_CHECK_HDRIVE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,20,67,75,10 - CONTROL "Envelope Feeder",IDC_CHECK_ENVFEEDER,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,20,54,71,10 -END - -IDD_DOC_PROPPAGE DIALOG 0, 0, 210, 154 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Document Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Document Property Page",IDC_STATIC,60,73,108,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DEVICE_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 170 - TOPMARGIN, 8 - BOTTOMMARGIN, 106 - END - - IDD_DOC_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_SECTION "OEM UI Added Item" - IDS_CALIBRATED "Printer has been calibrated." - IDS_NAME "OEM UI Customization DLL" - IDS_DEV_SECTION "Device Settings OEM UI Added Item" - IDS_ADV_SECTION "Advanced OEM UI Added Item" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precomp.h deleted file mode 100644 index 2d502998..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precomp.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// -// PURPOSE: Header files that should be in the precompiled header. -// -// - -#pragma once - - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Safe integer functions to detect integer overflow/underflow conditions: -#include - -// Include this last to disallow -// unsafe string functions -#include - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/resource.h deleted file mode 100644 index aacf0218..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/SyncSet/resource.h +++ /dev/null @@ -1,28 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by oemui.rc -// -#define IDS_SECTION 1 -#define IDS_CALIBRATED 2 -#define IDS_NAME 3 -#define IDS_HELPFILE 4 -#define IDS_DEV_SECTION 5 -#define IDS_ADV_SECTION 10 -#define IDD_DEVICE_PROPPAGE 106 -#define IDD_DOC_PROPPAGE 107 -#define IDC_CALIBRATE 1001 -#define IDC_RADIO3 1004 -#define IDC_CHECK_DUPLPEX 1008 -#define IDC_CHECK_HDRIVE 1009 -#define IDC_CHECK_ENVFEEDER 1010 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1011 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/OEMUI.rc b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/OEMUI.rc deleted file mode 100644 index a6491905..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/OEMUI.rc +++ /dev/null @@ -1,169 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "OEM UI Test Module." - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "OEMUI" - VALUE "LegalCopyright", "Copyright © 1998 - 2003 Microsoft Corp." - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "OEMUI.dll" - VALUE "ProductName", "Microsoft OEMUI" - VALUE "ProductVersion", "1.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DEVICE_PROPPAGE DIALOG 0, 0, 179, 113 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Device Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Added Page",IDC_STATIC,55,14,68,11 - PUSHBUTTON "Calibrate",IDC_CALIBRATE,61,34,50,14 -END - -IDD_DOC_PROPPAGE DIALOG 0, 0, 210, 154 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Document Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Document Property Page",IDC_STATIC,60,73,108,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DEVICE_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 172 - TOPMARGIN, 8 - BOTTOMMARGIN, 106 - END - - IDD_DOC_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_SECTION "OEM UI Added Item" - IDS_CALIBRATED "Printer has been calibrated." - IDS_NAME "OEM UI Customization DLL" - IDS_DEV_SECTION "Device Settings OEM UI Added Item" - IDS_ADV_SECTION "Advanced OEM UI Added Item" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUI.Manifest b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUI.Manifest deleted file mode 100644 index bb48af65..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUI.Manifest +++ /dev/null @@ -1,22 +0,0 @@ - - - -Your app description here - - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj deleted file mode 100644 index 4abfd7bb..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj +++ /dev/null @@ -1,1120 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {EA206DEA-26E6-4FD4-BF68-23F222C5E211} - $(MSBuildProjectName) - Win10 Debug - Win32 - {7ABB810D-F51B-46DA-8A6C-6883AF316932} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - ThemeUISmpl - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - - %(AdditionalOptions) -ignore:4049,4217 - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE;ISOLATION_AWARE_ENABLED - %(PreprocessorDefinitions);MANIFEST_RESOURCE=2 - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ThemeUISmpl.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj.Filters deleted file mode 100644 index d8206354..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/ThemeUISmpl.vcxproj.Filters +++ /dev/null @@ -1,327 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {18CF118F-704E-4B55-9621-B0D2F73CBFBE} - - - h;hpp;hxx;hm;inl;inc;xsd - {44047F2E-3DA5-4847-BAE3-6573B04506AF} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {695ECF76-7AFF-4B2D-A4E5-2138B4CC5B5A} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.cpp deleted file mode 100644 index 15234361..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - - -#include "precomp.h" -#include "oemui.h" -#include "debug.h" -#include "devmode.h" - - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// -//Performs operation on UI Plugins Private DevMode Members. -//Called via IOemUI::DevMode -// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR(DLLTEXT("DevMode() ERROR_INVALID_PARAMETER.\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - // - //The Method should return the size of the memory allocation needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - // - //Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - // - //OEM_DMEXTRAHEADER Members - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - - // - //Private members - // - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - - VERBOSE(DLLTEXT("pOEMDevOut after setting default values:\r\n")); - break; - - // - //The method should convert private DEVMODE members to the current version, if necessary. - // - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - // - //The method should validate the information contained in private DEVMODE members and merge validated values into a private DEVMODE structure containing default values - // - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return S_OK; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut) -{ - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR(DLLTEXT("ConvertOEMDevmode() invalid parameters.\r\n")); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE(DLLTEXT("Converting private OEM Devmode.\r\n")); - VERBOSE(DLLTEXT("pOEMDevIn:\r\n")); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING(DLLTEXT("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n")); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - } - - return TRUE; -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data, if not valid. - if(pOEMDevmode->dwDriverData > 100) - { - pOEMDevmode->dwDriverData = 0; - } - - // Set Advanced driver data, if not valid. - if(pOEMDevmode->dwAdvancedData > 100) - { - pOEMDevmode->dwAdvancedData = 0; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.h deleted file mode 100644 index b55fb016..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/devmode.h +++ /dev/null @@ -1,55 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - - - - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -// -//Can add info to the private devmode bellow here. -//Note : -// This structure must be prefixed by OEM_DMEXTRAHEADER -// Your plug-in must implement the IPrintOemUI::DevMode method -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - DWORD dwDriverData; - DWORD dwAdvancedData; - - // - //Private DevMode Members - // - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/dllentry.cpp deleted file mode 100644 index a7c846b7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/dllentry.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "oemui.h" -#include "fusutils.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - - // Store the module handle in case we need it later. - ghInstance = hInst; - - // NOTE: We don't create an Activation Context on module load, - // but on need of an Avtivation Context; the first time - // GetMyActivationContext() or CreateMyActivationContext() is called. - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - - // Release the Activation Context if we created one somewhere - // by calling GetMyActivationContext() or CreateMyActivationContext(); - if(INVALID_HANDLE_VALUE != ghActCtx) - { - ReleaseActCtx(ghActCtx); - ghActCtx = INVALID_HANDLE_VALUE; - } - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.cpp b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.cpp deleted file mode 100644 index 0f9bf2c3..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: fsutils.h -// -// -// PURPOSE: Fusion utilities -// - -#include "precomp.h" -#include "globals.h" -#include "fusutils.h" - -#define MAX_LOOP 10 - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -HANDLE GetMyActivationContext() -{ - // Make sure we've created our activation context. - CreateMyActivationContext(); - - // Return the global. - return ghActCtx; -} - - -BOOL CreateMyActivationContext() -{ - if(INVALID_HANDLE_VALUE != ghActCtx) - { - return TRUE; - } - - ghActCtx = CreateActivationContextFromResource(ghInstance, MAKEINTRESOURCE(MANIFEST_RESOURCE)); - - return (INVALID_HANDLE_VALUE != ghActCtx); -} - - - -HANDLE CreateActivationContextFromResource(HMODULE hModule, LPCTSTR pszResourceName) -{ - DWORD dwSize = MAX_PATH; - DWORD dwUsed = 0; - DWORD dwLoop; - PTSTR pszModuleName = NULL; - ACTCTX act; - HANDLE hActCtx = INVALID_HANDLE_VALUE; - - - // Get the name for the module that contains the manifest resource - // to create the Activation Context from. - dwLoop = 0; - do - { - // May need to allocate or re-alloc buffer for module name. - if(NULL != pszModuleName) - { - // Need to re-alloc bigger buffer. - - // First, delete old buffer. - delete[] pszModuleName; - - // Second, increase buffer alloc size. - dwSize <<= 1; - } - pszModuleName = new TCHAR[dwSize]; - if(NULL == pszModuleName) - { - goto Exit; - } - - // Try to get the module name. - dwUsed = GetModuleFileName(hModule, pszModuleName, dwSize); - - // Check to see if it failed. - if(0 == dwUsed) - { - goto Exit; - } - - // If dwUsed is equla to dwSize or larger, - // the buffer passed in wasn't big enough. - } while ( (dwUsed >= dwSize) && (++dwLoop < MAX_LOOP) ); - - // Now let's try to create an activation context - // from manifest resource. - ::ZeroMemory(&act, sizeof(act)); - act.cbSize = sizeof(act); - act.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID; - act.lpResourceName = pszResourceName; - act.lpSource = pszModuleName; - - hActCtx = CreateActCtx(&act); - - -Exit: - - // - // Clean up. - // - - if(NULL != pszModuleName) - { - delete[] pszModuleName; - } - - return hActCtx; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.h deleted file mode 100644 index 2f79c522..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/fusutils.h +++ /dev/null @@ -1,18 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: fsutils.h -// -// -// PURPOSE: Fusion utilities -// -#pragma once - -HANDLE GetMyActivationContext(); -BOOL CreateMyActivationContext(); -HANDLE CreateActivationContextFromResource(HMODULE hModule, LPCTSTR pszResourceName); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.cpp b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.cpp deleted file mode 100644 index d2af1b8b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.cpp -// -// -// PURPOSE: File that contains all the globals. -// - -#include "precomp.h" -#include "globals.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; - -// Module's Activation Context from DLLEntry of process. -HANDLE ghActCtx = INVALID_HANDLE_VALUE; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.h deleted file mode 100644 index a5a58cb8..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/globals.h +++ /dev/null @@ -1,21 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.h -// -// -// PURPOSE: Lists of globals declared in Globals.cpp. -// -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -extern HINSTANCE ghInstance; // Module's Instance handle from DLLEntry of process. -extern HANDLE ghActCtx; // Module's Activation Context from DLLEntry of process. - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.cpp deleted file mode 100644 index 3b966a58..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.cpp +++ /dev/null @@ -1,575 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Implementation of interface for PScript4, PScript5, Unidrv4, -// Unidrv5 UI plug-ins. -// - -#include "precomp.h" - -#include "oemui.h" -#include "debug.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0 ; // Count of active components -static long g_cServerLocks = 0 ; // Count of locks - - - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI body -// -IOemUI::~IOemUI() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall IOemUI::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE(DLLTEXT("IOemUI:QueryInterface entry.\r\n\r\n")); - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IOemUI:Return pointer to IUnknown.\r\n\r\n")); - } - else if (iid == IID_IPrintOemUI) - { - *ppv = static_cast(this) ; - VERBOSE(DLLTEXT("IOemUI:Return pointer to IPrintOemUI.\r\n")); - } - else - { - VERBOSE(DLLTEXT("IOemUI::QueryInterface interface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemUI::AddRef() -{ - VERBOSE(DLLTEXT("IOemUI:AddRef entry.\r\n")); - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemUI::Release() -{ - VERBOSE(DLLTEXT("IOemUI:Release entry.\r\n")); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -HRESULT __stdcall IOemUI::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE(DLLTEXT("IOemUI:PublishDriverInterface entry.\r\n")); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (m_pOEMHelp == NULL) - { - HRESULT hResult; - - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUI, (void** ) &(m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - -HRESULT __stdcall IOemUI::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IOemUI::GetInfo entry.\r\r\n")); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - WARNING(DLLTEXT("IOemUI::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER\r\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("IOemUI::GetInfo() exit insufficient buffer!\r\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IOemUI::GetInfo() exit mode not supported.\r\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(DLLTEXT("IOemUI::GetInfo() exit S_OK.\r\r\n")); - return S_OK; -} - -HRESULT __stdcall IOemUI::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE(DLLTEXT("IOemUI:DevMode entry.\r\n")); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IOemUI::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam) -{ - VERBOSE(DLLTEXT("IOemUI:CommonUIProp entry.\r\n")); - - return hrOEMPropertyPage(dwMode, pOemCUIPParam); -} - - -HRESULT __stdcall IOemUI::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:DocumentPropertySheets entry.\r\n")); - - return hrOEMDocumentPropertySheets(pPSUIInfo, lParam, m_pOEMHelp); -} - -HRESULT __stdcall IOemUI::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:DevicePropertySheets entry.\r\n")); - - return hrOEMDevicePropertySheets(pPSUIInfo, lParam); -} - -HRESULT __stdcall IOemUI::DeviceCapabilities( - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult) -{ - VERBOSE(DLLTEXT("IOemUI:DeviceCapabilities entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM) -{ - VERBOSE(DLLTEXT("IOemUI:DevQueryPrintEx entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo) -{ - VERBOSE(DLLTEXT("IOemUI:UpgradePrinter entry.\r\n")); - - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:PrinterEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:DriverEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -#define PROFILE_NAME L"OEMPROFILE.icm\0" - -HRESULT __stdcall IOemUI::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData) -{ - HRESULT Result = E_FAIL; - - - VERBOSE(DLLTEXT("IOemUI:QueryColorProfile entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - if(QCP_DEVICEPROFILE == ulQueryMode) - { - if(NULL == pvProfileData) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - if(*pcbProfileData < sizeof(PROFILE_NAME)) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - Result = StringCbCopy((LPWSTR)pvProfileData, *pcbProfileData, PROFILE_NAME); - *pcbProfileData = sizeof(PROFILE_NAME); - *pflProfileData = QCP_PROFILEDISK; - - if(FAILED(Result)) - { - SetLastError(Result); - } - } - } - } - - return Result; -}; - -HRESULT __stdcall IOemUI::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IOemUI:FontInstallerDlgProc entry.\r\n")); - - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI::UpdateExternalFonts( - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges) -{ - VERBOSE(DLLTEXT("IOemUI:UpdateExternalFonts entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this) ; - } - else - { - WARNING(DLLTEXT("IOemCF::QueryInterface interface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - //DbgPrint(DLLTEXT("Class factory:\t\tCreate component.")) ; - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION ; - } - - // Create component. - IOemUI* pOemCB = new IOemUI ; - if (pOemCB == NULL) - { - return E_OUTOFMEMORY ; - } - // Get the requested interface. - HRESULT hr = pOemCB->QueryInterface(iid, ppv) ; - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release() ; - return hr ; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks) ; - } - else - { - InterlockedDecrement(&g_cServerLocks) ; - } - return S_OK ; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:Create class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE ; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF ; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY ; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv) ; - pFontCF->Release() ; - - return hr ; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.h deleted file mode 100644 index d9bdf3a2..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/intrface.h +++ /dev/null @@ -1,179 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.h -// -// -// PURPOSE: Header of interface for PScript5 and Unidrv5 UI plug-in. -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI -// -class IOemUI: public IPrintOemUI -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - - IOemUI() { m_cRef = 1; m_pOEMHelp = NULL; }; - ~IOemUI(); - -protected: - LONG m_cRef; - IPrintOemDriverUI* m_pOEMHelp; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oem.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oem.h deleted file mode 100644 index bf3d75f9..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oem.h +++ /dev/null @@ -1,22 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: oem.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debug.cpp. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.cpp b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.cpp deleted file mode 100644 index 61f3d378..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.cpp +++ /dev/null @@ -1,756 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.cpp -// -// -// PURPOSE: Main file for OEM UI test module. -// -// - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "fusutils.h" -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - -typedef struct _tagCBUserData -{ - HANDLE hComPropSheet; - HANDLE hPropPage; - POEMUIPSPARAM pOEMUIParam; - PFNCOMPROPSHEET pfnComPropSheet; - -} CBUSERDATA, *PCBUSERDATA; - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam); -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam); -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems); -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems); -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams); -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource); - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM device or document property UI. -// -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hResult = S_OK; - - - VERBOSE(DLLTEXT("hrOEMPropertyPage entry.\r\n")); - - // Validate parameters. - if( (OEMCUIP_DOCPROP != dwMode) - && - (OEMCUIP_PRNPROP != dwMode) - ) - { - ERR(DLLTEXT("hrOEMPropertyPage() ERROR_INVALID_PARAMETER.\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - hResult = hrDocumentPropertyPage(dwMode, pOEMUIParam); - break; - - case OEMCUIP_PRNPROP: - hResult = hrPrinterPropertyPage(dwMode, pOEMUIParam); - break; - - default: - // Should never reach this! - ERR(DLLTEXT("hrOEMPropertyPage() Invalid dwMode")); - SetLastError(ERROR_INVALID_PARAMETER); - hResult = E_FAIL; - break; - } - - return hResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM document property UI. -// -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM document property UI. - pOEMUIParam->cOEMOptItems = 1; - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() requesting items.\r\n")); - } - else - { - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() fill out items.\r\n")); - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMDocUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_ADV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - } - - return S_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM printer property UI. -// -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM printer property UI. - pOEMUIParam->cOEMOptItems = 1; - - VERBOSE(DLLTEXT("hrPrinterPropertyPage() requesting items.\r\n")); - } - else - { - DWORD dwError; - DWORD dwDeviceValue; - DWORD dwType; - DWORD dwNeeded; - - - VERBOSE(DLLTEXT("hrPrinterPropertyPage() fill out items.\r\n")); - - // Get device settings value from printer. - dwError = GetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, &dwType, (PBYTE) &dwDeviceValue, - sizeof(dwDeviceValue), &dwNeeded); - if( (ERROR_SUCCESS != dwError) - || - (dwDeviceValue > 100) - ) - { - // Failed to get the device value or value is invalid, just use the default. - dwDeviceValue = 0; - } - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMPrinterUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_DEV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = dwDeviceValue; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - } - - return S_OK; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to Document property sheet. -// -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, - IPrintOemDriverUI* pOEMHelp) -{ - LONG_PTR lResult = 0; - HRESULT hrResult = S_OK; - - VERBOSE(DLLTEXT("hrOEMDocumentPropertySheets() entry.\r\n")); - - UNREFERENCED_PARAMETER(pOEMHelp); - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR(DLLTEXT("hrOEMDocumentPropertySheets() ERROR_INVALID_PARAMETER.\r\n")); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - DWORD dwSheets = 0; - PCBUSERDATA pUserData; - POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM) pPSUIInfo->lParamInit; - HANDLE hHeap = pOEMUIParam->hOEMHeap; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - COMPROPSHEETUI Sheet; - - - // Init property page. - memset(&Sheet, 0, sizeof(COMPROPSHEETUI)); - Sheet.cbSize = sizeof(COMPROPSHEETUI); - Sheet.Flags = CPSUIF_UPDATE_PERMISSION; - Sheet.hInstCaller = ghInstance; - Sheet.pCallerName = GetStringResource(hHeap, ghInstance, IDS_NAME); - Sheet.pHelpFile = NULL; - Sheet.pfnCallBack = OEMDocUICallBack2; - Sheet.pDlgPage = CPSUI_PDLGPAGE_TREEVIEWONLY; - Sheet.cOptItem = 1; - Sheet.IconID = IDI_CPSUI_PRINTER; - Sheet.pOptItemName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.CallerVersion = 0x100; - Sheet.OptItemVersion = 0x100; - - // Init user data. - pUserData = (PCBUSERDATA) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(CBUSERDATA)); - if (NULL == pUserData) - { - ERR(DLLTEXT("hrOEMDocumentPropertySheets() failed to allocate user data.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - pUserData->hComPropSheet = pPSUIInfo->hComPropSheet; - pUserData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - pUserData->pOEMUIParam = pOEMUIParam; - Sheet.UserData = (ULONG_PTR) pUserData; - - // Create OptItems for page. - Sheet.pOptItem = CreateOptItems(hHeap, Sheet.cOptItem); - if (NULL == Sheet.pOptItem) - { - ERR(DLLTEXT("hrOEMDocumentPropertySheets() failed to allocate OPTITEMs.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Initialize OptItems - Sheet.pOptItem[0].Level = 1; - Sheet.pOptItem[0].Flags = OPTIF_COLLAPSE; - Sheet.pOptItem[0].pName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.pOptItem[0].Sel = pOEMDev->dwDriverData; - - Sheet.pOptItem[0].pOptType = CreateOptType(hHeap, 2); - if (NULL == Sheet.pOptItem[0].pOptType) - { - ERR(DLLTEXT("hrOEMDocumentPropertySheets() failed to allocate OPTTYPE.\r\n")); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - Sheet.pOptItem[0].pOptType->Type = TVOT_UDARROW; - Sheet.pOptItem[0].pOptType->pOptParam[1].IconID = 0; - Sheet.pOptItem[0].pOptType->pOptParam[1].lParam = 100; - - // NOTE: Don't need to do anything with Activation Contexts - // to get Themed UI, since Compstui will create this - // page using it's Activation Context which specifies - // comctl v6. - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PCOMPROPSHEETUI, - (LPARAM)&Sheet, (LPARAM)&dwSheets); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - -Exit: - - pPSUIInfo->Result = lResult; - return hrResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to printer property sheet. -// -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam) -{ - LONG_PTR lResult = 0; - - - VERBOSE(DLLTEXT("hrOEMDevicePropertySheets entry\r\n")); - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR(DLLTEXT("hrOEMDevicePropertySheets() ERROR_INVALID_PARAMETER.\r\n")); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - PROPSHEETPAGE Page; - - // Init property page. - memset(&Page, 0, sizeof(PROPSHEETPAGE)); - Page.dwSize = sizeof(PROPSHEETPAGE); - Page.dwFlags = PSP_DEFAULT; - Page.hInstance = ghInstance; - Page.pszTemplate = MAKEINTRESOURCE(IDD_DEVICE_PROPPAGE); - Page.pfnDlgProc = DevicePropPageProc; - Page.hActCtx = GetMyActivationContext(); - - // Set the flag to indicate that our PROPSHEETPAGE - // has an Activation Context. - // The Activation Context indicates with version of - // comctl for Compstui to create our PROPSHEETPAGE - // with. To get Themed UI we need to specify comctl v6. - if( (NULL != Page.hActCtx) && (INVALID_HANDLE_VALUE != Page.hActCtx)) - { - Page.dwFlags |= PSP_USEFUSIONCONTEXT; - } - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PROPSHEETPAGE, (LPARAM)&Page, 0); - - // NOTE: The Activation Context is released when the DLL is unloaded - // during DLL_PROCESS_DETACH. - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - - pPSUIInfo->Result = lResult; - return S_OK; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM printer property UI. -// -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - - VERBOSE(DLLTEXT("OEMPrinterUICallBack() entry.\r\n")); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - { - DWORD dwDriverValue = pOEMUIParam->pOEMOptItems[0].Sel; - - // Store OptItems state in printer data. - SetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, REG_DWORD, (PBYTE) &dwDriverValue, sizeof(DWORD)); - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Call back for OEM device property UI. -// -#pragma warning(push) -#pragma warning(disable:6262) // this method exceeds the default threshold for stack usage by a few bytes. -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uiMsg) - { - case WM_COMMAND: - switch(HIWORD(wParam)) - { - case BN_CLICKED: - switch(LOWORD(wParam)) - { - case IDC_CALIBRATE: - // Just display a message that the printer is calibrated, - // since we don't acutally calibrate anything. - { - TCHAR szName[MAX_PATH]; - TCHAR szCalibrated[MAX_PATH]; - - - LoadString(ghInstance, IDS_NAME, szName, sizeof(szName)/sizeof(szName[0])); - LoadString(ghInstance, IDS_CALIBRATED, szCalibrated, sizeof(szCalibrated)/sizeof(szCalibrated[0])); - MessageBox(hDlg, szCalibrated, szName, MB_OK); - } - break; - } - break; - - default: - return FALSE; - } - return TRUE; - - case WM_NOTIFY: - { - switch (((LPNMHDR)lParam)->code) // type of notification message - { - case PSN_SETACTIVE: - break; - - case PSN_KILLACTIVE: - break; - - case PSN_APPLY: - break; - - case PSN_RESET: - break; - } - } - break; - } - - return FALSE; -} -#pragma warning(pop) - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM document property UI. -// -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - VERBOSE(DLLTEXT("OEMDocUICallBack() entry.\r\n")); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Store OptItems state in DEVMODE. - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_KILLACTIVE: - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pOEMUIParam->pOEMOptItems[0].Sel) != pOEMDev->dwAdvancedData) - { - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - pOEMUIParam->pOEMOptItems[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData; - POEMDEV pOEMDev = (POEMDEV) pUserData->pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("OEMDocUICallBack2() entry.\r\n")); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - pUserData->pfnComPropSheet(pUserData->hComPropSheet, CPSFUNC_SET_RESULT, - (LPARAM)pUserData->hPropPage, - (LPARAM)CPSUI_OK); - break; - - case CPSUICB_REASON_KILLACTIVE: - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pCallbackParam->pOptItem[0].Sel) != pOEMDev->dwDriverData) - { - pCallbackParam->pOptItem[0].Sel = pOEMDev->dwDriverData; - pCallbackParam->pOptItem[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Creates and Initializes OptItems. -// -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems) -{ - POPTITEM pOptItems = NULL; - SIZE_T sizeOfOptItems = 0; - - // Compute the size of memory needed for the OptItems: - if (SUCCEEDED(SIZETMult(sizeof(OPTITEM), (SIZE_T)dwOptItems, &sizeOfOptItems))) - { - // Allocate memory for OptItems; - pOptItems = (POPTITEM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeOfOptItems); - if(NULL != pOptItems) - { - InitOptItems(pOptItems, dwOptItems); - } - else - { - ERR(DLLTEXT("CreateOptItems() failed to allocate memory for OPTITEMs!\r\n")); - } - } - else - { - ERR(DLLTEXT("CreateOptItems() failed to compute necessary memory size for OPTITEMs!\r\n")); - } - - return pOptItems; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems. -// -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems) -{ - VERBOSE(DLLTEXT("InitOptItems() entry.\r\n")); - - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for(DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OptType for OptItem. -// -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams) -{ - POPTTYPE pOptType = NULL; - - - VERBOSE(DLLTEXT("CreateOptType() entry.\r\n")); - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - if(NULL != pOptType) - { - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, wOptParams * sizeof(OPTPARAM)); - if(NULL != pOptType->pOptParam) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - ERR(DLLTEXT("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n")); - - // Free allocated memory and return NULL. - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR(DLLTEXT("CreateOptType() failed to allocated memory for OPTTYPE!\r\n")); - } - - return pOptType; -} - -//////////////////////////////////////////////////////////////////////////////////// -// -// Retrieves pointer to a String resource. -// -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource) -{ - int nResult; - DWORD dwSize = MAX_PATH; - PTSTR pszString = NULL; - - - VERBOSE(DLLTEXT("GetStringResource entered.\r\n")); - - // Allocate buffer for string resource from heap; let the driver clean it up. - pszString = (PTSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(TCHAR)); - if(NULL != pszString) - { - // Load string resource; resize after loading so as not to waste memory. - nResult = LoadString((HMODULE)hModule, uResource, pszString, dwSize); - if(nResult > 0) - { - PTSTR pszTemp; - - pszTemp = (PTSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszString, (nResult + 1) * sizeof(TCHAR)); - if(NULL != pszTemp) - { - pszString = pszTemp; - } - else - { - ERR(DLLTEXT("GetStringResource() HeapReAlloc() of string retrieved failed!\r\n")); - } - } - else - { - ERR(DLLTEXT("GetStringResource() failed to load string resource!\r\n")); - - pszString = NULL; - } - } - else - { - ERR(DLLTEXT("GetStringResource() failed to allocate string buffer!\r\n")); - } - - return pszString; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.h deleted file mode 100644 index 0f392cc5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/oemui.h +++ /dev/null @@ -1,45 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for OEMUI Test Module. -// - -#pragma once - -#include "OEM.H" -#include "DEVMODE.H" -#include "globals.h" - - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - - -// OEM Signature and version. -#define PROP_TITLE L"OEM UI Page" -#define DLLTEXT(s) "ThemeUI: " s - - -// Printer registry keys where OEM data is stored. -#define OEMUI_VALUE TEXT("OEMUI_VALUE") -#define OEMUI_DEVICE_VALUE TEXT("OEMUI_DEVICE_VALUE") - - - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, IPrintOemDriverUI* pOEMHelp); -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precomp.h deleted file mode 100644 index 0607fe55..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precomp.h +++ /dev/null @@ -1,61 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.H -// -// -// PURPOSE: Common headers that don't change often -// - -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - -// Isolation define for using ComCtrl v6. -#ifndef ISOLATION_AWARE_ENABLED - #define ISOLATION_AWARE_ENABLED -#endif - - -// Required header files that shouldn't change often. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "COMPSTUI.H" -#include -#include -#include -#include -#include - -// Safe character string functions to detect buffer overrun conditions: -#include - -// Safe integer functions to detect integer overflow/underflow conditions: -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/resource.h deleted file mode 100644 index 71d3d3d6..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/resource.h +++ /dev/null @@ -1,24 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by OEMUI.rc -// -#define IDS_SECTION 1 -#define IDS_CALIBRATED 2 -#define IDS_NAME 3 -#define IDS_DEV_SECTION 4 -#define IDS_DEVICE_SECTION 4 -#define IDS_ADV_SECTION 10 -#define IDD_DEVICE_PROPPAGE 106 -#define IDD_DOC_PROPPAGE 107 -#define IDC_CALIBRATE 1001 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1002 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/themeuismpl.def b/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/themeuismpl.def deleted file mode 100644 index 8e60b60d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/ThemeUI/themeuismpl.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY ThemeUISmpl -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/WMarkPS.ini b/print/OEM Printer Customization Plug-in Samples/C++/WMarkPS.ini deleted file mode 100644 index 11176160..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/WMarkPS.ini +++ /dev/null @@ -1,4 +0,0 @@ -[OEMFiles] -OEMConfigFile1=WMARKUI.DLL -OEMDriverFile1=WMARKPS.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/WMarkUni.ini b/print/OEM Printer Customization Plug-in Samples/C++/WMarkUni.ini deleted file mode 100644 index 4ae540c4..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/WMarkUni.ini +++ /dev/null @@ -1,5 +0,0 @@ -[OEMFiles] -OEMConfigFile1=WMARKUNIUI.DLL -OEMDriverFile1=WMARKUNI.DLL - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap.gpd b/print/OEM Printer Customization Plug-in Samples/C++/bitmap.gpd deleted file mode 100644 index 467e3e21..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap.gpd +++ /dev/null @@ -1,509 +0,0 @@ -*GPDFileName: "bitmap.gpd" -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*ModelName: "Bitmap Driver" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 -*PrintRate: 16 -*PrintRateUnit: PPM -*PrintRatePPM: 16 - -*%****************************************************************************************** -*% Orientation -*%****************************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *Cmd: "" - } - } -} - -*%****************************************************************************************** -*% Input Bin -*%****************************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: AUTO - *Option: AUTO - { - *rcNameID: =AUTO_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "" - } - } - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "" - } - } -} - -*%****************************************************************************************** -*% Resolution -*%****************************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: Option2 - *Option: Option1 - { - *Name: "600 x 600" =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "" } - *Command: CmdEndRaster { *Cmd : "" } - *Command: CmdSendBlockData { *Cmd : "" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "" - } - } - *Option: Option2 - { - *Name: "300 x 300" =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "" } - *Command: CmdEndRaster { *Cmd : "" } - *Command: CmdSendBlockData { *Cmd : "" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "" - } - } - *Option: Option3 - { - *Name: "150 x 150" =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(150, 150) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "" } - *Command: CmdEndRaster { *Cmd : "" } - *Command: CmdSendBlockData { *Cmd : "" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "" - } - } -} - -*%****************************************************************************************** -*% Paper Size -*%****************************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(288, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(204, 13824) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - } - } - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "" - } - } - } - } -} - -*%****************************************************************************************** -*% Media Type -*%****************************************************************************************** -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: PLAIN - *Option: PLAIN - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "" - } - } -} - -*%****************************************************************************************** -*% Color Mode -*%****************************************************************************************** -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *DefaultOption: 8bpp - *Option: Mono - { - *rcNameID: =MONO_DISPLAY - *DevNumOfPlanes: 0 - *DevBPP: 0 - *IPCallbackID: 1 - *Color?: FALSE - } - *Option: Color - { - *rcNameID: =COLOR_DISPLAY - *DevNumOfPlanes: 0 - *DevBPP: 0 - *DrvBPP: 4 - *IPCallbackID: 2 - *PaletteSize: 8 - *PaletteProgrammable?: TRUE - *Command: CmdEnableDRC { *Cmd: "" } - *Command: CmdDefinePaletteEntry { *Cmd : "" } - *Command: CmdSelectPaletteEntry { *Cmd : "" } - *Command: CmdSetSrcBmpWidth { *Cmd : "" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "" - } - } - *Option: 8bpp - { - *rcNameID: =8BPP_DISPLAY - *DevNumOfPlanes: 0 - *DevBPP: 0 - *DrvBPP: 8 - *IPCallbackID: 3 - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdEnableDRC { *Cmd : "" } - *Command: CmdDefinePaletteEntry { *Cmd : "" } - *Command: CmdSelectPaletteEntry { *Cmd : "" } - *Command: CmdSetSrcBmpWidth { *Cmd : "" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "" - } - } - *Option: 24bpp - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 0 - *DevBPP: 0 - *DrvBPP: 24 - *IPCallbackID: 5 - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdEnableDRC { *Cmd : "" } - *Command: CmdDefinePaletteEntry { *Cmd : "" } - *Command: CmdSelectPaletteEntry { *Cmd : "" } - *Command: CmdSetSrcBmpWidth { *Cmd : "" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "" - } - } -} - -*%****************************************************************************************** -*% HalfTone -*%****************************************************************************************** -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%****************************************************************************************** -*% Duplex Unit -*%****************************************************************************************** -*Feature: DuplexUnit -{ - *rcNameID: 429 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *rcNameID: 444 - *DisabledFeatures: LIST(Duplex.VERTICAL, Duplex.HORIZONTAL) - } - *Option: TRUE - { - *rcNameID: 443 - } -} - -*%****************************************************************************************** -*% Duplex Type -*%****************************************************************************************** -*Feature: Duplex -{ - *rcNameID: =TWO_SIDED_PRINTING_DISPLAY - *DefaultOption: NONE - *Option: NONE - { - *rcNameID: =NONE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "" - } - } - *Option: VERTICAL - { - *rcNameID: =FLIP_ON_LONG_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "" - } - } - *Option: HORIZONTAL - { - *rcNameID: =FLIP_ON_SHORT_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "" - } - } -} - -*%****************************************************************************************** -*% Doc setup commands -*%****************************************************************************************** -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.7 - *Cmd: "" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.13 - *Cmd: "" -} - -*%****************************************************************************************** -*% Cursor and Page Commands -*%****************************************************************************************** -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT, RASTER, VECTOR) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*EjectPageWithFF?: TRUE -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*Command: CmdCR { *Cmd : "" } -*Command: CmdLF { *Cmd : "" } -*Command: CmdFF { *Cmd : "" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap.inf b/print/OEM Printer Customization Plug-in Samples/C++/bitmap.inf deleted file mode 100644 index 5d01b260..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/bitmap.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap.ini b/print/OEM Printer Customization Plug-in Samples/C++/bitmap.ini deleted file mode 100644 index 2388914c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap.ini +++ /dev/null @@ -1,5 +0,0 @@ -[OEMFiles] -OEMDriverFile1=BITMAP.DLL - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.def b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.def deleted file mode 100644 index 1a4df55f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.def +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY bitmap -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.h b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.h deleted file mode 100644 index ee068c02..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.h +++ /dev/null @@ -1,81 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: BITMAP.H -// -// -// PURPOSE: Define the COemPDEV class which stores the private -// PDEV for the driver. -// - - -#pragma once - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -#define RGB_BLACK RGB(0, 0, 0) -#define RGB_WHITE RGB(255, 255, 255) - -class COemPDEV -{ -public: - COemPDEV(void) : - m_pfnDrvEndDoc(NULL), - pBufStart(NULL), - dwBufSize(0), - cPalColors(0), - hpalDefault(), - prgbq(NULL), - cbHeaderOffBits(0), - bHeadersFilled(FALSE), - bColorTable(FALSE) - { - memset(&bmFileHeader, 0, sizeof(bmFileHeader)); - memset(&bmInfoHeader, 0, sizeof(bmInfoHeader)); - } - - virtual ~COemPDEV(void) - { - } - - void InitializeDDITable(DRVENABLEDATA* pded) - { - UINT iDrvFn; - UINT cDrvFn = pded->c; - PDRVFN pDrvFn = pded->pdrvfn; - - for (iDrvFn = 0; iDrvFn < cDrvFn; ++iDrvFn, ++pDrvFn) - { - if (pDrvFn->iFunc == INDEX_DrvEndDoc) - { - m_pfnDrvEndDoc = (PFN_DrvEndDoc)(pDrvFn->pfn); - } - } - } - -public: - - PFN_DrvEndDoc m_pfnDrvEndDoc; // Unidrv function to call back into from the DDI hook - PBYTE pBufStart; // Pointer to start of buffer to hold the bitmap data - DWORD dwBufSize; // Buffer size - BITMAPFILEHEADER bmFileHeader; // BitmapFileHeader for each dump - BITMAPINFOHEADER bmInfoHeader; // BitmapInfoHeader for each dump - int cPalColors; // Count of colors in palette. - HPALETTE hpalDefault; // Default palette to pass to GDI. - _Field_size_(cPalColors) RGBQUAD * prgbq; // Color table - INT cbHeaderOffBits; // Offset to bits in the file - BOOL bHeadersFilled; // Flag to indicate if the header stuff has been filled - BOOL bColorTable; // Flag to indicate if color table needs to be dumped - -}; - -typedef COemPDEV* POEMPDEV; - -BOOL bGrowBuffer(POEMPDEV, DWORD); // Function to enlarge the buffer for holding the bitmap data -VOID vFreeBuffer(POEMPDEV); // Function to free the buffer for holding the bitmap data -BOOL bFillColorTable(POEMPDEV); // Function to fill the color table for the bitmap data diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.rc b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.rc deleted file mode 100644 index 737bba96..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.rc +++ /dev/null @@ -1,110 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by DDK Support Team\0" - VALUE "CompanyName", "Microsoft Corp.\0" - VALUE "FileDescription", "Bitmap Driver Sample\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "BITMAP\0" - VALUE "LegalCopyright", "Copyright © 1998-2003\0" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0" - VALUE "OriginalFilename", "BITMAP.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Microsoft Bitmap Driver Sample\0" - VALUE "ProductVersion", "1.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj deleted file mode 100644 index d530f136..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj +++ /dev/null @@ -1,1090 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {EDCCC34A-50DF-4894-B7B9-FC156F899947} - $(MSBuildProjectName) - Win10 Debug - Win32 - {64A7662C-5E32-41A7-939B-B51114210693} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - bitmap - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;gdi32.lib;umpdddi.lib;ole32.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - bitmap.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj.Filters deleted file mode 100644 index a78a5c8a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/bitmap.vcxproj.Filters +++ /dev/null @@ -1,174 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {5A882741-1FD2-4D80-ACC9-DCFE8F90AD24} - - - h;hpp;hxx;hm;inl;inc;xsd - {A14D506D-8B56-426A-80B4-0CA6D7A24A0B} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {A8C3D9A5-36FC-4F1B-A9A6-605F3BD79ED7} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/ddihook.cpp b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/ddihook.cpp deleted file mode 100644 index 17984513..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/ddihook.cpp +++ /dev/null @@ -1,114 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: DDIHook.cpp -// -// -// PURPOSE: Implementation of DDI Hook OEMEndDoc. This function -// dumps the buffered bitmap data out. -// - - -#include "precomp.h" -#include "bitmap.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// -// Function prototype is defined in printoem.h -// -BOOL APIENTRY -OEMEndDoc( - SURFOBJ *pso, - FLONG fl - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvEndDoc. - - DrvEndDoc is called by GDI when it has finished - sending a document to the driver for rendering. - - Please refer to DDK documentation for more details. - - This particular implementation of OEMEndDoc performs - the following operations: - - Dump the bitmap file header - - Dump the bitmap info header - - Dump the color table if one exists - - Dump the buffered bitmap data - - Free the memory for the data buffers - -Arguments: - - pso - Defines the surface object - flags - A set of flag bits - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - DWORD dwWritten; - INT cScans; - - if (pOemPDEV->pBufStart) - { - // Fill BitmapFileHeader - // - DWORD dwTotalBytes = pOemPDEV->cbHeaderOffBits + pOemPDEV->bmInfoHeader.biSizeImage; // File size - - pOemPDEV->bmFileHeader.bfType = 0x4d42; // Signature = 'BM' - pOemPDEV->bmFileHeader.bfSize = dwTotalBytes; // Bytes in whole file. - pOemPDEV->bmFileHeader.bfReserved1 = 0; - pOemPDEV->bmFileHeader.bfReserved2 = 0; - pOemPDEV->bmFileHeader.bfOffBits = pOemPDEV->cbHeaderOffBits; // Offset to bits in file. - - if (pOemPDEV->bColorTable) - pOemPDEV->bmFileHeader.bfOffBits += pOemPDEV->cPalColors * sizeof(ULONG); - - // Num of scanlines - // - cScans = pOemPDEV->bmInfoHeader.biHeight; - - // Flip the biHeight member so that it denotes top-down bitmap - // - pOemPDEV->bmInfoHeader.biHeight = cScans * -1; - - // Dump headers first - // - dwWritten = pDevObj->pDrvProcs->DrvWriteSpoolBuf(pDevObj, (void*)&(pOemPDEV->bmFileHeader), sizeof(BITMAPFILEHEADER)); - dwWritten = pDevObj->pDrvProcs->DrvWriteSpoolBuf(pDevObj, (void*)&(pOemPDEV->bmInfoHeader), sizeof(BITMAPINFOHEADER)); - if (pOemPDEV->bColorTable) - { - dwWritten = pDevObj->pDrvProcs->DrvWriteSpoolBuf(pDevObj, pOemPDEV->prgbq, pOemPDEV->cPalColors * sizeof(ULONG)); - LocalFree(pOemPDEV->prgbq); - } - - // Dump the data now - // - dwWritten = pDevObj->pDrvProcs->DrvWriteSpoolBuf(pDevObj, pOemPDEV->pBufStart, pOemPDEV->bmInfoHeader.biSizeImage); - - // Free memory for the data buffers - // - vFreeBuffer(pOemPDEV); - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvEndDoc)(pso, fl); -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.cpp deleted file mode 100644 index 7845d5c1..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// -// PURPOSE: Helper functions for manipulating the DEVMODE. These are commonly -// shared by UI & rendering modules -// - - -#include "precomp.h" -#include "bitmap.h" -#include "debug.h" -#include "devmode.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -BOOL bConvertOEMDevmode( - PCOEMDEV pOEMDevIn, - POEMDEV pOEMDevOut - ) - -/*++ - -Routine Description: - - Converts private DEVMODE members to the - current version. - -Arguments: - - pOEMDevIn - pointer to OEM private devmode - pOEMDevOut - pointer to OEM private devmode - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR("ConvertOEMDevmode() invalid parameters.\r\n"); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - } - - return TRUE; -} - - -BOOL bMakeOEMDevmodeValid( - POEMDEV pOEMDevmode - ) - -/*++ - -Routine Description: - - Ensures that private OEM devmode members are valid. - -Arguments: - - pOEMDevmode - pointer to OEM private devmode - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data. - pOEMDevmode->dwDriverData = 0; - - return TRUE; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.h deleted file mode 100644 index 5f62454f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/devmode.h +++ /dev/null @@ -1,37 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// - -#pragma once - -//////////////////////////////////////////////////////// -// OEM Private Devmode Definition -//////////////////////////////////////////////////////// - -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - BOOL dwDriverData; -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL bConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL bMakeOEMDevmodeValid(POEMDEV pOEMDevmode); - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/dllentry.cpp deleted file mode 100644 index 4483a741..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/dllentry.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// -// PURPOSE: Source module for DLL entry function(s). -// - - -#include "precomp.h" -#include "bitmap.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// - -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - break; - - case DLL_THREAD_ATTACH: - break; - - case DLL_PROCESS_DETACH: - break; - - case DLL_THREAD_DETACH: - break; - } - - return TRUE; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.cpp deleted file mode 100644 index dcfdcd6f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.cpp +++ /dev/null @@ -1,2048 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Interface for User Mode COM Customization DLL. -// - - -#include "precomp.h" - -#include "debug.h" -#include "devmode.h" -#include "bitmap.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// ================================================================== -// Internal Globals -// -static long g_cComponents; // Count of active components -static long g_cServerLocks; // Count of locks -// -// ================================================================== - -// ================================================================== -// The purpose of this array is to inform UNIDRV of the callbacks -// that are implemented in this driver. -// -// Note that there is *NO* order dependency in this array. New -// index values and their corresponding callbacks can be placed -// anywhere within the list as needed. -// -static const DRVFN s_aOemHookFuncs[] = -{ - {INDEX_DrvEndDoc, (PFN)OEMEndDoc} -}; - - -//////////////////////////////////////////////////////////////////////////////// -// -// COemUni2 body -// -COemUni2::COemUni2() -{ - m_cRef = 1; - - // Increment COM component count. - InterlockedIncrement(&g_cComponents); - - m_pOEMHelp = NULL; - -} - -COemUni2::~COemUni2() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall -COemUni2:: -QueryInterface( - const IID& iid, - void** ppv - ) -{ - - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - } - else if (iid == IID_IPrintOemUni2) - { - *ppv = static_cast(this); - } - else - { - WARNING("COemUni2::QueryInterface NULL. Returning E_NOINTERFACE.\r\n"); - - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall -COemUni2:: -AddRef( - VOID - ) -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -COemUni2:: -Release( - VOID - ) -{ - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (cRef == 0) - { - delete this; - return 0; - } - return cRef; -} - -HRESULT __stdcall -COemUni2:: -CommandCallback( - PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::CommandCallback - - The IPrintOemUni::CommandCallback method is used - to provide dynamically generated printer commands - for Unidrv-supported printers. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - dwCallbackID - value representing the printer command's - *CallbackID attribute in the printer's generic printer - description (GPD) file. - dwCount - value representing the number of elements - in the array pointed to by pdwParams. Can be 0. - pdwParams - pointer to an array of DWORD-sized parameters - containing values specified by the printer commands - *Params attribute in the printer's GPD file. Can be NULL. - piResult - Receives a method-supplied result value. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pdwParams); - - *piResult = 0; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -Compression( - PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::Compression - - The IPrintOemUni::Compression method can be used - with Unidrv-supported printers to provide a customized - bitmap compression method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pInBuf - pointer to input scan line data. - pOutBuf - pointer to an output buffer to receive - compressed scan line data. - dwInLen - length of the input data. - dwOutLen - length of the output buffer. - piResult - Receives a method-supplied result value. If the - operation succeeds, this value should be the number - of compressed bytes, which must not be larger than - the value received for dwOutLen. If an error occurs, - or if the method cannot compress, the result value - should be -1. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pInBuf); - UNREFERENCED_PARAMETER(pOutBuf); - UNREFERENCED_PARAMETER(dwInLen); - UNREFERENCED_PARAMETER(dwOutLen); - UNREFERENCED_PARAMETER(piResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DevMode - - The IPrintOemUni::DevMode method, provided by - rendering plug-ins for Unidrv, performs operations - on private DEVMODE members. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DevMode method. - - The IPrintOemUni::DevMode method, provided by - rendering plug-ins for Unidrv, performs operations - on private DEVMODE members. When both UI and rendering - plug-ins are present in a driver, this functionality - should be factored out to be common to both modules, and - provide the same behavior. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - caller-supplied constant. Refer to the docs - for more information. - pOemDMParam - pointer to an OEMDMPARAM structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - )) - { - ERR("DevMode() ERROR_INVALID_PARAMETER.\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devmode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - case OEMDM_DEFAULT: - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - break; - - case OEMDM_CONVERT: - bConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - case OEMDM_MERGE: - bConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - bMakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -DisableDriver( - VOID - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DisableDriver - - The IPrintOemUni::DisableDriver method allows - a rendering plug-in for Unidrv to free resources - that were allocated by the plug-in's - IPrintOemUni::EnableDriver method. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DisableDriver method. - - The IPrintOemUni::DisableDriver method allows a rendering - plug-in for Unidrv to free resources that were allocated by the - plug-in's IPrintOemUni::EnableDriver method. This is the last - IPrintOemUni interface method that is called before the rendering - plug-in is unloaded. - - Please refer to DDK documentation for more details. - -Arguments: - - VOID - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - // Release reference to Printer Driver's interface. - // - if (this->m_pOEMHelp) - { - this->m_pOEMHelp->Release(); - this->m_pOEMHelp = NULL; - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -DisablePDEV( - PDEVOBJ pdevobj - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DisablePDEV - - The IPrintOemUni::DisablePDEV method allows a rendering - plug-in for Unidrv to delete the private PDEV structure that - was allocated by its IPrintOemUni::EnablePDEV method. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DisablePDEV method. - - The IPrintOemUni::DisablePDEV method performs the same types of - operations as the DrvDisablePDEV function. Its purpose is to allow a - rendering plug-in to delete the private PDEV structure that is pointed - to by the DEVOBJ structure's pdevOEM member. This PDEV structure - is one that was allocated by the plug-in's IPrintOemUni::EnablePDEV method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - // Release our COemPDEV instance created by the call to - // EnablePDEV. - // - POEMPDEV pOemPDEV = (POEMPDEV)pdevobj->pdevOEM; - delete pOemPDEV; - pOemPDEV = NULL; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -DownloadCharGlyph( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DownloadCharGlyph - - The IPrintOemUni::DownloadCharGlyph method enables a - rendering plug-in for Unidrv to send a character glyph for - a specified soft font to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - hGlyph - glyph handle. - pdwWidth - pointer to receive the method-supplied width of the character. - pdwResult - Receives a method-supplied value representing the amount - of printer memory, in bytes, required to store the character glyph. - If the operation fails, the returned value should be zero. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(hGlyph); - UNREFERENCED_PARAMETER(pdwWidth); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DownloadFontHeader( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DownloadFontHeader - - The IPrintOemUni::DownloadFontHeader method allows a - rendering plug-in for Unidrv to send a font's header - information to a printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pdwResult - Receives a method-supplied value representing the amount - of printer memory, in bytes, required to store the font header - information. If the operation fails, the returned value should be zero. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DriverDMS( - PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DriverDMS - - The IPrintOemUni::DriverDMS method allows a rendering - plug-in for Unidrv to indicate that it uses a device-managed - drawing surface instead of the default GDI-managed surface. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DriverDMS method. - - Please refer to DDK documentation for more details. For general info - on device managed surfaces and how to handle them, please refer to - the section titled "Handling Device-Managed Surfaces". - -Arguments: - - pDevObj - pointer to a DEVOBJ structure. - pBuffer - pointer to a buffer to receive method-specified flags. - cbSize - size, in bytes, of the buffer pointed to by pBuffer. - pcbNeeded - pointer to a location to receive the required - minimum pBuffer size. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pDevObj); - UNREFERENCED_PARAMETER(pBuffer); - UNREFERENCED_PARAMETER(cbSize); - UNREFERENCED_PARAMETER(pcbNeeded); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -EnableDriver( - DWORD dwDriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::EnableDriver - - The IPrintOemUni::EnableDriver method allows a rendering - plug-in for Unidrv to hook out some graphics DDI functions. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::EnableDriver method. - - The IPrintOemUni::EnableDriver method allows a rendering - plug-in to perform the same types of operations as the - DrvEnableDriver function. Like the DrvEnableDriver function, - the IPrintOemUni::EnableDriver method is responsible for - providing addresses of internally supported graphics DDI functions, - or DDI hook functions. - - The method should fill the supplied DRVENABLEDATA structure - and allocate an array of DRVFN structures. It should fill the - array with pointers to hooking functions, along with winddi.h-defined - index values that identify the hooked out graphics DDI functions. - - Please refer to DDK documentation for more details. - -Arguments: - - DriverVersion - interface version number. This value is - defined by PRINTER_OEMINTF_VERSION, in printoem.h. - cbSize - size, in bytes, of the structure pointed to by pded. - pded - pointer to a DRVENABLEDATA structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - UNREFERENCED_PARAMETER(dwDriverVersion); - UNREFERENCED_PARAMETER(cbSize); - - // We need to return the DDI functions that have been hooked - // in pded. Here we fill out the fields in pded. - // - pded->iDriverVersion = PRINTER_OEMINTF_VERSION; - pded->c = _countof(s_aOemHookFuncs); - pded->pdrvfn = (DRVFN *) s_aOemHookFuncs; - - // Even if nothing is done, need to return S_OK so - // that DisableDriver() will be called, which releases - // the reference to the Printer Driver's interface. - // - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -EnablePDEV( - PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::EnablePDEV - - The IPrintOemUni::EnablePDEV method allows a rendering - plug-in for Unidrv to create its own PDEV structure. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::EnablePDEV method. - - The IPrintOemUni::EnablePDEV method performs the same types - of operations as the DrvEnablePDEV function that is exported - by a printer graphics DLL. Its purpose is to allow a rendering - plug-in to create its own PDEV structure. For more information - about PDEV structures, see "Customized PDEV Structures" in the DDK docs. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pPrinterName - pointer to a text string representing the - logical address of the printer. - cPatterns - value representing the number of HSURF-typed - surface handles contained in the buffer pointed to by - phsurfPatterns. - phsurfPatterns - pointer to a buffer that is large enough to - contain cPatterns number of HSURF-typed surface handles. - The handles represent surface fill patterns. - cjGdiInfo - value representing the size of the structure pointed - to by pGdiInfo. - pGdiInfo - pointer to a GDIINFO structure. - cjDevInfo - value representing the size of the structure pointed - to by pDevInfo. - pDevInfo - pointer to a DEVINFO structure. - pded - pointer to a DRVENABLEDATA structure containing the - addresses of the printer driver's graphics DDI hooking functions. - pDevOem - Receives a method-supplied pointer to a private PDEV structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - If the operation fails, the method should call SetLastError to set an error code. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(cPatterns); - UNREFERENCED_PARAMETER(phsurfPatterns); - UNREFERENCED_PARAMETER(cjGdiInfo); - UNREFERENCED_PARAMETER(cjDevInfo); - - // Allocate an instance of our private PDEV. - // - POEMPDEV pOemPDEV = new COemPDEV(); - - if (NULL == pOemPDEV) - { - return E_FAIL; - } - - pOemPDEV->InitializeDDITable(pded); - - // Initializing private oempdev stuff - // - pOemPDEV->bHeadersFilled = FALSE; - pOemPDEV->bColorTable = FALSE; - pOemPDEV->cbHeaderOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); - pOemPDEV->bmInfoHeader.biHeight = 0; - pOemPDEV->bmInfoHeader.biSizeImage = 0; - pOemPDEV->pBufStart = NULL; - pOemPDEV->dwBufSize = 0; - - // We create a BGR palette for 24bpp so that we can avoid color byte order manipulation - // - if (pGdiInfo->cBitsPixel == 24) - pDevInfo->hpalDefault = EngCreatePalette(PAL_BGR, 0, 0, 0, 0, 0); - - // Store the handle to the default palette so that we can fill the color table later - // - pOemPDEV->hpalDefault = pDevInfo->hpalDefault; - - *pDevOem = pOemPDEV; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -FilterGraphics( - PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::FilterGraphics - - The IPrintOemUni::FilterGraphics method can be used with - Unidrv-supported printers to modify scan line data and send - it to the spooler. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pBuf - pointer to a buffer containing scan line data to be printed. - dwLen - value representing the length, in bytes, of the data - pointed to by pBuf. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - DWORD dwResult; - - m_pOEMHelp->DrvWriteSpoolBuf(pdevobj, pBuf, dwLen, &dwResult); - - if (dwResult == dwLen) - return S_OK; - else - return S_FALSE; -} - -HRESULT __stdcall -COemUni2:: -GetImplementedMethod( - _In_ PSTR pMethodName - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::GetImplementedMethod - - The IPrintOemUni::GetImplementedMethod method is used by - Unidrv to determine which IPrintOemUni interface methods - have been implemented by a rendering plug-in. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::GetImplemented method. - - Please refer to DDK documentation for more details. - -Arguments: - - pMethodName - pointer to a string representing the name of an - IPrintOemUni interface method, such as "ImageProcessing" - for IPrintOemUni::ImageProcessing or "FilterGraphics" for - IPrintOemUni::FilterGraphics. - -Return Value: - - S_OK The operation succeeded (the specified method is implemented). - S_FALSE The operation failed (the specified method is not implemented). - - ---*/ - -{ - HRESULT Result = S_FALSE; - - // Unidrv only calls GetImplementedMethod for optional - // methods. The required methods are assumed to be - // supported. - - // Return S_OK for supported function (i.e. implemented), - // and S_FALSE for functions that aren't supported (i.e. not implemented). - switch (*pMethodName) - { - case 'C': - if (!strcmp(NAME_CommandCallback, pMethodName)) - { - Result = S_OK; - } - break; - case 'F': - if (!strcmp(NAME_FilterGraphics, pMethodName)) - { - Result = S_OK; - } - break; - case 'I': - if (!strcmp(NAME_ImageProcessing, pMethodName)) - { - Result = S_OK; - } - break; - } - - return Result; -} - -HRESULT __stdcall -COemUni2:: -GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::GetInfo - - A rendering plug-in's IPrintOemUni::GetInfo method returns - identification information. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::GetInfo method. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - Contains one of the following caller-supplied integer constants. - OEMGI_GETSIGNATURE - The method must return a unique four-byte - identification signature. The plug-in must also place this signature - in OPTITEM structures, as described in the description of the - OEMCUIPPARAM. structure's pOEMOptItems member. - OEMGI_GETVERSION - The method must return the user interface - plug-in's version number as a DWORD. The version format is - developer-defined. - pBuffer - pointer to memory allocated to receive the information specified - by dwInfo. - cbSize - size of the buffer pointed to by pBuffer. - pcbNeeded - pointer to a location to receive the number of bytes written - into the buffer pointed to by pBuffer. - -Return Value: - - S_OK The operation succeeded (the specified method is implemented). - S_FALSE The operation failed (the specified method is not implemented). - - ---*/ - -{ - PWSTR pszTag = L"COemUni2::GetInfo entry."; - switch(dwMode) - { - case OEMGI_GETSIGNATURE: pszTag = L"COemUni2::GetInfo entry. [OEMGI_GETSIGNATURE]"; break; - case OEMGI_GETVERSION: pszTag = L"COemUni2::GetInfo entry. [OEMGI_GETVERSION]"; break; - - } - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) ) ) - { - WARNING("COemUni2::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER.\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. If not, return error, and also ensure that - // the required buffer size is provided to the caller. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING("COemUni2::GetInfo() exit mode not supported.\r\n"); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -HalftonePattern( - PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::HalftonePattern - - The IPrintOemUni::HalftonePattern method can be used with - Unidrv-supported printers to create or modify a halftone - pattern before it is used in a halftoning operation. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pHTPattern - pointer to a buffer to receive the method-supplied - halftone pattern. Buffer size, in bytes, is: - (((dwHTPatternX * dwHTPatternY) + 3)/4) * 4 * dwHTNumPatterns. - dwHTPatternX - length, in pixels, of the halftone pattern, as specified - by the GPD file's *HTPatternSize attribute. - dwHTPatternY - height, in pixels, of the halftone pattern, as specified - by the GPD file's *HTPatternSize attribute. - dwHTNumPatterns - number of patterns, as specified by the GPD file's - *HTNumPatterns attribute. This can be 1 or 3. - dwCallbackID - value identifying the halftone method, as specified by - the GPD file's *HTCallbackID attribute. - pResource - pointer to a buffer containing a halftone pattern, as - specified by the GPD file's *rcHTPatternID attribute. This can be NULL. - dwResourceSize - size of the halftone pattern contained in the buffer - pointed to by pResource. This is zero if pResource is NULL. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pHTPattern); - UNREFERENCED_PARAMETER(dwHTPatternX); - UNREFERENCED_PARAMETER(dwHTPatternY); - UNREFERENCED_PARAMETER(dwHTNumPatterns); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(pResource); - UNREFERENCED_PARAMETER(dwResourceSize); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -ImageProcessing( - PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::ImageProcessing - - The IPrintOemUni::ImageProcessing method can be used with - Unidrv-supported printers to modify image bitmap data, in order - to perform color formatting or halftoning. The method can return - the modified bitmap to Unidrv or send it directly to the print spooler. - - Please refer to DDK documentation for more details. - - The algorithm for this particular implementation of ImageProcessing is as follows. - - If headers have not been filled as yet, fill them. - - We fill out only the info header and the color table here. The file header is filled - out in OEMEndDoc. - - The height and image size in the bitmap info header are updated every time - we enter ImageProcessing. - - Increase the size of the data buffer by the size of the current band. - - Copy over the data from the current band to the buffer. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pSrcBitmap - pointer to an input device-independent bitmap (DIB). - pBitmapInfoHeader - pointer to a BITMAPINFOHEADER structure - that describes the bitmap pointed to by pSrcBitmap. - pColorTable - pointer to a color table. Used only if the output format is - eight bits per pixel. - dwCallbackID - value assigned to the *IPCallbackID attribute of the - currently selected option for the ColorMode feature. - pIPParams - pointer to an IPPARAMS structure. - ppbResult - - If the method returns the converted DIB to Unidrv: - If the conversion succeeds, the method should return a - pointer to a buffer containing the converted DIB. - Otherwise it should return NULL. - If the method sends the converted DIB to the print spooler: - If the operation succeeds, the method should return TRUE. - Otherwise it should return FALSE. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pColorTable); - - POEMPDEV pOemPDEV = (POEMPDEV)pdevobj->pdevOEM; - - // We want to set ppbResult to NULL in case this function fails and returns E_FAIL - // - *ppbResult = NULL; - - // We want to keep track of the current offset from the start - // of the buffer before the size is increased. - // - DWORD dwBufOffset = pOemPDEV->dwBufSize; - - // We fill out the file header in OEMEndDoc. But for the info header, we take the easy route - // and copy the stuff from pBitmapInfoHeader. Only height and image size will be updated - // every time we enter ImageProcessing. - // - if (!pOemPDEV->bHeadersFilled) - { - ULONG ulMonoPalette[2] = { RGB_BLACK, RGB_WHITE, }; - - pOemPDEV->bHeadersFilled = TRUE; - pOemPDEV->bmInfoHeader.biSize = pBitmapInfoHeader->biSize; - pOemPDEV->bmInfoHeader.biPlanes = pBitmapInfoHeader->biPlanes; - pOemPDEV->bmInfoHeader.biBitCount = pBitmapInfoHeader->biBitCount; - pOemPDEV->bmInfoHeader.biCompression = pBitmapInfoHeader->biCompression; - pOemPDEV->bmInfoHeader.biXPelsPerMeter = pBitmapInfoHeader->biXPelsPerMeter; - pOemPDEV->bmInfoHeader.biYPelsPerMeter = pBitmapInfoHeader->biYPelsPerMeter; - pOemPDEV->bmInfoHeader.biClrUsed = pBitmapInfoHeader->biClrUsed; - pOemPDEV->bmInfoHeader.biClrImportant = pBitmapInfoHeader->biClrImportant; - pOemPDEV->bmInfoHeader.biWidth = pBitmapInfoHeader->biWidth; // We support only Portrait. So width is constant and needs to be updated only once. - - if (dwCallbackID != BMF_24BPP) // We need color table only if it is not 24bpp - { - DWORD cbMemAllocSize; - - pOemPDEV->bColorTable = TRUE; // Indicates that color table needs to be dumped at EndDoc time - - switch(dwCallbackID) - { - case BMF_1BPP: // 1 - pOemPDEV->cPalColors = 2; - - pOemPDEV->prgbq = NULL; - - // Call intsafe.h function to ensure there's no integer overflow or underflow - if (!SUCCEEDED(DWordMult(pOemPDEV->cPalColors, sizeof(RGBQUAD), &cbMemAllocSize)) || - (NULL == (pOemPDEV->prgbq = (RGBQUAD *)LocalAlloc(LPTR, cbMemAllocSize)))) - { - return E_FAIL; - } - - for (int i = 0; i < pOemPDEV->cPalColors; i++) - { - pOemPDEV->prgbq[i].rgbBlue = GetBValue(ulMonoPalette[i]); - pOemPDEV->prgbq[i].rgbGreen = GetGValue(ulMonoPalette[i]); - pOemPDEV->prgbq[i].rgbRed = GetRValue(ulMonoPalette[i]); - } - break; - case BMF_4BPP: // 2 - pOemPDEV->cPalColors = 16; - if (!bFillColorTable(pOemPDEV)) - return E_FAIL; - break; - case BMF_8BPP: // 3 - pOemPDEV->cPalColors = 256; - if (!bFillColorTable(pOemPDEV)) - return E_FAIL; - break; - } - } - - } - - // Keep track of the overall height and image size - // - pOemPDEV->bmInfoHeader.biHeight += pBitmapInfoHeader->biHeight; - pOemPDEV->bmInfoHeader.biSizeImage += pBitmapInfoHeader->biSizeImage; - - // Increase the buffer by the size of the current band - // - if (!bGrowBuffer(pOemPDEV, pBitmapInfoHeader->biSizeImage)) - return E_FAIL; - - if (!pIPParams->bBlankBand) // Non-blank band - { - CopyMemory((pOemPDEV->pBufStart + dwBufOffset), pSrcBitmap, pBitmapInfoHeader->biSizeImage); - } - else // For blanks bands, buffer blank scanlines - { - memset((pOemPDEV->pBufStart + dwBufOffset), 0xff, pBitmapInfoHeader->biSizeImage); - } - - // Set ppbResult to TRUE - // - *ppbResult = (LPBYTE)(INT_PTR)(TRUE); - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -MemoryUsage( - PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::MemoryUsage - - The IPrintOemUni::MemoryUsage method can be used with - Unidrv-supported printers to specify the amount of memory - required for use by a rendering plug-in's IPrintOemUni::ImageProcessing - method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pMemoryUsage - pointer to an OEMMEMORYUSAGE structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pMemoryUsage); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -OutputCharStr( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::OutputCharStr - - The IPrintOemUni::OutputCharStr method enables a rendering - plug-in to control the printing of font glyphs. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - dwType - value indicating the type of glyph specifier array - pointed to by pGlyph. Valid values are as follows: - TYPE_GLYPHHANDLE The pGlyph array elements are glyph - handles of type HGLYPH. - TYPE_GLYPHID The pGlyph array elements are glyph - identifiers of type DWORD. - dwCount - value representing the number of glyph specifiers in - the array pointed to by pGlyph. - pGlyph - pointer to an array of glyph specifiers, where the array - element type is indicated by dwType. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(dwType); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pGlyph); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -PublishDriverInterface( - IUnknown *pIUnknown - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::PublishDriverInterface - - The IPrintOemUni::PublishDriverInterface method allows a - rendering plug-in for Unidrv to obtain the Unidrv driver's - IPrintOemDriverUni interface. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::PublishDriverInterface method and the method - must return S_OK, or the driver will not call the plug-in's other - IPrintOemUni interface methods. - - Please refer to DDK documentation for more details. - -Arguments: - - pIUnknown - pointer to the IUnknown interface of the driver's - IPrintOemDriverUni COM interface. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - // Need to store pointer to Driver Helper functions, if we already haven't. - if (this->m_pOEMHelp == NULL) - { - HRESULT hResult; - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUni, (void** ) &(this->m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - this->m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -ResetPDEV( - PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::ResetPDEV - - The IPrintOemUni::ResetPDEV method allows a rendering - plug-in for Unidrv to reset its PDEV structure. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::ResetPDEV method. - - - A rendering plug-in's IPrintOemUni::ResetPDEV method performs - the same types of operations as the DrvResetPDEV function. During - the processing of an application's call to the Platform SDK ResetDC - function, the IPrintOemUni::ResetPDEV method is called by Unidrv's - DrvResetPDEV function. For more information about when DrvResetPDEV - is called, see its description in the DDK docs. - - The rendering plug-in's private PDEV structure's address is contained - in the pdevOEM member of the DEVOBJ structure pointed to by pdevobjOld. - The IPrintOemUni::ResetPDEV method should use relevant members of this - old structure to fill in the new structure, which is referenced through pdevobjNew. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobjOld - pointer to a DEVOBJ structure containing current PDEV information. - pdevobjNew - pointer to a DEVOBJ structure into which the method should place - new PDEV information. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobjOld); - UNREFERENCED_PARAMETER(pdevobjNew); - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -SendFontCmd( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::SendFontCmd - - The IPrintOemUni::SendFontCmd method enables a rendering - plug-in to modify a printer's font selection command and then - send it to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pFInv - pointer to an FINVOCATION structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pFInv); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TextOutAsBitmap( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TextOutAsBitmap - - The IPrintOemUni::TextOutAsBitmap method allows a rendering - plug-in to create a bitmap image of a text string, in case a - downloadable font is not available. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to be written. - pstro - Defines the glyphs to be rendered and their positions - pfo - Specifies the font to be used - pco - Defines the clipping path - prclExtra - A NULL-terminated array of rectangles to be filled - prclOpaque - Specifies an opaque rectangle - pboFore - Defines the foreground brush - pboOpaque - Defines the opaque brush - pptlOrg - Pointer to POINT struct , defining th origin - mix - Specifies the foreground and background ROPs for pboFore - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pso); - UNREFERENCED_PARAMETER(pstro); - UNREFERENCED_PARAMETER(pfo); - UNREFERENCED_PARAMETER(pco); - UNREFERENCED_PARAMETER(prclExtra); - UNREFERENCED_PARAMETER(prclOpaque); - UNREFERENCED_PARAMETER(pboFore); - UNREFERENCED_PARAMETER(pboOpaque); - UNREFERENCED_PARAMETER(pptlOrg); - UNREFERENCED_PARAMETER(mix); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TTDownloadMethod( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TTDownloadMethod - - The IPrintOemUni::TTDownloadMethod method enables a rendering - plug-in to indicate the format that Unidrv should use for a specified - TrueType soft font. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pdwResult - Receives one of the following method-supplied constant values: - TTDOWNLOAD_BITMAP Unidrv should download the specified font as bitmaps. - TTDOWNLOAD_DONTCARE Unidrv can select the font format. - TTDOWNLOAD_GRAPHICS Unidrv should print TrueType fonts as graphics, - instead of downloading the font. - TTDOWNLOAD_TTOUTLINE Unidrv should download the specified font as outlines. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TTYGetInfo( - PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TTYGetInfo - - The IPrintOemUni::TTYGetInfo method enables a rendering plug-in - to supply Unidrv with information relevant to text-only printers. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - dwInfoIndex - constant identifying the type of information being requested. - The following constant values are defined: - OEMTTY_INFO_CODEPAGE - The pOutputBuf parameter points to a - DWORD in which the method should return the number of the - code page to be used. - OEMTTY_INFO_MARGINS - The pOutputBuf parameter points to a - RECT structure in which the method should return page margin - widths, in tenths of millimeters (for example, 20 represents 2 mm). - If the entire page is printable, all margin values must be 0. - OEMTTY_INFO_NUM_UFMS - The pOutputBuf parameter points to a - DWORD in which the method should return the number of resource - IDs of the UFMs for 10, 12, and 17 CPI fonts. To actually obtain - these resource IDs, perform a query using OEMTTY_INFO_UFM_IDS. - OEMTTY_INFO_UFM_IDS - The pOutputBuf parameter points to an array - of DWORDs of sufficient size to hold the number of resource IDs of - the UFMs for 10, 12, and 17 CPI fonts. (This number is obtained by - using OEMTTY_INFO_NUM_UFMS in a query.) The method should - return the resource IDs of the UFMs for 10,12, and 17 CPI fonts. - pOutputBuf - pointer to a buffer to receive the requested information. - dwSize - size, in bytes, of the buffer pointed to by pOutputBuf. - pcbcNeeded - pointer to a location to receive the number of bytes written into - the buffer pointed to by pOutputBuf. If the number of bytes required is - smaller than the number specified by dwSize, the method should supply - the required size and return E_FAIL. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwInfoIndex); - UNREFERENCED_PARAMETER(pOutputBuf); - UNREFERENCED_PARAMETER(dwSize); - UNREFERENCED_PARAMETER(pcbcNeeded); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -WritePrinter( - PDEVOBJ pdevobj, - PVOID pBuf, - DWORD cbBuffer, - PDWORD pcbWritten - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni2::WritePrinter - - The IPrintOemUni2::WritePrinter method, if supported, enables a - rendering plug-in to capture all output data generated by a Unidrv - driver. If this method is not supported, the output data would - otherwise be sent to the spooler in a call to the spooler's WritePrinter API. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pBuf - pointer to the first byte of an array of bytes that contains - the output data generated by the Unidrv driver. - cbBuffer - size, in bytes, of the array pointed to by pBuf. - pcbWritten - pointer to a DWORD value that receives the number - of bytes of data that were successfully sent to the plug-in. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pBuf); - UNREFERENCED_PARAMETER(cbBuffer); - UNREFERENCED_PARAMETER(pcbWritten); - - return E_NOTIMPL; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class COemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef)(THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release)(THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance)(THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - - STDMETHOD(LockServer)(THIS_ BOOL bLock); - - - // Constructor - COemCF(): m_cRef(1) { }; - - // Destructor - ~COemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall -COemCF:: -QueryInterface( - const IID& iid, - void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall -COemCF:: -AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -COemCF:: -Release() -{ -// ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall -COemCF:: -CreateInstance( - IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - // Create component. - COemUni2* pOemCP = new COemUni2; - if (pOemCP == NULL) - { - return E_OUTOFMEMORY; - } - - // Get the requested interface. - HRESULT hr = pOemCP->QueryInterface(iid, ppv); - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCP->Release(); - return hr; -} - -// LockServer -HRESULT __stdcall -COemCF:: -LockServer( - BOOL bLock - ) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - return S_OK; -} - - -// -// Registration functions -// - -// -// Can DLL unload now? -// -STDAPI DllCanUnloadNow(void) -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMRENDER) - { - ERR("DllGetClassObject:\tClass not available!\r\n"); - return CLASS_E_CLASSNOTAVAILABLE; - } - - // Create class factory. - COemCF* pFontCF = new COemCF; // Reference count set to 1 in constructor - if (pFontCF == NULL) - { - ERR("DllGetClassObject:\tOut of Memory!\r\n"); - return E_OUTOFMEMORY; - } - - // Get requested interface. - HRESULT hrResult = pFontCF->QueryInterface(iid, ppv); - pFontCF->Release(); - - return hrResult; -} - -BOOL -bGrowBuffer( - POEMPDEV pOemPDEV, - DWORD dwBufInc - ) - -/*++ - -Routine Description: - - Enlarge the buffer for holding the bitmap data - -Arguments: - - pOemPDEV - Pointer to the private PDEV structure - dwBufInc - Amount to enlarge the buffer by - -Return Value: - - TRUE if successful, FALSE if memory allocation fails - ---*/ - -{ - DWORD dwOldBufferSize; - PBYTE pNewBuffer; - - // Allocate a new buffer whose size is the size of the previous buffer plus the increment - // - dwOldBufferSize = pOemPDEV->pBufStart ? pOemPDEV->dwBufSize : 0; - pOemPDEV->dwBufSize = dwOldBufferSize + dwBufInc; - - if (NULL == (pNewBuffer = (PBYTE)LocalAlloc(LPTR, pOemPDEV->dwBufSize))) - { - WARNING("LocalAlloc failed!\n"); - - vFreeBuffer(pOemPDEV); - - return FALSE; - } - - if (pOemPDEV->pBufStart) // Growing an existing buffer - { - CopyMemory(pNewBuffer, pOemPDEV->pBufStart, dwOldBufferSize); - - LocalFree(pOemPDEV->pBufStart); - pOemPDEV->pBufStart = pNewBuffer; - } - else // First time allocation - { - pOemPDEV->pBufStart = pNewBuffer; - } - - return TRUE; -} - -VOID -vFreeBuffer( - POEMPDEV pOemPDEV - ) - -/*++ - -Routine Description: - - Free the buffer for holding the bitmap data - -Arguments: - - pOemPDEV - Pointer to the private PDEV structure - -Return Value: - - None ---*/ - -{ - if (pOemPDEV->pBufStart) - { - LocalFree(pOemPDEV->pBufStart); - - pOemPDEV->pBufStart = NULL; - pOemPDEV->dwBufSize = 0; - } -} - -BOOL -bFillColorTable( - POEMPDEV pOemPDEV - ) - -/*++ - -Routine Description: - - Fill the color table for the bitmap data. This function - obtains the entries in the default palette and fills the - RGBQUAD structure that represents the color table. - -Arguments: - - pOemPDEV - Pointer to the private PDEV structure - -Return Value: - - TRUE if successful, FALSE if memory allocation for the color table fails - ---*/ - -{ - PALETTEENTRY * pPaletteEntry; - UINT uiPalEntries; - INT iLastPalIndex = pOemPDEV->cPalColors - 1; - DWORD cbMemAllocSize; - - pOemPDEV->prgbq = NULL; - - // Call intsafe.h function to ensure there's no integer overflow or underflow - if (!SUCCEEDED(DWordMult(pOemPDEV->cPalColors, sizeof(RGBQUAD), &cbMemAllocSize)) || - (NULL == (pOemPDEV->prgbq = (RGBQUAD *)LocalAlloc(LPTR, cbMemAllocSize)))) - { - return FALSE; - } - - // Call intsafe.h function to ensure there's no integer overflow or underflow - if (!SUCCEEDED(DWordMult(pOemPDEV->cPalColors, sizeof(PALETTEENTRY), &cbMemAllocSize)) || - (NULL == (pPaletteEntry = (PALETTEENTRY *)LocalAlloc(LPTR, cbMemAllocSize)))) - { - return FALSE; - } - - uiPalEntries = GetPaletteEntries(pOemPDEV->hpalDefault, 0, pOemPDEV->cPalColors, pPaletteEntry); - - if (uiPalEntries == 0) - { - LocalFree(pPaletteEntry); - return FALSE; - } - - for (int i = 0; i < pOemPDEV->cPalColors; i++) - { - pOemPDEV->prgbq[i].rgbBlue = pPaletteEntry[i].peBlue; - pOemPDEV->prgbq[i].rgbGreen = pPaletteEntry[i].peGreen; - pOemPDEV->prgbq[i].rgbRed = pPaletteEntry[i].peRed; - } - - // Set the last index in the color table to white - // - pOemPDEV->prgbq[iLastPalIndex].rgbBlue = 0xff; - pOemPDEV->prgbq[iLastPalIndex].rgbGreen = 0xff; - pOemPDEV->prgbq[iLastPalIndex].rgbRed = 0xff; - - return TRUE; - -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.h deleted file mode 100644 index 7c992055..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/intrface.h +++ /dev/null @@ -1,287 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.H -// -// -// PURPOSE: Define COM interface for User Mode Printer Customization DLL. -// - - -#pragma once - -///////////////////////////////////////////////////////// -// String Literals -///////////////////////////////////////////////////////// - - -CONST CHAR NAME_CommandCallback[] = "CommandCallback"; -CONST CHAR NAME_FilterGraphics[] = "FilterGraphics"; -CONST CHAR NAME_ImageProcessing[] = "ImageProcessing"; - - -//////////////////////////////////////////////////////////////////////////////// -// -// COemUni2 -// -// Interface for Unidrv OEM sample rendering module -// -class COemUni2 : public IPrintOemUni2 -{ -public: - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release)(THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Method for getting the implemented methods. - // Returns S_OK if the given method is implemneted. - // Returns S_FALSE if the given method is notimplemneted. - // - - STDMETHOD(GetImplementedMethod)(THIS_ _In_ PSTR pMethodName); - - // - // Method for OEM to specify DDIs that have been hooked - // - - STDMETHOD(EnableDriver) (THIS_ DWORD DriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded); - - // - // Method to notify OEM plugin that it is no longer required - // - - STDMETHOD(DisableDriver) (THIS); - - // - // Method for OEM plugin to contruct its own PDEV - // - - STDMETHOD(EnablePDEV)(THIS_ PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem); - - // - // Method for OEM to free any resource associated with its PDEV - // - - STDMETHOD(DisablePDEV)(THIS_ PDEVOBJ pdevobj); - - // - // Method for OEM to transfer from old PDEV to new PDEV - // - - STDMETHOD(ResetPDEV)(THIS_ PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo)(THIS_ DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDriverDMS - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(DriverDMS)(THIS_ PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode)(THIS_ DWORD dwMode, - POEMDMPARAM pOemDMParam); - - // - // OEMCommandCallback - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(CommandCallback)(THIS_ PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult); - - // - // OEMImageProcessing - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(ImageProcessing)(THIS_ PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult); - - // - // OEMFilterGraphics - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(FilterGraphics)(THIS_ PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen); - // - // OEMCompression - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(Compression)(THIS_ PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult); - - // - // OEMHalftone - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(HalftonePattern)(THIS_ PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize); - - // - // OEMMemoryUsage - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(MemoryUsage)(THIS_ PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage); - - // - // OEMTTYGetInfo - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(TTYGetInfo)(THIS_ PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded); - - // - // OEMDownloadFontheader - UNIDRV only - // - - STDMETHOD(DownloadFontHeader)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMDownloadCharGlyph - UNIDRV only - // - - STDMETHOD(DownloadCharGlyph)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult); - - // - // OEMTTDownloadMethod - UNIDRV only - // - - STDMETHOD(TTDownloadMethod)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMOutputCharStr - UNIDRV only - // - - STDMETHOD(OutputCharStr)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph); - - // - // OEMSendFontCmd - UNIDRV only - // - - - STDMETHOD(SendFontCmd)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv); - - // - // OEMTextOutAsBitmap - UNIDRV only - // - - STDMETHOD(TextOutAsBitmap)(THIS_ SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix); - - // - // IPrintOemUni2 methods - // - - // - // Method for plugin to hook out spooler's WritePrinter API so it - // can get access to output data Universal driver is generating - // - // At DrvEnablePDEV time, Universal driver will call this function with - // pdevobj = NULL, pBuf = NULL, cbBuffer = 0 to detect if the plugin - // implements this function. Plugin should return S_OK to indicate it is - // implementing this function, or return E_NOTIMPL otherwise. - // - // In pcbWritten, plugins should return the number of bytes written to the - // spooler's WritePrinter function. Zero doesn't carry a special meaning, - // errors must be reported through the returned HRESULT. - // - - STDMETHOD(WritePrinter)(THIS_ PDEVOBJ pdevobj, - PVOID pBuf, - DWORD cbBuffer, - PDWORD pcbWritten); - - - COemUni2(); - ~COemUni2(); - -protected: - LONG m_cRef; - IPrintOemDriverUni* m_pOEMHelp; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/precomp.h deleted file mode 100644 index d26e300b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/precomp.h +++ /dev/null @@ -1,40 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.H -// -// -// PURPOSE: Required header files external to the current project -// that do not need to be recompiled frequently. -// - - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/bitmap/resource.h deleted file mode 100644 index 8e941820..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/bitmap/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by OEMUNI.rc -// - - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp.gpd b/print/OEM Printer Customization Plug-in Samples/C++/custhlp.gpd deleted file mode 100644 index 23c72bea..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp.gpd +++ /dev/null @@ -1,563 +0,0 @@ -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*ModelName: "OEM Unidrv Customization Sample" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 - -*%------------------------------------- -*%This is your OEM Custom Help file. -*%------------------------------------- -*HelpFile: "CUSTOMDRV.HLP" - -*PrintRate: 8 -*PrintRateUnit: PPM -*PrintRatePPM: 8 - -*Feature: Orientation -{ - *HelpIndex: 15001 - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l0O" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l1O" - } - } -} - -*%------------------------------------- -*%This Features std help is replaced with OEM help. -*%Note you need to have *HelpFile: def in the general section. -*%HelpIndex is OEM ref ID -*%------------------------------------- -*Feature: InputBin -{ - *HelpIndex: 15001 - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: UPPER - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l1H" - } - } -} -*Feature: Resolution -{ - *HelpIndex: 15001 - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: Option1 - *Option: Option1 - { - *Name: "300 x 300 " =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "<1B>%%-12345X" -+ "@PJL COMMENT HP Color LaserJet 5/5M " -+ "Version 0.56<0A>" -+ "@PJL SET RESOLUTION=300<0A>" -+ "@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } - *Option: Option2 - { - *Name: "150 x 150 " =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "<1B>%%-12345X" -+ "@PJL COMMENT HP Color LaserJet 5/5M " -+ "Version 0.56<0A>" -+ "@PJL SET RESOLUTION=150<0A>" -+ "@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } -} - -*Feature: PaperSize -{ - *HelpIndex: 15001 - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *%(9600, 12648) -*% *PrintableArea: PAIR(9600, 12648) - *PrintableArea: PAIR(9564, 12600) -*% *PrintableArea: PAIR(5000,5000) - *PrintableOrigin: PAIR(300, 300) -*% *PrintableOrigin: PAIR(300, 500) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9600->9592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (12648->12640) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9592, 12640) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *%5760 -- 7560 - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5760x7604Y" - } - } - *case: LANDSCAPE_CC90 - { - *%(9720, 12648) - *PrintableArea: PAIR(9760, 12688) - *PrintableOrigin: PAIR(200, 272) - *CursorOrigin: PAIR(200, 12960) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7632x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9540, 16248) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9600->9592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (16248->16240) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9592, 16240) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5760x9864Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9760, 16288) - *PrintableOrigin: PAIR(200, 272) - *CursorOrigin: PAIR(200, 16560) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t9792x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 12000) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (8100->8096) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (12000->11992) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(8096, 11992) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8200, 12080) - *PrintableOrigin: PAIR(240, 280) - *CursorOrigin: PAIR(200, 12360) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9324, 13476) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9324->9320) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (13476->13472) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9320, 13472) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9464, 13516) - *PrintableOrigin: PAIR(220, 272) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9464->9456) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (13516->13512) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9456, 13512) -*% Warning: the following printable origin X is adjusted (220->224) so it is divisible by the resolution X scale. - *PrintableOrigin: PAIR(224, 272) - } - } - *CursorOrigin: PAIR(200, 13788) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: A3 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(13428, 19308) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (13428->13424) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (19308->19304) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(13424, 19304) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l27a8c1E<1B>*p0x0Y<1B>*c0t8057x11693Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(13588, 19368) - *PrintableOrigin: PAIR(200, 240) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (13588->13584) so it is divisible by the resolution X scale. - *PrintableArea: PAIR(13584, 19368) - } - } - *CursorOrigin: PAIR(200, 19608) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l27a8c1E<1B>*p0x0Y<1B>*c0t11621x8177Y" - } - } - } - } - *Option: TABLOID - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { -*% *PrintableArea: PAIR(12600, 19800) - *PrintableArea: PAIR(12540, 19740) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (12600->12592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (19800->19792) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(12592, 19792) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l6a8c1E<1B>*p0x0Y<1B>*c0t7560x12000Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(12600, 19800) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (12600->12592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (19800->19792) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(12592, 19792) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(200, 20100) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l6a8c1E<1B>*p0x0Y<1B>*c0t11880x7680Y" - } - } - } - } -} -*Feature: MediaType -{ - *HelpIndex: 15001 - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: STANDARD - *Option: STANDARD - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.14 - *Cmd: "<1B>&l0M" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.14 - *Cmd: "<1B>&l4M" - } - } -} -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *HelpIndex: 12004 - *DefaultOption: 24bpp - *Option: 24bpp - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 - *Command: CmdEnableDRC { *Cmd : "<1B>*b3M" } - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" %d{PaletteIndexToProgram} -+ "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSetSrcBmpWidth { *Cmd : "<1B>*r" %d{RasterDataWidthInBytes / 3}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<0003080808081B>*v0a0b0c7i255a255b255c0I<1B>*" -+ "o3W<060400>" - } - } -} -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *HelpIndex: 12005 - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.5 - *Cmd: "<1B>&u300D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX / 4) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel / 4) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel / 4) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY / 4) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d[1,12600]{max_repeat((DestYRel / 4) )}"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d[1,12600]{max_repeat((DestYRel / 4) )}"Y" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" %d{PaletteIndexToProgram} -+ "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*TTFSEnabled?: TRUE -*DeviceFonts: LIST(134,135,136,137,138,139,140,146,147,148,149,150,151,152,153,154, -+ 155,156,157,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) - -*MinFontID: 16534 -*MaxFontID: 32768 -*FontFormat: HPPCL_OUTLINE -*% When the %f format is implemented we can remove the /100 part of -*% CmdSelectFontHeight and CmdSelectFontWidth -*% NOTE: MasterUnits.x is hardcoded here! -*% NOTE: THIS dividing by 200 because I want to /100 and then /2 for now. -*% The number 60000 may look strange, but it's 1200/2 * 100. -*Command: CmdSelectFontHeight { *Cmd : "<1B>(s" %d{FontHeight}"V" } -*Command: CmdSelectFontWidth { *Cmd : "<1B>(s" %f{1200 / FontWidth}"H" } -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize / 4) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize / 4) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp.ini b/print/OEM Printer Customization Plug-in Samples/C++/custhlp.ini deleted file mode 100644 index 2e014201..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=CUSTHLP.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.def b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.def deleted file mode 100644 index 68bdffc0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY OEMUI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj deleted file mode 100644 index 60f17f4c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj +++ /dev/null @@ -1,1060 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {CA70C64A-75C8-48CD-9224-335C2ED689A6} - $(MSBuildProjectName) - Win10 Debug - Win32 - {67281069-E045-4DCB-82BF-17B46979B788} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - CUSTHLP - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - CUSTHLP.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj.Filters deleted file mode 100644 index 4c89a16e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/CUSTHLP.vcxproj.Filters +++ /dev/null @@ -1,220 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {C7019300-D308-4256-B5E7-2CF8880D9E37} - - - h;hpp;hxx;hm;inl;inc;xsd - {8C99BD7D-E931-4BC0-810B-E56E2CE71883} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {B8E59174-9E39-4E27-A90D-17A011B16729} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.cnt b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.cnt deleted file mode 100644 index 4713a3b5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.cnt +++ /dev/null @@ -1,3 +0,0 @@ -:Base windows.HLP -1 Dialog Box Help -2 Information about this Help file=nocontent diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.h deleted file mode 100644 index f49cbd14..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// -// -// -////////////////////////////////////////////////////////////////// - -#define CUSDRV_HELPTOPIC_1 = 15001 -#define CUSDRV_HELPTOPIC_2 = 15002 -#define CUSDRV_HELPTOPIC_3 = 15003 -#define CUSDRV_HELPTOPIC_4 = 15004 - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.hpj b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.hpj deleted file mode 100644 index 2ccc18db..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.hpj +++ /dev/null @@ -1,17 +0,0 @@ -; This file is maintained by HCW. Do not modify this file directly. - -[OPTIONS] -COMPRESS=12 Hall Zeck -ERRORLOG=customdrv.err -LCID=0x409 0x0 0x0 ; English (United States) -REPORT=Yes -TITLE=Windows -CNT=customdrv.cnt -COPYRIGHT=%date -HLP=customdrv.hlp - -[FILES] -customdrv.rtf - -[MAP] -#include customdrv.h diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.rtf b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.rtf deleted file mode 100644 index 5ddf4b0e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/customhelp/customdrv.rtf +++ /dev/null @@ -1,22 +0,0 @@ -{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\f30\froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} -{\f31\froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\f33\froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\f34\froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};} -{\f35\froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\f36\froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\f37\froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};}}{\colortbl;\red0\green0\blue0; -\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128; -\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;} -{\*\cs10 \additive Default Paragraph Font;}{\s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 endnote text;}{ -\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext16 footnote text;}{\*\cs17 \additive \super \sbasedon10 footnote reference;}{\*\cs18 \additive \super -\sbasedon10 endnote reference;}{\*\cs19 \additive \fs16\cf0\up6 \sbasedon10 ExternalFN;}{\s20\ql \li0\ri0\widctlpar\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext20 header;}{\s21\ql \li0\ri0\widctlpar\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext21 footer;}}{\info{\author Craig Horsfield} -{\operator Craig Horsfield}{\creatim\yr2001\mo2\dy27\hr15\min6}{\revtim\yr2001\mo4\dy2\hr15\min7}{\version5}{\edmins3}{\nofpages3}{\nofwords17}{\nofchars100}{\*\company Microsoft}{\nofcharsws0}{\vern8269}} -\widowctrl\ftnbj\aendnotes\ftnnrlc\aftnnar\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale144\viewzk2\nolnhtadjtbl \fet0\sectd -\linex0\sectdefaultcl {\header \pard\plain \s20\ql \li0\ri0\widctlpar\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { -\par }}{\footer \pard\plain \s21\ql \li0\ri0\widctlpar\tqc\tx4320\tqr\tx8640\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { -\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}} -{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8 -\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 -\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs19\fs16\up6 @{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super @}{ - The following topics are for Custom options in the Custom Driver UI Plugin.}} #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ - CUSDRV_HELPTOPIC_1}}}{ Custom Topic 1 Help text contained in customdrv.rtf. -\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\page }{\cs19\fs16\up6 #{\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super #}{ - CUSDRV_HELPTOPIC_2}}}{ Custom Topic 2 Help text contained in customdrv.rtf. }{\fs20 \page }{ -\par }} \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.cpp deleted file mode 100644 index 8dae1ed3..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - - -#include "precomp.h" -#include "oemui.h" -#include "debug.h" -#include "devmode.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// -//Performs operation on UI Plugins Private DevMode Members. -//Called via IOemUI::DevMode -// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR("DevMode() ERROR_INVALID_PARAMETER.\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - // - //The Method should return the size of the memory allocation needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - // - //Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - // - //OEM_DMEXTRAHEADER Members - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - - // - //Private members - // - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - break; - - // - //The method should convert private DEVMODE members to the current version, if necessary. - // - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - // - //The method should validate the information contained in private DEVMODE members and merge validated values into a private DEVMODE structure containing default values - // - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return S_OK; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut) -{ - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR("ConvertOEMDevmode() invalid parameters.\r\n"); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n"); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - } - - return TRUE; -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data, if not valid. - if(pOEMDevmode->dwDriverData > 100) - { - pOEMDevmode->dwDriverData = 0; - } - - // Set Advanced driver data, if not valid. - if(pOEMDevmode->dwAdvancedData > 100) - { - pOEMDevmode->dwAdvancedData = 0; - } - - return TRUE; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.h deleted file mode 100644 index fe594658..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/devmode.h +++ /dev/null @@ -1,46 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// PURPOSE: The plug-in private devmode, common data types, and -// external function prototypes for devmode functions. -// - -#pragma once - - -// -//Can add info to the private devmode bellow here. -//Note : -// This structure must be prefixed by OEM_DMEXTRAHEADER -// Your plug-in must implement the IPrintOemUI::DevMode method -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - DWORD dwDriverData; - DWORD dwAdvancedData; - - // - //Private DevMode Members - // - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/dllentry.cpp deleted file mode 100644 index 287c0617..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/dllentry.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "oemui.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - break; - - case DLL_PROCESS_DETACH: - break; - - case DLL_THREAD_DETACH: - break; - } - - return TRUE; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.cpp b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.cpp deleted file mode 100644 index c41a27e4..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.cpp -// -// -// PURPOSE: File that contains all the globals. -// - -#include "precomp.h" -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.h deleted file mode 100644 index b9d707a0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/globals.h +++ /dev/null @@ -1,22 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.h -// -// PURPOSE: Lists of globals declared in Globals.cpp. -// - - -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -extern HINSTANCE ghInstance; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.cpp deleted file mode 100644 index 2a1278cc..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.cpp +++ /dev/null @@ -1,562 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.cpp -// -// PURPOSE: Implementation of OEMGetInfo and OEMDevMode. Shared by all Unidrv -// OEM test dll's. -// - -#include "precomp.h" - -#include "oemui.h" -#include "debug.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0; // Count of active components -static long g_cServerLocks = 0; // Count of locks - - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI body -// -IOemUI::~IOemUI() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - ASSERT(0 == m_cRef); -} - -HRESULT __stdcall IOemUI::QueryInterface(const IID& iid, void** ppv) -{ - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - } - else if (iid == IID_IPrintOemUI) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall IOemUI::AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemUI::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// -// (Implementation is required) Supplies a pointer to UNIDRIVE /PScript IPrintOemDriverUI -// -HRESULT __stdcall IOemUI::PublishDriverInterface( - IUnknown *pIUnknown) -{ - // Need to store pointer to Driver Helper functions, if we already haven't. - if (m_pOEMHelp == NULL) - { - HRESULT hResult; - - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUI, (void** ) &(m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - -// -//(Implementation is required) Returns the UI Plugin's identification information -// -HRESULT __stdcall IOemUI::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - WARNING("IOemUI::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER\r\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING("IOemUI::GetInfo() exit insufficient buffer!\r\r\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING("IOemUI::GetInfo() exit mode not supported.\r\r\n"); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - return S_OK; -} - - -// -//Performs operation on UI Plugins Private DevMode Members. -// -HRESULT __stdcall IOemUI::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - return hrOEMDevMode(dwMode, pOemDMParam); -} - - -// -//Allows UI Plugin to Modifiy Existing printer porp sheet and document property sheet page.. -// -HRESULT __stdcall IOemUI::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam) -{ - return hrOEMPropertyPage(dwMode, pOemCUIPParam); -} - - -// -//Adds a New page to the device Documment property sheet. -// - -HRESULT __stdcall IOemUI::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - return hrOEMDocumentPropertySheets(pPSUIInfo, lParam, m_pOEMHelp); -} - -// -//Adds a New page to the device printer property page. -// -HRESULT __stdcall IOemUI::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - return hrOEMDevicePropertySheets(pPSUIInfo, lParam); -} - - -// -//Allows the UI plugin to spec Customized device capabilaties (TODO) -// -HRESULT __stdcall IOemUI::DeviceCapabilities( - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult) -{ - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - return E_NOTIMPL; -} - - -// -//Allows the UI plugin to help determine if a print Job is printable. -// -HRESULT __stdcall IOemUI::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM) -{ - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - - -// -//Allows the UI Plugin to upgrade its dev options stored in the registry. -// -HRESULT __stdcall IOemUI::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo) -{ - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam) -{ - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam) -{ - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -HRESULT __stdcall IOemUI::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData) -{ - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - HRESULT Result = E_FAIL; - static const WCHAR PROFILE_NAME[] = L"OEMPROFILE.icm\0"; - - if(QCP_DEVICEPROFILE == ulQueryMode) - { - if(NULL == pvProfileData) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - if(*pcbProfileData < sizeof(PROFILE_NAME)) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - Result = StringCbCopy((LPWSTR)pvProfileData, *pcbProfileData, PROFILE_NAME); - *pcbProfileData = sizeof(PROFILE_NAME); - *pflProfileData = QCP_PROFILEDISK; - - if(FAILED(Result)) - { - SetLastError(Result); - } - } - } - } - - return Result; -}; - -HRESULT __stdcall IOemUI::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam) -{ - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI::UpdateExternalFonts( - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges) -{ - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - // Create component. - IOemUI* pOemCB = new IOemUI; - if (pOemCB == NULL) - { - return E_OUTOFMEMORY; - } - // Get the requested interface. - HRESULT hr = pOemCB->QueryInterface(iid, ppv); - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release(); - return hr; -} - -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - return S_OK; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv); - pFontCF->Release(); - - return hr; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.h deleted file mode 100644 index 1cc44e3a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/intrface.h +++ /dev/null @@ -1,182 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.h -// -// PURPOSE: Declaration of class that implements the UI plug-in class -// - - -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI -// -class IOemUI: public IPrintOemUI -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IPrintOemUI methods *** - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - - IOemUI() { m_cRef = 1; m_pOEMHelp = NULL; }; - ~IOemUI(); - -protected: - LONG m_cRef; - IPrintOemDriverUI* m_pOEMHelp; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.cpp b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.cpp deleted file mode 100644 index 2bc8cc32..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.cpp +++ /dev/null @@ -1,960 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.cpp -// -// -// PURPOSE: Main file for OEM UI test module. -// - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - -typedef struct _tagCBUserData -{ - HANDLE hComPropSheet; - HANDLE hPropPage; - POEMUIPSPARAM pOEMUIParam; - PFNCOMPROPSHEET pfnComPropSheet; - -} CBUSERDATA, *PCBUSERDATA; - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam); -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam); -static BOOL AddCustomUIHelp (HANDLE hPrinter, HANDLE hHeap, HANDLE hModule, POPTITEM pOptItem, DWORD HelpIndex, DWORD HelpFile); -static POIEXT CreateOIExt(HANDLE hHeap); -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems); -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems); -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams); -static PTSTR GetHelpFile (HANDLE hPrinter, HANDLE hHeap, HANDLE hModule, UINT uResource); -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource); -LPBYTE WrapGetPrinterDriver (HANDLE hHeap, HANDLE hPrinter, DWORD dwLevel); - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM device or document property UI. -// Called via IOemUI::CommonUIProp -// -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hResult = S_OK; - - // Validate parameters. - if( (OEMCUIP_DOCPROP != dwMode) - && - (OEMCUIP_PRNPROP != dwMode) - ) - { - ERR("hrOEMPropertyPage() ERROR_INVALID_PARAMETER.\r\n"); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - hResult = hrDocumentPropertyPage(dwMode, pOEMUIParam); - break; - - case OEMCUIP_PRNPROP: - hResult = hrPrinterPropertyPage(dwMode, pOEMUIParam); - break; - - default: - // Should never reach this! - ERR("hrOEMPropertyPage() Invalid dwMode"); - SetLastError(ERROR_INVALID_PARAMETER); - hResult = E_FAIL; - break; - } - - return hResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM document property UI. -// -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM document property UI. - pOEMUIParam->cOEMOptItems = 1; - } - else - { - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMDocUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_ADV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - - pOEMUIParam->pOEMOptItems[0].pOptType= CreateOptType(pOEMUIParam->hOEMHeap, 2); - - // - //Setup the Optional Item - // - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - - - // - //Allows You to apply Customised help to this Control. - // - //Notes: - // You must use a fully qualified path for pHelpFile - // OPTITEM Flags member must have OPTIF_HAS_POIEXT flag set. This indicates that the data in OIEXT is valid. - // OPTITEM is allocated on the Heap see (AddCustomUIHelp, GetHelpFile, CreateOIExt) - // - AddCustomUIHelp (pOEMUIParam->hPrinter, - pOEMUIParam->hOEMHeap, - pOEMUIParam->hModule, - &(pOEMUIParam->pOEMOptItems[0]), - CUSDRV_HELPTOPIC_2, IDS_HELPFILE); - } - - return S_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM printer property UI. -// -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM printer property UI. - pOEMUIParam->cOEMOptItems = 1; - } - else - { - // - //This is the second time we are called Now setup the optional items. - // - DWORD dwError; - DWORD dwDeviceValue; - DWORD dwType; - DWORD dwNeeded; - - // Get device settings value from printer. - dwError = GetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, &dwType, (PBYTE) &dwDeviceValue, - sizeof(dwDeviceValue), &dwNeeded); - if( (ERROR_SUCCESS != dwError) - || - (dwDeviceValue > 100) - ) - { - // Failed to get the device value or value is invalid, just use the default. - dwDeviceValue = 0; - } - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMPrinterUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_DEV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = dwDeviceValue; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - // - //Setup the Optional Item - // - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - - // - //Allows You to apply Customised help to this Control - // - AddCustomUIHelp (pOEMUIParam->hPrinter, - pOEMUIParam->hOEMHeap, - pOEMUIParam->hModule, - &(pOEMUIParam->pOEMOptItems[0]), - CUSDRV_HELPTOPIC_1, - IDS_HELPFILE); - } - return S_OK; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to Document property sheet. Called via IOemUI::DocumentPropertySheets -// -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, - IPrintOemDriverUI* pOEMHelp) -{ - UNREFERENCED_PARAMETER(pOEMHelp); - - LONG_PTR lResult = 0; - HRESULT hrResult = S_OK; - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR("hrOEMDocumentPropertySheets() ERROR_INVALID_PARAMETER.\r\n"); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - DWORD dwSheets = 0; - PCBUSERDATA pUserData; - POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM) pPSUIInfo->lParamInit; - HANDLE hHeap = pOEMUIParam->hOEMHeap; - HANDLE hModule = pOEMUIParam->hModule; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - COMPROPSHEETUI Sheet; - - - // Init property page. - memset(&Sheet, 0, sizeof(COMPROPSHEETUI)); - Sheet.cbSize = sizeof(COMPROPSHEETUI); - Sheet.Flags = CPSUIF_UPDATE_PERMISSION; - Sheet.hInstCaller = ghInstance; - Sheet.pCallerName = GetStringResource(hHeap, ghInstance, IDS_NAME); - Sheet.pHelpFile = NULL; - Sheet.pfnCallBack = OEMDocUICallBack2; - Sheet.pDlgPage = CPSUI_PDLGPAGE_TREEVIEWONLY; - Sheet.cOptItem = 1; - Sheet.IconID = IDI_CPSUI_PRINTER; - Sheet.pOptItemName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.CallerVersion = 0x100; - Sheet.OptItemVersion = 0x100; - - // Init user data. - pUserData = (PCBUSERDATA) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(CBUSERDATA)); - if (NULL == pUserData) - { - ERR("hrOEMDocumentPropertySheets() failed to allocate user data.\r\n"); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - pUserData->hComPropSheet = pPSUIInfo->hComPropSheet; - pUserData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - pUserData->pOEMUIParam = pOEMUIParam; - Sheet.UserData = (ULONG_PTR) pUserData; - - // Create OptItems for page. - Sheet.pOptItem = CreateOptItems(hHeap, Sheet.cOptItem); - if (NULL == Sheet.pOptItem) - { - ERR("hrOEMDocumentPropertySheets() failed to allocate OPTITEMs.\r\n"); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Initialize OptItems - Sheet.pOptItem[0].Level = 1; - Sheet.pOptItem[0].Flags = OPTIF_COLLAPSE; - Sheet.pOptItem[0].pName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.pOptItem[0].Sel = pOEMDev->dwDriverData; - - Sheet.pOptItem[0].pOptType = CreateOptType(hHeap, 2); - if (NULL == Sheet.pOptItem[0].pOptType) - { - ERR("hrOEMDocumentPropertySheets() failed to allocate OPTTYPE.\r\n"); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // - //Set the UI prop of this OPTYPE item. - // - Sheet.pOptItem[0].pOptType->Type = TVOT_UDARROW; - Sheet.pOptItem[0].pOptType->pOptParam[1].IconID = 0; - Sheet.pOptItem[0].pOptType->pOptParam[1].lParam = 100; - - // - //Allows You to apply Customised help to this Control. - //See Function : AddCustomUIHelp, For more details on implamentation. - // - AddCustomUIHelp (pOEMUIParam->hPrinter, - hHeap, - hModule, - &(Sheet.pOptItem[0]), - CUSDRV_HELPTOPIC_1, - IDS_HELPFILE); - - // Adds the property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PCOMPROPSHEETUI, - (LPARAM)&Sheet, (LPARAM)&dwSheets); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - -Exit: - - pPSUIInfo->Result = lResult; - return hrResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to printer property sheet. Called via IOemUI::DevicePropertySheets -// -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam) -{ - LONG_PTR lResult = 0; - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR("hrOEMDevicePropertySheets() ERROR_INVALID_PARAMETER.\r\n"); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - PROPSHEETPAGE Page; - - // Init property page. - memset(&Page, 0, sizeof(PROPSHEETPAGE)); - Page.dwSize = sizeof(PROPSHEETPAGE); - Page.dwFlags = PSP_DEFAULT; - Page.hInstance = ghInstance; - Page.pszTemplate = MAKEINTRESOURCE(IDD_DEVICE_PROPPAGE); - Page.pfnDlgProc = DevicePropPageProc; - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PROPSHEETPAGE, (LPARAM)&Page, 0); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - - pPSUIInfo->Result = lResult; - return S_OK; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM printer property UI. -// -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - { - DWORD dwDriverValue = pOEMUIParam->pOEMOptItems[0].Sel; - - // Store OptItems state in printer data. - SetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, REG_DWORD, (PBYTE) &dwDriverValue, sizeof(DWORD)); - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Call back for OEM device property UI. -// -#pragma warning(push) -#pragma warning( disable : 6262 ) // 2 MAX_PATH strings exceeds the stack size by a few bytes. -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uiMsg) - { - case WM_COMMAND: - switch(HIWORD(wParam)) - { - case BN_CLICKED: - switch(LOWORD(wParam)) - { - case IDC_CALIBRATE: - // Simulate printer calibration by displaying a message that the - // printer has been calibrated. - { - TCHAR szName[MAX_PATH]; - TCHAR szCalibrated[MAX_PATH]; - - LoadString(ghInstance, IDS_NAME, szName, sizeof(szName)/sizeof(szName[0])); - LoadString(ghInstance, IDS_CALIBRATED, szCalibrated, sizeof(szCalibrated)/sizeof(szCalibrated[0])); - MessageBox(hDlg, szCalibrated, szName, MB_OK); - } - break; - } - break; - - default: - return FALSE; - } - return TRUE; - - case WM_NOTIFY: - { - switch (((LPNMHDR)lParam)->code) // type of notification message - { - case PSN_SETACTIVE: - break; - - case PSN_KILLACTIVE: - break; - - case PSN_APPLY: - break; - - case PSN_RESET: - break; - } - } - break; - } - - return FALSE; -} -#pragma warning(pop) - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM document property UI. -// -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Store OptItems state in DEVMODE. - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_KILLACTIVE: - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pOEMUIParam->pOEMOptItems[0].Sel) != pOEMDev->dwAdvancedData) - { - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - pOEMUIParam->pOEMOptItems[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData; - POEMDEV pOEMDev = (POEMDEV) pUserData->pOEMUIParam->pOEMDM; - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - pUserData->pfnComPropSheet(pUserData->hComPropSheet, CPSFUNC_SET_RESULT, - (LPARAM)pUserData->hPropPage, - (LPARAM)CPSUI_OK); - break; - - case CPSUICB_REASON_KILLACTIVE: - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pCallbackParam->pOptItem[0].Sel) != pOEMDev->dwDriverData) - { - pCallbackParam->pOptItem[0].Sel = pOEMDev->dwDriverData; - pCallbackParam->pOptItem[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Creates and Initializes OptItems. -// -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems) -{ - POPTITEM pOptItems = NULL; - DWORD cbMemAllocSize; - - // Allocate memory for OptItems; - - // Call intsafe.h function to ensure there's no integer overflow or underflow - if (SUCCEEDED(DWordMult(sizeof(OPTITEM), dwOptItems, &cbMemAllocSize)) && - (NULL != (pOptItems = (POPTITEM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, cbMemAllocSize)))) - { - InitOptItems(pOptItems, dwOptItems); - } - else - { - ERR("CreateOptItems() failed to allocate memory for OPTITEMs!\r\n"); - } - - return pOptItems; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems. -// -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems) -{ - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for(DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } -} - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds Custom help top a OPTTYPE UI item. -// -// Note : -// The OPTITEM member HelpIndex must be set the the correct HELP ID number. -// HelpIndex is the index that you assigned in the hlp file to this item of help. -// The OPTITEM, pOIExt member must point to a valid OIEXT structure. -// The phelpfile is member of OIEXT must have the fully qualified path to the driver file. -// -// -// It is also possible to overide common help items in UNIDRIVE via the HelpIndex in the GPD. -// For further information on using HelpIndex in the GPD see the relavent section in the DDK -// It is not possible to custimse help however via the PPD. The OPTITEM must be modified in the OEM Plugin. -// -static BOOL AddCustomUIHelp (HANDLE hPrinter, HANDLE hHeap, HANDLE hModule, - POPTITEM pOptItem, DWORD HelpIndex, DWORD HelpFile) -{ - POIEXT pOIExt = NULL; - - // - //Allocate a new OIEXT structure on the heap - // - if (pOptItem->pOIExt == NULL) - { - pOptItem->pOIExt = CreateOIExt(hHeap); - } - - if ( pOptItem->pOIExt == NULL ) - { - ERR("AddCustomUIHelp() Error Allocation Failed.\r\n"); - return FALSE; - } - - pOIExt = pOptItem->pOIExt; - - // - //Set to the full absolute path of the driver file. - //(It should be in the Printer Driver Directrory in most cases) - //This String needs to be allocated on the heap (The Driver will clean it up). - // - pOIExt->pHelpFile = GetHelpFile (hPrinter, hHeap, hModule, HelpFile); - - // - //Set to show tha there is a valid OIEXT structure and data - // - pOptItem->Flags |= OPTIF_HAS_POIEXT; - - // - //This needs to be set if you have ansi strings in your help file. (NOTE!) - // - //pOiExt->Flags |= OIEXTF_ANSI_STRING; - - // - //Add the help this the index in the .hlp file. - // - pOptItem->HelpIndex = HelpIndex; - - return TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OIEXT for OptItem. -// -static POIEXT CreateOIExt(HANDLE hHeap) -{ - - POIEXT pOiExt = NULL; - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOiExt = (POIEXT) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OIEXT)); - if(NULL != pOiExt) - { - // - // Initialize OPTTYPE. (These members are setup by AddCustomUIHelp) - // - pOiExt->cbSize = sizeof(OIEXT); - pOiExt->Flags = 0; - pOiExt->hInstCaller = NULL; - pOiExt->pHelpFile = NULL; - } - - return pOiExt; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OptType for OptItem. -// -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams) -{ - POPTTYPE pOptType = NULL; - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - if(NULL != pOptType) - { - DWORD cbMemAllocSize; - - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - - // Call intsafe.h function to ensure there's no integer overflow or underflow - if (SUCCEEDED(DWordMult(wOptParams, sizeof(OPTPARAM), &cbMemAllocSize)) && - (NULL != (pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, cbMemAllocSize)))) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - ERR("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n"); - - // Free allocated memory and return NULL. - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR("CreateOptType() failed to allocated memory for OPTTYPE!\r\n"); - } - - return pOptType; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates space on the heap and gets the help file name from the resource file. -// Note you need to allocate this on the heap so that it stays allocated as long as the driver UI is loaded. -// The OPTITEM->pOIExt ref this data. -// -static PTSTR GetHelpFile (HANDLE hPrinter, HANDLE hHeap, HANDLE hModule, UINT uResource) -{ - - DWORD nResult = 0; - DWORD dwSize = MAX_PATH; - PTSTR pszString = NULL; - PTSTR pszTemp = NULL; - PDRIVER_INFO_2 pDriverInfo = NULL; - - // - // Allocate buffer for string resource from heap; - // - pszTemp = (PTSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(TCHAR)); - pDriverInfo = (PDRIVER_INFO_2)WrapGetPrinterDriver (hHeap, hPrinter, 2); - - // - //Get the Full Driver Dir from pDriverPath it must include the \version\ - // - if(NULL != pszTemp && pDriverInfo && pDriverInfo->pDriverPath) - { - HRESULT hCopy; - - hCopy = StringCchCopy(pszTemp, dwSize, pDriverInfo->pDriverPath); - if(FAILED(hCopy)) - { - ERR("StringCchCopy() failed to copy driver path to temp buffer!\r\n"); - } - pszString = _tcsrchr (pszTemp, _T('\\') ) + 1; - } - - // - //The Help file is installed with the driver in the version drictory. - // - if(NULL != pszString) - { - // - //The Buffer size is in characters for the unicode version of LoadString - // - nResult = LoadString((HMODULE)hModule, uResource, pszString, (int)(dwSize - _tcslen(pszTemp)) ); - } - else - { - ERR("GetStringResource() failed to allocate string buffer!\r\n"); - } - - if(nResult > 0) - { - // - //Reallocate this so that we don't waist space on the heap (free any non used heap in MAX_PATH) - // - pszString = (PTSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszTemp, (_tcslen(pszTemp) + 1) * sizeof(TCHAR)); - if(NULL == pszString) - { - pszTemp = pszString; - ERR("GetStringResource() HeapReAlloc() of string retrieved failed!\r\n"); - } - } - else - { - ERR("LoadString() failed!"); - pszString = NULL; - } - - // - //Clean up the Driverinfo that was allocated. It is not needed. (Always free this it is only temp data) - // - if (pDriverInfo) - { - HeapFree(hHeap, 0, pDriverInfo); - } - - return pszString; -} - -//////////////////////////////////////////////////////////////////////////////////// -// -// Retrieves pointer to a String resource. -// -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource) -{ - int nResult; - DWORD dwSize = MAX_PATH; - PTSTR pszString = NULL; - - // Allocate buffer for string resource from heap; let the driver clean it up. - pszString = (PTSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(TCHAR)); - if(NULL != pszString) - { - // Load string resource; resize after loading so as not to waste memory. - nResult = LoadString((HMODULE)hModule, uResource, pszString, dwSize); - if(nResult > 0) - { - PTSTR pszTemp; - - pszTemp = (PTSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszString, (nResult + 1) * sizeof(TCHAR)); - if(NULL != pszTemp) - { - pszString = pszTemp; - } - else - { - ERR("GetStringResource() HeapReAlloc() of string retrieved failed!\r\n"); - } - } - else - { - ERR("LoadString() failed!\r\n"); - pszString = NULL; - } - } - else - { - ERR("GetStringResource() failed to allocate string buffer!\r\n"); - } - - return pszString; -} - - -//////////////////////////////////////////////////////////////////////////////////// -// -// Wrapper to help retrive the PrinterDriverInfo, -// Note the MEM is orphaned by this call on success -// - -LPBYTE WrapGetPrinterDriver (HANDLE hHeap, HANDLE hPrinter, DWORD dwLevel) -{ - // - //Get the PrinterINFO so that we know where the driver help file is. - // - BOOL bGet = TRUE; - DWORD dwNeeded = 0; - LPBYTE pBuffer = NULL; - - bGet = GetPrinterDriver(hPrinter, NULL, dwLevel, pBuffer, 0, &dwNeeded); - - if(!bGet && GetLastError() == ERROR_INSUFFICIENT_BUFFER ) - { - SetLastError(ERROR_SUCCESS); // clear the previous result to prevent noise - pBuffer = (LPBYTE)HeapAlloc (hHeap, HEAP_ZERO_MEMORY, dwNeeded); - } - - if (pBuffer) - { - bGet = GetPrinterDriver(hPrinter, NULL, dwLevel, pBuffer, dwNeeded, &dwNeeded); - } - - if(!bGet || !pBuffer) - { - if (pBuffer) - { - HeapFree(hHeap, 0, pBuffer); - pBuffer = NULL; - } - - ERR("GetPrinterDriver() failed."); - } - - return pBuffer; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.h deleted file mode 100644 index 2fc12cba..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.h +++ /dev/null @@ -1,47 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.H -// -// PURPOSE: Define common data types, and external function prototypes -// for property sheet handling. -// - - -#pragma once - -#include "DEVMODE.H" -#include "globals.h" - -//////////////////////////////////////////////////////// -// Custom Help Defines -//////////////////////////////////////////////////////// - -#define CUSDRV_HELPTOPIC_1 15001 -#define CUSDRV_HELPTOPIC_2 15002 - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - -// OEM Signature and version. -#define PROP_TITLE L"OEM UI Page" -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -// Printer registry keys where OEM data is stored. -#define OEMUI_VALUE TEXT("OEMUI_VALUE") -#define OEMUI_DEVICE_VALUE TEXT("OEMUI_DEVICE_VALUE") - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, IPrintOemDriverUI* pOEMHelp); -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.rc b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.rc deleted file mode 100644 index e4d28716..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/oemui.rc +++ /dev/null @@ -1,170 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "OEM UI Test Module." - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "OEMUI" - VALUE "LegalCopyright", "Copyright © 1998 - 2003 Microsoft Corp." - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "OEMUI.dll" - VALUE "ProductName", "Microsoft OEMUI" - VALUE "ProductVersion", "1.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DEVICE_PROPPAGE DIALOG 0, 0, 179, 113 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Device Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Added Page",IDC_STATIC,55,14,68,11 - PUSHBUTTON "Calibrate",IDC_CALIBRATE,61,34,50,14 -END - -IDD_DOC_PROPPAGE DIALOG 0, 0, 210, 154 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Document Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Document Property Page",IDC_STATIC,60,73,108,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DEVICE_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 172 - TOPMARGIN, 8 - BOTTOMMARGIN, 106 - END - - IDD_DOC_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_SECTION "OEM UI Added Item" - IDS_CALIBRATED "Printer has been calibrated." - IDS_NAME "OEM UI Customization DLL" - IDS_HELPFILE "CUSTOMDRV.HLP" - IDS_DEV_SECTION "Device Settings OEM UI Added Item" - IDS_ADV_SECTION "Advanced OEM UI Added Item" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/precomp.h deleted file mode 100644 index ef4615ad..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/precomp.h +++ /dev/null @@ -1,54 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: PRECOMP.H -// -// PURPOSE: Optimize compilation of headers that do not change frequently -// - -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/custhlp/resource.h deleted file mode 100644 index 9c7732fe..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/custhlp/resource.h +++ /dev/null @@ -1,23 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: resource.h -// -// PURPOSE: Defines resources IDs for localizable resources. -// - - -#define IDS_SECTION 1 -#define IDS_CALIBRATED 2 -#define IDS_NAME 3 -#define IDS_HELPFILE 4 -#define IDS_DEV_SECTION 5 -#define IDS_ADV_SECTION 10 -#define IDD_DEVICE_PROPPAGE 106 -#define IDD_DOC_PROPPAGE 107 -#define IDC_CALIBRATE 1001 - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.gpd b/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.gpd deleted file mode 100644 index 20e4d472..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.gpd +++ /dev/null @@ -1,520 +0,0 @@ -*GPDFileName: "gdlsmpl.gpd" -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*ModelName: "OEM Unidrv GDL Sample" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 -*PrintRate: 16 -*PrintRateUnit: PPM -*PrintRatePPM: 16 - -*% -*% This line indicates which file the GDL parser should use to find Bidi information. -*% This is also the same file that will be parser when querying the GDL via -*% IPrintCoreHelperUni. GDL is compatible with GPD syntax, and this can be the driver's -*% GPD file, whis is what this sample does. -*% -*BidiQueryFile: "gdlsmpl.gpd" - - -*%****************************************************************************************** -*% Orientation -*%****************************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l0O" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *Cmd: "<1B>&l1O" - } - } -} - -*%****************************************************************************************** -*% Input Bin -*%****************************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: AUTO - *Option: AUTO - { - *rcNameID: =AUTO_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l0H" - } - } - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l1H" - } - } -} - -*%****************************************************************************************** -*% Resolution -*%****************************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: 300dpi - *Option: 300dpi - { - *Name: "300 x 300" =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } -} - -*%****************************************************************************************** -*% HP-GL/2 Graphics Support -*%****************************************************************************************** -*Ifdef: WINNT_51 -*Personality: =PERSONALITY_HPGL2 -*Feature: GraphicsMode -{ - *rcNameID: =GRAPHICSMODE_DISPLAY - *DefaultOption: HPGL2MODE - *Option: HPGL2MODE - { - *rcNameID: =GRAPHICSMODE_HPGL2_DISPLAY - } - *Option: RASTERMODE - { - *rcNameID: =GRAPHICSMODE_RASTER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.5 - *Cmd: "@PJL SET LIMAGEENHANCE=OFF<0A>" - } - } -} -*Endif: - -*%****************************************************************************************** -*% Paper Size -*%****************************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5260x7704Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7332x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5880x8900Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t8900x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(288, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(204, 13824) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t4970x7040Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t6780x4970Y" - } - } - } - } -} - -*%****************************************************************************************** -*% Outputbin -*%****************************************************************************************** - - -*Feature: OutputBin -{ - *rcNameID: =OUTPUTBIN_DISPLAY - *HelpIndex: 12006 - *DefaultOption: Option1 - *Option: Option1 - { - *% Auto Select - *Name: "default" - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "@PJL SET OUTBIN=OPTIONALOUTBIN2<0A>@PJL SET FINISH=NONE<0A>" - } - } - *Option: Option14 - { - *% Stacker - *Name: "stacker" *% Stacker - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "@PJL SET OUTBIN=OPTIONALOUTBIN2<0A>@PJL SET FINISH=NONE<0A>" - } - } -} - - -*%****************************************************************************************** -*% Media Type -*%****************************************************************************************** -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: PLAIN - *Option: PLAIN - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n6WdPlain" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n13WdTransparency" - } - } -} - - - -*%****************************************************************************************** -*% HalfTone -*%****************************************************************************************** -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%****************************************************************************************** -*% Memory -*% -*% Note: Unidrv uses the font memory information to estimate when it needs to stop -*% downloading fonts for a page, and thus driver writers should err on the conservative -*% side. Otherwise, printers will generate "out of memory" device errors for pages with -*% a large number of fonts / unique glyphs. -*%****************************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 32768KB - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } -} - -*%****************************************************************************************** -*% Page Protect -*%****************************************************************************************** -*Feature: PageProtect -{ - *rcNameID: =PAGE_PROTECTION_DISPLAY - *DefaultOption: OFF - *Option: ON - { - *rcNameID: =ON_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=LETTER<0A>" - } - } - *Option: OFF - { - *rcNameID: =OFF_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=OFF<0A>" - } - } -} - -*%****************************************************************************************** -*% Doc setup commands -*%****************************************************************************************** -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.7 - *Cmd: "<1B>&u1200D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X@PJL<20>LPORTROTATE<0A><1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.13 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} - -*%****************************************************************************************** -*% Cursor, Page and Color Commands -*%****************************************************************************************** -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT, RASTER, VECTOR) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel) }"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel) }"Y" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*%****************************************************************************************** -*% Font Descriptions and Commands -*%****************************************************************************************** -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*DeviceFonts: LIST(136,138,146,147,148,149,150,151,152,153,154,155,156,157, -+ 163,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) -*MinFontID: 16534 -*MaxFontID: 32768 -*FontFormat: HPPCL_OUTLINE -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } - - -*%******************************************************************************************** -*%* Vector Commands. -*%******************************************************************************************** -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.inf b/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.inf deleted file mode 100644 index 8794fa8e..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.ini b/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.ini deleted file mode 100644 index dd46570f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/res/gdlsmpl.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=GDLSMPL.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj deleted file mode 100644 index 8b4e5189..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj +++ /dev/null @@ -1,1084 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D} - $(MSBuildProjectName) - Win10 Debug - Win32 - {54379D65-81DC-4846-87B8-91904DFAD95D} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - GDLSMPL - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(AdditionalIncludeDirectories) - - - %(AdditionalIncludeDirectories) - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories) - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib;msxml6.lib - GDLSMPL.def - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj.Filters deleted file mode 100644 index 6031427f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/GDLSMPL.vcxproj.Filters +++ /dev/null @@ -1,134 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {AA9642FD-4376-4AA6-BEBD-F068AD5C8036} - - - h;hpp;hxx;hm;inl;inc;xsd - {C5C6C5CD-8656-4525-B00D-B1F5AEFAA986} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {7600E0E1-C09C-435F-9EE5-6AE7AF0E62AA} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.cpp deleted file mode 100644 index 0654e1b5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.cpp +++ /dev/null @@ -1,251 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: devmode.cpp -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// -//-------------------------------------------------------------------------- - -#include "precomp.h" - -#include "debug.h" -#include "devmode.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -BOOL -ConvertOEMDevmode( - _In_ PCOEMDEV pOEMDevIn, - _Inout_ POEMDEV pOEMDevOut - ); - -BOOL -MakeOEMDevmodeValid( - _Out_ POEMDEV pOEMDevmode - ); - -//+--------------------------------------------------------------------------- -// -// Member: -// ::hrOEMDevMode -// -// Synopsis: -// Performs operation on UI Plugins Private DevMode Members. -// Called via IOemUI::DevMode -// -// Returns: -// S_OK or E_FAIL. For more detailed failure info, -// check GetLastError -// -// Last error: -// ERROR_INVALID_PARAMETER -// -// -//---------------------------------------------------------------------------- -HRESULT -hrOEMDevMode( - DWORD dwMode, - // Indicates which operation should be performed - _Inout_ POEMDMPARAM pOemDMParam - // contains various data structures needed by this - // routine. The usage of this struct is determined by - // the dwMode flag. - ) -{ - HRESULT hr = S_OK; - // Return value. - - // - // Verify parameters. - // - if ((NULL == pOemDMParam) || - ((OEMDM_SIZE != dwMode) && - (OEMDM_DEFAULT != dwMode) && - (OEMDM_CONVERT != dwMode) && - (OEMDM_MERGE != dwMode))) - { - ERR("DevMode() ERROR_INVALID_PARAMETER.\r\n"); - - SetLastError(ERROR_INVALID_PARAMETER); - hr = E_FAIL; - } - else - { - POEMDEV pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn;; - // Pointer to the supplied OEM devmode data, if applicable - // based on dwMode. - - POEMDEV pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut;; - // Pointer to the DEVMODE data that this routine is - // expected to configure, if applicable based on dwMode. - - switch (dwMode) - { - // - // The Method should return the size of the memory allocation - // needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - // - //Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - // - //OEM_DMEXTRAHEADER Members - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - break; - - // - // The method should convert private DEVMODE members to - // the current version, if necessary. - // - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - // - // The method should validate the information contained in private - // DEVMODE members and merge validated values into a private - // DEVMODE structure containing default values - // - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - } - - return hr; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::ConvertOEMDevmode -// -// Synopsis: -// confirm that the private DEVMODE being passed in is data that -// this driver recognizes, read the settings from the input -// OEM DEVMODE data, and write them to pOEMDevOut. -// -// Returns: -// True unless the routine was called with null pointers -// -// -//---------------------------------------------------------------------------- -BOOL -ConvertOEMDevmode( - _In_ PCOEMDEV pOEMDevIn, - // Caller supplied DEVMODE that we are attempting to read - _Inout_ POEMDEV pOEMDevOut - // OEM private DEVMODE configured by this routine based on the settings - // in pOEMDevIn - ) -{ - if ((NULL == pOEMDevIn) || - (NULL == pOEMDevOut)) - { - ERR("ConvertOEMDevmode() invalid parameters.\r\n"); - return FALSE; - } - - // - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - // - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - // - // Copy the old structure in to the new using which ever size is the - // smaller. Devmode maybe from newer Devmode (not likely since there - // is only one), or Devmode maybe a newer Devmode, in which case it - // maybe larger, but the first part of the structure should be the same. - // - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get - // added to the end. - // - memcpy(pOEMDevOut, - pOEMDevIn, - __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - - // - // If the plug-in is capable of recognizing multiple versions of it's - // private DEVMODE data add custom handling here to support it. - // - } - else - { - WARNING("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n"); - - // - // The private DEVMODE data is not something that this plug-in understands, - // so use defaults. - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - - return TRUE; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::MakeOEMDevmodeValid -// -// Synopsis: -// Force the OEM devmode settings to valid values. -// -// Returns: -// True if the OEMDEV was configured, else FALSE. Only return false if -// the parameter is NULL. -// -// -//---------------------------------------------------------------------------- -BOOL -MakeOEMDevmodeValid( - _Out_ POEMDEV pOEMDevmode - // OEM DEVMODE data to modify - ) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // - // Assumption: pOEMDevmode is large enough to contain OEMDEV structure. - // - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - return TRUE; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.h deleted file mode 100644 index 791b1a20..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/devmode.h +++ /dev/null @@ -1,52 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: devmode.h -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -//-------------------------------------------------------------------------- - -#pragma once - -#define OEM_SIGNATURE 'GDLS' -#define OEM_VERSION 0x00000001L - -// -// OEM private DEVMODE data structure. This gets included in the DEVMODE -// used by Unidrv. -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - // This structure MUST be prefixed by OEM_DMEXTRAHEADER - - // - // Add private DevMode members here, after the standard header - // information. - // - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - -// -// Prototypes -// - -HRESULT -hrOEMDevMode( - DWORD dwMode, - _Inout_ POEMDMPARAM pOemDMParam - ); - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.cpp b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.cpp deleted file mode 100644 index 6d8fd195..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.cpp +++ /dev/null @@ -1,856 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: gdlsmpl.cpp -// -// PURPOSE: Implementation of interface for Unidrv5 UI plug-ins. -// -//-------------------------------------------------------------------------- - -#include "precomp.h" - -#include "debug.h" -#include "devmode.h" -#include "intrface.h" -#include "gdlsmpl.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//-------------------------------------------------------------------------- -// Globals -//-------------------------------------------------------------------------- - -HINSTANCE ghInstance = NULL; - // Module's Instance handle from DLLEntry of process. - - -//-------------------------------------------------------------------------- -// Internal Globals -//-------------------------------------------------------------------------- - -static long g_cComponents = 0; - // Count of active components - -static long g_cServerLocks = 0; - // Count of locks - - -//-------------------------------------------------------------------------- -// Local helper functions -//-------------------------------------------------------------------------- -BOOL __stdcall -DebugPrint( - LPCWSTR pszMessage, - // Format string for the error message - ... - // args specified in the format string. - ) -{ - va_list arglist; - // varargs list for processing the '...' parameter. - - WCHAR szMsgBuf[MAX_PATH] = {0}; - // Use a stack error buffer so that we don't need to - // allocate in the failure path. - - HRESULT hResult; - // Result from formatting the string. - - if (NULL == pszMessage) - { - return FALSE; - } - - // Pass the variable parameters to wvsprintf to be formated. - va_start(arglist, pszMessage); - hResult = StringCbVPrintfW(szMsgBuf, MAX_PATH*sizeof(szMsgBuf[0]), pszMessage, arglist); - va_end(arglist); - - // Dump string to debug output. - OutputDebugStringW(szMsgBuf); - - return SUCCEEDED(hResult); -} - - -//-------------------------------------------------------------------------- -// Class factory for the Plug-In object -//-------------------------------------------------------------------------- -class COemCF : public IClassFactory -{ -public: - - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - LPVOID FAR* ppvObj - ); - - STDMETHOD_(ULONG,AddRef) (THIS); - - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // IClassFactory methods - STDMETHOD(CreateInstance) (THIS_ - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppvObject - ); - - STDMETHOD(LockServer) (THIS_ - BOOL bLock - ); - - // Class-specific methods. - COemCF(): m_cRef(1) { }; - - ~COemCF() { }; - -protected: - LONG m_cRef; - -}; - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::DllMain -// -// Synopsis: -// Dll's main routine, called when new -// threads or processes reference the module -// -// Returns: -// TRUE. Currently has no failure paths. Return false if the module -// cannot be properly initialized. -// -// Notes: -// the caller of this routine holds a process-wide lock preventing more -// than one module from being initialized at a time. In general, -// plug-ins should do as little as possible in this routine to avoid -// stalling other threads that may need to load modules. Also, calling -// any function that would, in-turn, cause another module to be loaded -// could result in a deadlock. -// -// -//---------------------------------------------------------------------------- -extern "C" BOOL -WINAPI DllMain( - HINSTANCE hInst, - WORD wReason, - LPVOID lpReserved - ) -{ - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - break; - - case DLL_PROCESS_DETACH: - break; - - case DLL_THREAD_DETACH: - break; - } - - return TRUE; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// ::DllCanUnloadNow -// -// Synopsis: -// Can the DLL be unloaded from memory? Answers no if any objects are -// still allocated, or if the server has been locked. -// -// To avoid leaving OEM DLL still in memory when Unidrv or Pscript -// drivers are unloaded, Unidrv and Pscript driver ignore the return -// value of DllCanUnloadNow of the OEM DLL, and always call FreeLibrary -// on the OEMDLL. -// -// If the plug-in spins off a working thread that also uses this DLL, -// the thread needs to call LoadLibrary and FreeLibraryAndExitThread, -// otherwise it may crash after Unidrv or Pscript calls FreeLibrary. -// -// Returns: -// S_OK if the DLL can be unloaded safely, otherwise S_FALSE -// -// -//---------------------------------------------------------------------------- -STDAPI DllCanUnloadNow() -{ - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::DllGetClassObject -// -// Synopsis: -// Retrieve the class factory object for the indicated class. -// -// Returns: -// CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, or S_OK. -// -// Notes: -// -// -//---------------------------------------------------------------------------- -STDAPI -DllGetClassObject( - _In_ CONST CLSID& clsid, - // GUID of the class object that the caller wants a class factory for - _In_ CONST IID& iid, - // Interface ID to provide in ppv - _Outptr_ VOID** ppv - // out pointer to the interface requested. - ) -{ - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // - // Can we create this component? - // - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE; - } - - // - // Create class factory. - // Reference count set to 1 in Constructor - // - COemCF* pGDLSampleClassFactory = new COemCF; - if (pGDLSampleClassFactory == NULL) - { - return E_OUTOFMEMORY; - } - - // - // Get requested interface. - // - HRESULT hr = pGDLSampleClassFactory->QueryInterface(iid, ppv); - pGDLSampleClassFactory->Release(); - - return hr; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::QueryInterface -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemCF::QueryInterface( - CONST IID& iid, - VOID** ppv - ) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::AddRef -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -ULONG __stdcall -COemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::Release -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -COemCF::Release() -{ - assert(0 != m_cRef); - - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - } - return cRef; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::CreateInstance -// -// Synopsis: -// Attempt to create an object that implements the specified interface. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemCF::CreateInstance( - _In_opt_ IUnknown* pUnknownOuter, - _In_ CONST IID& iid, - _Outptr_ VOID** ppv - ) -{ - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // - // Cannot aggregate. - // - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - HRESULT hr = S_OK; - - if (iid == IID_IUnknown || - iid == IID_IPrintOemUI2) - { - // - // Create component. - // - COemUI2* pOemCB = new COemUI2; - if (pOemCB == NULL) - { - hr = E_OUTOFMEMORY; - } - else - { - // - // Get the requested interface. - // - hr = pOemCB->QueryInterface(iid, ppv); - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pOemCB->Release(); - } - } - else - { - hr = E_NOINTERFACE; - } - - return hr; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::LockServer -// -// Synopsis: -// Locking the server holds the objects server in memory, so that new -// instances of objects can be created more quickly. -// -// Returns: -// S_OK -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemCF::LockServer( - BOOL bLock - // If true, increment the lock count, otherwise decrement the lock - // count. - ) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - - return S_OK; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2 (destructor) -// -// Synopsis: -// Release the helper interface, as well as any other resources that -// the plug-in is holding onto. -// -// Returns: -// -// Notes: -// -// -//---------------------------------------------------------------------------- -COemUI2::~COemUI2() -{ - // - // Make sure that helper interface is released. - // - if(NULL != m_pCoreHelper) - { - m_pCoreHelper->Release(); - m_pCoreHelper = NULL; - } - - // - // If this instance of the object is being deleted, then the reference - // count should be zero. - // - assert(0 == m_cRef); -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::PublishDriverInterface -// -// Synopsis: -// This routine is called by the core driver to supply objects to the -// plug-in which the plug-in can use to implement various features. -// -// This implementation requires an object that IPrintCoreHelper interface -// from the core driver to implement full UI replacement. If the object -// passed in is the one desired, this routine will return S_OK, otherwise -// it will return E_FAIL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::PublishDriverInterface( - IUnknown *pIUnknown - ) -{ - HRESULT hr = S_OK; - - // - // Save a pointer to the IPrintCoreHelperUni interface. This will allow - // the plug-in to access it's GDL file (which can be it's GPD file as well) - // - if (m_pCoreHelper == NULL) - { - hr = pIUnknown->QueryInterface(IID_IPrintCoreHelperUni, (VOID**) &(m_pCoreHelper)); - - if (!SUCCEEDED(hr)) - { - m_pCoreHelper = NULL; - hr = E_FAIL; - } - } - - return hr; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::GetInfo -// -// Synopsis: -// Most of this routine is a standard implementation common to most -// plug-ins. Of particular note in this sample is that to get a handle -// the IPrintCoreHelper plug-in in the PublishDriverInterface callback, -// this routine must return OEMPUBLISH_IPRINTCOREHELPER in the out -// parameter when the mode is OEMGI_GETREQUESTEDHELPERINTERFACES. -// -// Returns: -// S_OK for supported modes, E_FAIL for everything else. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::GetInfo( - DWORD dwMode, - // The mode indicates what information is being requested by the - // core driver. - _Out_writes_bytes_(cbSize) PVOID pBuffer, - // The output buffer is the location into which the requested info - // should be written - DWORD cbSize, - // The size of the output buffer. - PDWORD pcbNeeded - // If the size of the buffer is insufficient, use this parameter - // to indicate to the core driver how much space is required. - ) -{ - HRESULT hrResult = S_OK; - - // - // Validate parameters. OEMGI_GETPUBLISHERINFO is excluded from this - // list because that GetInfo mode applies only to PScript rendering plug-ins. - // - if ((NULL == pcbNeeded) || - ((OEMGI_GETSIGNATURE != dwMode) && - (OEMGI_GETVERSION != dwMode) && - (OEMGI_GETREQUESTEDHELPERINTERFACES != dwMode))) - { - WARNING("COemUI2::GetInfo() exit pcbNeeded is NULL or mode is not supported\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // - // Set expected buffer size and number of bytes written. - // - *pcbNeeded = sizeof(DWORD); - - // - // Check buffer size is sufficient. - // - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING("COemUI2::GetInfo() exit insufficient buffer!\r\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - hrResult = E_FAIL; - } - else - { - switch(dwMode) - { - // - // OEM DLL Signature - // - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // - // OEM DLL version - // - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // - // The UI is asking whether the plug-in uses the IPrintCoreHelper based - // helper object. Indicate that the plug-in does need this object. - // - case OEMGI_GETREQUESTEDHELPERINTERFACES: - *(PDWORD)pBuffer = 0; - *(PDWORD)pBuffer |= OEMPUBLISH_IPRINTCOREHELPER; - break; - - // - // dwMode not supported. - // - default: - // - // Set written bytes to zero since nothing was written. - // - WARNING("COemUI2::GetInfo() exit mode not supported.\r\n"); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - hrResult = E_FAIL; - } - } - - return hrResult; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DevMode -// -// Synopsis: -// This routine operates in various modes to manage the private DEVMODE. -// This sample does not provide much by way of illustration of how to -// handle OEM settings in the private DEVMODE. See the sample OEMUI for -// a more in-depth look at this routine. The function hrOEMDevMode in -// devmode.cpp also provides more information on how to handle the various -// modes. -// -// Returns: -// S_OK on success, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DevMode( - DWORD dwMode, - // The operation that should be performed - POEMDMPARAM pOemDMParam - // The input & output DEVMODEs, including pointers to the public & - // private DEVMODE data. - ) -{ - return hrOEMDevMode(dwMode, pOemDMParam); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DocumentPropertySheets -// -// Synopsis: -// Show the GPD version in the debugger whenever the -// printing preferences UI is shown. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ) -{ - UNREFERENCED_PARAMETER(pPSUIInfo); - UNREFERENCED_PARAMETER(lParam); - - this->DbgShowGPDVersion(); - - return S_OK; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DbgShowGPDVersion -// -// Synopsis: -// Display the GPD version in the debugger using a GDL snapshot & MSXML 6 -// To make this work on versions of Windows prior to Windows Vista, change -// references to MSXML 6 with MSXML 3. -// -// -//---------------------------------------------------------------------------- -HRESULT -COemUI2::DbgShowGPDVersion() -{ - HRESULT hr; - IXMLDOMDocument2 *pDOMSnapshot = NULL; - IXMLDOMNode *pVersionNode = NULL; - - // - // Get a DOM representation of the snapshot using MSXML 3 - // - hr = LoadGDLSnapshot(&pDOMSnapshot); - - if (hr == REGDB_E_CLASSNOTREG) - { - DebugPrint(L"COemUI2::PublishHelperInterface: MSXML 6.0 not registered, GDL version lookup disabled\r\n"); - } - - // - // Find the GDL node that contains the GPDFileVersion. This should return a single XML DOM Element. - // - if (SUCCEEDED(hr)) - { - hr = pDOMSnapshot->selectSingleNode((BSTR)TEXT("//gdl:SnapshotRoot/gdl:GDL_ATTRIBUTE[@Name=\"*GPDFileVersion\"]"), &pVersionNode); - } - - // - // If the node was found, write the version information to the debugger. - // It's content is represented as CDATA in the XML, but MSXML will - // normalize that to a regular string when it parses the XML. - // - if (SUCCEEDED(hr) && pVersionNode) - { - VARIANT varVersionString; - - // - // Get DefaultOption name - // - hr = pVersionNode->get_nodeTypedValue(&varVersionString); - - if (SUCCEEDED(hr)) - { - DebugPrint(L"COemUI2::PublishHelperInterface: GDL Version: %s\r\n", varVersionString.bstrVal); - } - - VariantClear(&varVersionString); - } - - if (pDOMSnapshot) - { - pDOMSnapshot->Release(); - pDOMSnapshot = NULL; - } - - return hr; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::LoadGDLSnapshot -// -// Synopsis: -// Load the GDL snapshot from IPrintCoreHelperUni into a DOM object, -// and set appropriate properties on the DOM to prepare it for use -// with xpath queries. -// -// -//---------------------------------------------------------------------------- -HRESULT -COemUI2::LoadGDLSnapshot( - _Out_ IXMLDOMDocument2 **ppDOMSnapshot - ) -{ - HRESULT hr = S_OK; - IStream *pSnapshotStream = NULL; - VARIANT_BOOL loadResult = 0; - - if (!ppDOMSnapshot) - { - return E_INVALIDARG; - } - - (*ppDOMSnapshot) = NULL; - - hr = m_pCoreHelper->CreateDefaultGDLSnapshot(0, &pSnapshotStream); - - if (SUCCEEDED(hr)) - { - // - // Create DOM document - // - hr = m_pCoreHelper->CreateInstanceOfMSXMLObject(CLSID_DOMDocument60, - NULL, - CLSCTX_INPROC_SERVER, - IID_IXMLDOMDocument2, - (LPVOID *)ppDOMSnapshot); - } - - if (SUCCEEDED(hr)) - { - VARIANT streamVar; - - VariantInit(&streamVar); - V_VT(&streamVar) = VT_UNKNOWN; - V_UNKNOWN(&streamVar) = pSnapshotStream; - pSnapshotStream->AddRef(); - - // - // Load the snapshot into the DOM document - // - (*ppDOMSnapshot)->put_async(VARIANT_FALSE); - (*ppDOMSnapshot)->put_validateOnParse(VARIANT_FALSE); - (*ppDOMSnapshot)->put_resolveExternals(VARIANT_FALSE); - - hr = (*ppDOMSnapshot)->load(streamVar, &loadResult); - - VariantClear(&streamVar); - } - - // - // If the DOM fails to load, the HRESULT will be S_FALSE, so explicitly - // look for S_OK. - // - if (hr == S_OK) - { - // - // Set the namespaces that should be available for xpath queries later. - // - BSTR bstrDefNameSpace = SysAllocString(TEXT("xmlns:gdl=\"http://schemas.microsoft.com/2002/print/gdl/1.0\"")); - - if (!bstrDefNameSpace) - { - hr = E_OUTOFMEMORY; - } - - if (SUCCEEDED(hr)) - { - VARIANT varDefNameSpace; - - VariantInit(&varDefNameSpace); - varDefNameSpace.vt = VT_BSTR; - varDefNameSpace.bstrVal = bstrDefNameSpace; - - hr = (*ppDOMSnapshot)->setProperty((BSTR)TEXT("SelectionNamespaces"), varDefNameSpace); - SysFreeString(bstrDefNameSpace); - } - } - else - { - hr = E_FAIL; - } - - if (FAILED(hr) && *ppDOMSnapshot) - { - (*ppDOMSnapshot)->Release(); - (*ppDOMSnapshot) = NULL; - } - - if (pSnapshotStream) - { - pSnapshotStream->Release(); - pSnapshotStream = NULL; - } - - return hr; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.def b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.def deleted file mode 100644 index d9534de1..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.def +++ /dev/null @@ -1,18 +0,0 @@ -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -; -; Abstract: -; -; This file contains a listing of all of the methods to be exported -; from the DLL, as well as rules for how to name the exports. -; - -LIBRARY GDLSMPL - -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.h b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.h deleted file mode 100644 index 77ba7647..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.h +++ /dev/null @@ -1,79 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: gdlsmpl.h -// -// PURPOSE: COM implementation of a UI module that uses GDL. CAbstractOemUI2 -// is defined in intrface.h, and contains a default implementation of -// all optional interface methods. -// -//-------------------------------------------------------------------------- - -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -extern HINSTANCE ghInstance; - // Module's Instance handle from DLLEntry of process. - -class COemUI2: public CAbstractOemUI2 -{ -public: - - COemUI2() : - m_pCoreHelper(NULL) - {} - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - STDMETHOD(GetInfo) (THIS_ - DWORD dwMode, - _Out_writes_bytes_(cbSize) PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam); - - // - // OEMDocumentPropertySheets - // - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - virtual ~COemUI2(); - -protected: - - HRESULT - DbgShowGPDVersion(); - - HRESULT - LoadGDLSnapshot( - _Out_ IXMLDOMDocument2 **ppDOMSnapshot - ); - - IPrintCoreHelperUni* m_pCoreHelper; - // Pointer to the helper interface introduced in Windows Vista. -}; - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.rc b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.rc deleted file mode 100644 index 5cd078df..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/gdlsmpl.rc +++ /dev/null @@ -1,106 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: gdlsmpl.rc -// -// PURPOSE: Resource script containing all localizable strings for this -// module -// -//-------------------------------------------------------------------------- - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Developed by Microsoft Corp." - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "GDL Sample Printer UI Module" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "GDLSMPL" - VALUE "LegalCopyright", "Copyright © 1998 - 2006 Microsoft Corp." - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "GDLSMPL.dll" - VALUE "ProductName", "Microsoft GDL Sample Driver" - VALUE "ProductVersion", "1.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.cpp deleted file mode 100644 index d399712d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.cpp +++ /dev/null @@ -1,559 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// PURPOSE: Generic abstract base class useful for creating implementation -// of interface for Unidrv5 UI plug-ins. This base class -// implements all methods which have a standard implementation -// and / or are optional. Non-optional mathods are pure virtual -// in this base class. -// -//-------------------------------------------------------------------------- - -#include "precomp.h" - -#include "debug.h" -#include "devmode.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::QueryInterface -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::QueryInterface( - CONST IID& iid, - VOID** ppv - ) -{ - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - } - else if (iid == IID_IPrintOemUI2) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::AddRef -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -ULONG __stdcall -CAbstractOemUI2::AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::Release -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -CAbstractOemUI2::Release() -{ - ASSERT(0 != m_cRef); - - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (0 == cRef) - { - delete this; - return 0; - - } - - return cRef; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::HideStandardUI -// -// Synopsis: -// This routine is critical to supporting full UI replacement. This -// routine allows the plug-in to disable Unidrv's (or PScript's) standard -// UI panels. If this returns E_NOTIMPL, the panel isn't hidden. If -// this routine returns S_OK, Unidrv will not display any UI for the -// specified mode. If this returns E_NOTIMPL, Unidrv will display it's -// standard UI. -// -// Returns: -// S_OK to hide the indicated UI if desired, otherwise E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::HideStandardUI( - DWORD dwMode - // document property sheets, printer property sheets, or possibly - // something not yet defined. - ) -{ - UNREFERENCED_PARAMETER(dwMode); - - return E_NOTIMPL; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::DocumentPropertySheets -// -// Synopsis: -// A plug-in may optionally add property sheets. If the plug-in has -// chosen to hide the standard UI, then it would instead provide -// replacements for the standard property sheets. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ) -{ - UNREFERENCED_PARAMETER(pPSUIInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::DevicePropertySheets -// -// Synopsis: -// A plug-in may optionally add property sheets. If the plug-in has -// chosen to hide the standard UI, then it would instead provide -// replacements for the standard property sheets. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ) -{ - UNREFERENCED_PARAMETER(pPSUIInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::CommonUIProp -// -// Synopsis: -// This routine is used to interact with the Unidrv-supplied -// property sheet pages. Since this plug-in implements full-UI -// replacement, those property sheet pages are disabled, and this -// routine does not need to do anything. -// -// Returns: -// S_OK -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ) -{ - UNREFERENCED_PARAMETER(dwMode); - UNREFERENCED_PARAMETER(pOemCUIPParam); - - return E_NOTIMPL; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::DeviceCapabilities -// -// Synopsis: -// This routine can be used to replace the Unidrv's device capabilities -// handling. In this implementation, no custom capabilities handling is -// provided. -// -// Returns: -// E_FAIL -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::DeviceCapabilities( - _Inout_ POEMUIOBJ poemuiobj, - // OEM settings & information - _In_ HANDLE hPrinter, - // Handle to the printer that the capabilities are being requested for - _In_ PWSTR pDeviceName, - // Name of the device / driver - WORD wCapability, - // The DC_ ID indicating which capability was requested. - _Out_ PVOID pOutput, - // Buffer to write requested information to. - _In_ PDEVMODE pPublicDM, - // Pointer to the public DEVMODE representing the settings to get - // capabilities with respect to. - _In_ PVOID pOEMDM, - // OEM private DEVMODE settings. - DWORD dwOld, - // Result from previous plug-in call to this routine. - _Out_ DWORD *dwResult - // Result of this call. If there are multiple UI plug-ins, this - // result is passed to the next one as dwOld - ) -{ - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - // - // Do nothing. Let Unidrv handle the device capabilities processing. - // - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::DevQueryPrintEx -// -// Synopsis: -// This routine is used to determine print job compatibility with the -// current driver. The plug-in can supplement Unidrv's handling of this -// routine. If Unidrv determines that a job can be printed on the current -// printer it will call this routine to ask the plug-in whether it can -// also handle the current job. If Unidrv determines that the job cannot -// be printed, it will not call the plug-in. Additionally, XPS drivers -// built on the Unidrv and PScript UI modules may not recieve this call- -// back. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ) -{ - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::UpgradePrinter -// -// Synopsis: -// Use this callback to upgrade any settings from previous versions -// that are stored in the registry by the plug-in Not applicabe to -// this sample. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ) -{ - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::PrinterEvent -// -// Synopsis: -// Perform any special processing needed when various events occur to the -// print queue. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ) -{ - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::DriverEvent -// -// Synopsis: -// Notifies the plug-in of changes or events relevant to the driver, -// such as installing and upgrading. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ) -{ - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::QueryColorProfile -// -// Synopsis: -// This routine can be implemented to provide a color profile from the -// driver. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData - ) -{ - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(ulQueryMode); - UNREFERENCED_PARAMETER(pvProfileData); - UNREFERENCED_PARAMETER(pcbProfileData); - UNREFERENCED_PARAMETER(pflProfileData); - - return E_NOTIMPL; -}; - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::FontInstallerDlgProc -// -// Synopsis: -// Plug-ins can use this method to replace Unidrv's provided soft-font -// installer dialog. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ) -{ - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::UpdateExternalFonts -// -// Synopsis: -// This routine is used to notify the UI of any changes to installed -// font cartridges, primarily for supporting soft-font UI replacement. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::UpdateExternalFonts( - _In_ HANDLE hPrinter, - _In_ HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ) -{ - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::QueryJobAttributes -// -// Synopsis: -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::QueryJobAttributes( - HANDLE hPrinter, - PDEVMODE pDevmode, - DWORD dwLevel, - LPBYTE lpAttributeInfo - ) -{ - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDevmode); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(lpAttributeInfo); - - return E_NOTIMPL; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CAbstractOemUI2::DocumentEvent -// -// Synopsis: -// Perform any special processing needed at various points in time while -// a job is printing. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -CAbstractOemUI2::DocumentEvent( - HANDLE hPrinter, - HDC hdc, - INT iEsc, - ULONG cbIn, - PVOID pbIn, - ULONG cbOut, - PVOID pbOut, - PINT piResult - ) -{ - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hdc); - UNREFERENCED_PARAMETER(iEsc); - UNREFERENCED_PARAMETER(cbIn); - UNREFERENCED_PARAMETER(pbIn); - UNREFERENCED_PARAMETER(cbOut); - UNREFERENCED_PARAMETER(pbOut); - UNREFERENCED_PARAMETER(piResult); - - return E_NOTIMPL; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.h deleted file mode 100644 index 07e1175c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/intrface.h +++ /dev/null @@ -1,212 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.h -// -// PURPOSE: Defines a class with default implementations of the UI -// interface plug=-in methods that are optional. -// -//-------------------------------------------------------------------------- - -#pragma once - -class CAbstractOemUI2: public IPrintOemUI2 -{ -public: - // - // *** IUnknown methods *** - // - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown) = 0; - - // - // Get OEM dll related information - // - STDMETHOD(GetInfo) (THIS_ - DWORD dwMode, - _Out_writes_bytes_(cbSize) PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) = 0; - - // - // OEMDevMode - // - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) = 0; - - // - // OEMCommonUIProp - // - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - STDMETHOD(DeviceCapabilities) (THIS_ - _Inout_ POEMUIOBJ poemuiobj, - _In_ HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - _Out_ PVOID pOutput, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM, - DWORD dwOld, - _Out_ DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - STDMETHOD( QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - STDMETHOD(UpdateExternalFonts) (THIS_ - _In_ HANDLE hPrinter, - _In_ HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - // - // IPrintOemUI2 methods - // - - // - // QueryJobAttributes - // - STDMETHOD(QueryJobAttributes) (THIS_ - HANDLE hPrinter, - PDEVMODE pDevmode, - DWORD dwLevel, - LPBYTE lpAttributeInfo - ); - - // - // Hide Standard UI - // - STDMETHOD(HideStandardUI) (THIS_ - DWORD dwMode - ); - - // - // DocumentEvent - // - STDMETHOD(DocumentEvent) (THIS_ - HANDLE hPrinter, - HDC hdc, - INT iEsc, - ULONG cbIn, - PVOID pbIn, - ULONG cbOut, - PVOID pbOut, - PINT piResult - ); - - CAbstractOemUI2() - { - m_cRef = 1; - }; - - virtual ~CAbstractOemUI2() {}; - -protected: - - LONG m_cRef; - // reference count of this object - -}; - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precomp.h deleted file mode 100644 index 0533325f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precomp.h +++ /dev/null @@ -1,62 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2006 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.h -// -// PURPOSE: Header files that should be in the precompiled header. -// -//-------------------------------------------------------------------------- - -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// -// These files should always be last in your include list. -// -#include -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/gdl/src/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oem.gpd b/print/OEM Printer Customization Plug-in Samples/C++/oem.gpd deleted file mode 100644 index 2621cbb1..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oem.gpd +++ /dev/null @@ -1,704 +0,0 @@ -*GPDFileName: "oem.gpd" -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*Include: "ttfsub.gpd" -*ModelName: "OEM Unidrv Customization Sample" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 -*PrintRate: 16 -*PrintRateUnit: PPM -*PrintRatePPM: 16 - -*%****************************************************************************************** -*% Orientation -*%****************************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l0O" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *Cmd: "<1B>&l1O" - } - } -} - -*%****************************************************************************************** -*% Input Bin -*%****************************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: AUTO - *Option: AUTO - { - *rcNameID: =AUTO_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l0H" - } - } - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l1H" - } - } -} - -*%****************************************************************************************** -*% Resolution -*%****************************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: Option2 - *Option: Option1 - { - *Name: "600 x 600" =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=600<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t600R" - } - } - *Option: Option2 - { - *Name: "300 x 300" =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } - *Option: Option3 - { - *Name: "150 x 150" =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(150, 150) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=150<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t150R" - } - } -} - -*%****************************************************************************************** -*% HP-GL/2 Graphics Support -*%****************************************************************************************** -*Ifdef: WINNT_51 -*Personality: =PERSONALITY_HPGL2 -*Feature: GraphicsMode -{ - *rcNameID: =GRAPHICSMODE_DISPLAY - *DefaultOption: RASTERMODE - *Option: HPGL2MODE - { - *rcNameID: =GRAPHICSMODE_HPGL2_DISPLAY - } - *Option: RASTERMODE - { - *rcNameID: =GRAPHICSMODE_RASTER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "@PJL SET LIMAGEENHANCE=OFF<0A>" - } - } -} -*Endif: - -*%****************************************************************************************** -*% Paper Size -*%****************************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5260x7704Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7332x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5880x8900Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t8900x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(288, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(204, 13824) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t4970x7040Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t6780x4970Y" - } - } - } - } -} - -*%****************************************************************************************** -*% Media Type -*%****************************************************************************************** -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: PLAIN - *Option: PLAIN - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n6WdPlain" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n13WdTransparency" - } - } -} - -*%****************************************************************************************** -*% Color Mode -*%****************************************************************************************** -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *DefaultOption: 24bpp - *Option: Mono - { - *rcNameID: =MONO_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 1 - *Color?: FALSE - } - *Option: Color - { - *rcNameID: =COLOR_DISPLAY - *DevNumOfPlanes: 3 - *DevBPP: 1 - *DrvBPP: 4 - EXTERN_GLOBAL: *RasterSendAllData?: TRUE - *ColorPlaneOrder: LIST(CYAN, MAGENTA, YELLOW) - *Command: CmdSendCyanData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } - *Command: CmdSendMagentaData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } - *Command: CmdSendYellowData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelectBlackColor { *Cmd : "<1B>*v7S" } - *Command: CmdSelectRedColor { *Cmd : "<1B>*v6S" } - *Command: CmdSelectGreenColor { *Cmd : "<1B>*v5S" } - *Command: CmdSelectYellowColor { *Cmd : "<1B>*v4S" } - *Command: CmdSelectBlueColor { *Cmd : "<1B>*v3S" } - *Command: CmdSelectMagentaColor { *Cmd : "<1B>*v2S" } - *Command: CmdSelectCyanColor { *Cmd : "<1B>*v1S" } - *Command: CmdSelectWhiteColor { *Cmd : "<1B>*v0S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*r-3U" - } - } - *Option: 8bpp - { - *rcNameID: =8BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 8 - *DrvBPP: 8 - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*t0I<1B>*l184O<1B>*v6W<000108080808>" - } - } - *Option: 24bpp - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 - *Command: CmdEnableDRC { *Cmd : "<1B>*b3M" } - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSetSrcBmpWidth { *Cmd : "<1B>*r" %d{RasterDataWidthInBytes / 3}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<0003080808081B>*v0a0b0c7i255a255b255c0I<1B>*" -+ "o3W<060400>" - } - } -} - -*%****************************************************************************************** -*% HalfTone -*%****************************************************************************************** -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%****************************************************************************************** -*% Memory -*% -*% Note: Unidrv uses the font memory information to estimate when it needs to stop -*% downloading fonts for a page, and thus driver writers should err on the conservative -*% side. Otherwise, printers will generate "out of memory" device errors for pages with -*% a large number of fonts / unique glyphs. -*%****************************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 32768KB - *Option: 4096KB - { - *Name: "4MB" - *MemoryConfigKB: PAIR(4096, 6750) - } - *Option: 8192KB - { - *Name: "8MB" - *MemoryConfigKB: PAIR(8192, 10350) - } - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 24576KB - { - *Name: "24MB" - *MemoryConfigKB: PAIR(24576, 21150) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } - *Option: 49152KB - { - *Name: "48MB" - *MemoryConfigKB: PAIR(49152, 43050) - } - *Option: 65536KB - { - *Name: "64MB" - *MemoryConfigKB: PAIR(65536, 57150) - } - *Option: 98304KB - { - *Name: "96MB" - *MemoryConfigKB: PAIR(98304, 85950) - } - *Option: 102400KB - { - *Name: "100MB" - *MemoryConfigKB: PAIR(102400, 89700) - } - *Option: 114688KB - { - *Name: "112MB" - *MemoryConfigKB: PAIR(114688, 100550) - } - *Option: 131072KB - { - *Name: "128MB" - *MemoryConfigKB: PAIR(131072, 116250) - } -} - -*%****************************************************************************************** -*% Duplex Unit -*%****************************************************************************************** -*Feature: DuplexUnit -{ - *rcNameID: 429 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *rcNameID: 444 - *DisabledFeatures: LIST(Duplex.VERTICAL, Duplex.HORIZONTAL) - } - *Option: TRUE - { - *rcNameID: 443 - } -} - -*%****************************************************************************************** -*% Duplex Type -*%****************************************************************************************** -*Feature: Duplex -{ - *rcNameID: =TWO_SIDED_PRINTING_DISPLAY - *DefaultOption: NONE - *Option: NONE - { - *rcNameID: =NONE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l0S" - } - } - *Option: VERTICAL - { - *rcNameID: =FLIP_ON_LONG_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l1S" - } - } - *Option: HORIZONTAL - { - *rcNameID: =FLIP_ON_SHORT_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l2S" - } - } -} - -*%****************************************************************************************** -*% Page Protect -*%****************************************************************************************** -*Feature: PageProtect -{ - *rcNameID: =PAGE_PROTECTION_DISPLAY - *DefaultOption: OFF - *Option: ON - { - *rcNameID: =ON_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=LETTER<0A>" - } - } - *Option: OFF - { - *rcNameID: =OFF_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=OFF<0A>" - } - } -} - -*%****************************************************************************************** -*% Doc setup commands -*%****************************************************************************************** -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.7 - *Cmd: "<1B>&u1200D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X@PJL<20>LPORTROTATE<0A><1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.13 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} - -*%****************************************************************************************** -*% Cursor, Page and Color Commands -*%****************************************************************************************** -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT, RASTER, VECTOR) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel) }"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel) }"Y" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*%****************************************************************************************** -*% Font Descriptions and Commands -*%****************************************************************************************** -*TTFSEnabled?: TRUE -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*DeviceFonts: LIST(136,138,146,147,148,149,150,151,152,153,154,155,156,157, -+ 163,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) -*MinFontID: 16534 -*MaxFontID: 32768 -*switch: Resolution -{ - *case: Option1 - { - *FontFormat: HPPCL_OUTLINE - } - *case: Option2 - { - *FontFormat: HPPCL_OUTLINE - } - *case: Option3 - { - *FontFormat: HPPCL_RES - } -} -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } - - -*%******************************************************************************************** -*%* Vector Commands. -*%******************************************************************************************** -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oem.ppd b/print/OEM Printer Customization Plug-in Samples/C++/oem.ppd deleted file mode 100644 index bbc93432..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oem.ppd +++ /dev/null @@ -1,431 +0,0 @@ -*PPD-Adobe: "4.3" -*% Adobe Systems PostScript(R) Printer Description File -*% Copyright (c) 2003 Microsoft Corp. All rights reserved. - -*FormatVersion: "4.3" -*FileVersion: "2.0" -*LanguageEncoding: ISOLatin1 -*LanguageVersion: English -*Product: "(MS OEM Customization)" -*PSVersion: "(2015.105) 9" -*Manufacturer: "Microsoft" -*ModelName: "Microsoft PS5 OEM Customization" -*ShortNickName: "MS PS5 Oem Customization" -*NickName: "MS PS5 Oem Customization" -*PCFileName: "PS5OEM.PPD" - -*% === Installable Options =========== -*OpenGroup: InstallableOptions/Options Installed - -*OpenUI *InstalledMemory/Memory Configuration: PickOne -*DefaultInstalledMemory: 24Meg -*InstalledMemory 24Meg/Standard 24 MB RAM: "" -*InstalledMemory 28Meg/28 MB Total RAM: "" -*InstalledMemory 40Meg/40 MB Total RAM: "" -*InstalledMemory 44Meg/44 MB Total RAM: "" -*InstalledMemory 56Meg/56 MB Total RAM: "" -*InstalledMemory 72Meg/72 MB Total RAM: "" -*CloseUI: *InstalledMemory - -*CloseGroup: InstallableOptions - -*% === Constraints =================== - - -*% === Basic Device Capabilities ============ - -*LanguageLevel: "2" -*Protocols: BCP - -*FreeVM: "5500000" -*VMOption 24Meg/Standard 24 MB RAM: "5500000" -*VMOption 28Meg/28 MB Total RAM: "8000000" -*VMOption 40Meg/40 MB Total RAM: "5400000" -*VMOption 44Meg/44 MB Total RAM: "8000000" -*VMOption 56Meg/56 MB Total RAM: "17400000" -*VMOption 72Meg/72 MB Total RAM: "3800000" - -*ColorDevice: True -*DefaultColorSpace: CMYK -*AccurateScreensSupport: True -*SuggestedJobTimeout: "0" -*SuggestedWaitTimeout: "300" -*SuggestedManualFeedTimeout: "60" -*End -*TTRasterizer: Type42 -*?TTRasterizer: " - save - 42 /FontType resourcestatus - { pop pop (Type42)} {pop pop (None)} ifelse = flush - restore" -*End - -*Emulators: hpgl -*StartEmulator_hpgl: "currentfile /hpgl statusdict /emulate get exec " -*StopEmulator_hpgl: "<1B7F>0" - -*FileSystem: True -*?FileSystem: " - save false - (%disk?%) - { currentdevparams dup /Writeable known - { /Writeable get {pop true} if } {pop} ifelse - } 10 string /IODevice resourceforall - {(True)}{(False)} ifelse = flush - restore" -*End -*Throughput: "14" -*Password: "(0)" -*ExitServer: " - count 0 eq - { false } { true exch startjob } ifelse - not - { (WARNING: Cannot modify initial VM.) = - (Missing or invalid password.) = - (Please contact the author of this software.) = flush quit - } if" -*End -*Reset: " - count 0 eq - { false } { true exch startjob } ifelse - not - { (WARNING: Cannot reset printer.) = - (Missing or invalid password.) = - (Please contact the author of this software.) = flush quit - } if - systemdict /quit get exec - (WARNING : Printer Reset Failed.) = flush" -*End - -*DefaultResolution: 600x600dpi -*?Resolution: " - save currentpagedevice - /HWResolution get - aload pop exch ( ) cvs print (x) print ( ) cvs print (dpi) - = flush - restore" -*End - -*% Halftone Information ================= - -*DefaultHalftoneType: 9 -*ScreenFreq: "60.0" -*ScreenAngle: "0.0" -*DefaultScreenProc: Null -*ScreenProc Null: "{}" - -*DefaultTransfer: Null -*Transfer Null: "{ }" -*Transfer Null.Inverse: "{ 1 exch sub }" - - -*% Tray Selection ============ - -*OpenUI *InputSlot: PickOne -*OrderDependency: 10 AnySetup *InputSlot -*DefaultInputSlot: Paper -*InputSlot Upper: " - (<<) cvx exec - /MediaPosition 0 - /MediaType null - /TraySwitch false - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Middle: " - (<<) cvx exec - /MediaPosition 1 - /MediaType null - /TraySwitch false - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Lower: " - (<<) cvx exec - /MediaPosition 2 - /MediaType null - /TraySwitch false - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Paper: " - (<<) cvx exec - /MediaPosition null - /MediaType (Paper) - /TraySwitch true - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Transparency: " - (<<) cvx exec - /MediaPosition null - /MediaType (Transparency) - /TraySwitch true - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot ManualPaper/Manual Paper: " - (<<) cvx exec - /MediaPosition null - /MediaType (Paper) - /TraySwitch false - /ManualFeed true - (>>) cvx exec setpagedevice" -*End -*InputSlot ManualTransparency/Manual Transparency: " - (<<) cvx exec - /MediaPosition null - /MediaType (Transparency) - /TraySwitch false - /ManualFeed true - (>>) cvx exec setpagedevice" -*End -*?InputSlot: " - save - currentpagedevice /MediaPosition get - dup null eq - { pop currentpagedevice /MediaType get - dup null eq - { pop (Upper) } - { dup (Paper) eq - { pop currentpagedevice /ManualFeed get - { (ManualPaper) } - { (Paper) } ifelse - } - { - (Transparency) eq - { currentpagedevice /ManualFeed get - { (ManualTransparency) } - { (Transparency) } ifelse - } - { (Unknown) } ifelse - } ifelse - } ifelse - } - { - dup 0 eq - { pop (Upper) } - { dup 1 eq - { pop (Middle) } - { 2 eq - { (Lower) } - { (Unknown) } ifelse - } ifelse - } ifelse - } ifelse - = flush restore" -*End -*CloseUI: *InputSlot - -*% Paper Handling =================== - -*% Use these entries to set paper size most of the time, unless there is -*% specific reason to use PageRegion. -*OpenUI *PageSize: PickOne -*OrderDependency: 20 AnySetup *PageSize -*DefaultPageSize: Letter -*PageSize Letter: "(<<) cvx exec /PageSize [612 792] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageSize Legal: "(<<) cvx exec /PageSize [612 1008] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageSize A4: "(<<) cvx exec /PageSize [595 842] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*?PageSize: " - save currentpagedevice /PageSize get aload pop - 2 copy gt {exch} if (Unknown) - (<<) cvx exec - [612 792] (Letter) - [612 1008] (Legal) - [595 842] (A4) (>>) cvx exec - { exch aload pop 4 index sub abs 5 le exch 5 index sub abs 5 le and - { exch pop exit } { pop } ifelse - } bind forall = flush pop pop - restore" -*End -*CloseUI: *PageSize - -*% These entries will set up the frame buffer. Usually used with manual feed. -*OpenUI *PageRegion: PickOne -*OrderDependency: 30 AnySetup *PageRegion -*DefaultPageRegion: Letter -*PageRegion Letter: "(<<) cvx exec /PageSize [612 792] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageRegion Legal: "(<<) cvx exec /PageSize [612 1008] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageRegion A4: "(<<) cvx exec /PageSize [595 842] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*CloseUI: *PageRegion - -*% The following entries provide information about specific paper keywords. -*DefaultImageableArea: Letter -*ImageableArea Letter: "10.32 15.9 601.68 776.22" -*ImageableArea Legal: "10.32 16.3801 601.68 991.74" -*ImageableArea A4: "13.44 14.46 581.76 828.54" -*?ImageableArea: " - save - /cvp { ( ) cvs print ( ) print } bind def - /upperright {10000 mul floor 10000 div} bind def - /lowerleft {10000 mul ceiling 10000 div} bind def - newpath clippath pathbbox - 4 -2 roll exch 2 {lowerleft cvp} repeat - exch 2 {upperright cvp} repeat flush - restore" -*End - -*% These provide the physical dimensions of the paper (by keyword) -*DefaultPaperDimension: Letter -*PaperDimension Letter: "612 792" -*PaperDimension Legal: "612 1008" -*PaperDimension A4: "595 842" - -*RequiresPageRegion All: True - -*% Print Quality Selection =================== - -*OpenUI *OutputMode/Print Quality: PickOne -*OrderDependency: 50 AnySetup *OutputMode -*DefaultOutputMode: Standard -*OutputMode Fast/Fast Color 600x600 dpi: " - (<<) cvx exec - /HWResolution [600 600] - /ProcessColorModel /DeviceCMY - (>>) cvx exec setpagedevice" -*End -*OutputMode Standard/Standard 600x600 dpi: " - (<<) cvx exec - /HWResolution [600 600] - /ProcessColorModel /DeviceCMYK - (>>) cvx exec setpagedevice" -*End -*OutputMode Enhanced/Enhanced 1200x600 dpi: " - (<<) cvx exec - /HWResolution [1200 600] - /ProcessColorModel /DeviceCMYK - (>>) cvx exec setpagedevice" -*End -*OutputMode Premium/Premium 1200x1200 dpi: " - (<<) cvx exec - /HWResolution [1200 1200] - /ProcessColorModel /DeviceCMYK - (>>) cvx exec setpagedevice" -*End -*?OutputMode: " - save - currentpagedevice /ProcessColorModel get /DeviceCMY eq - { (Fast) } - { currentpagedevice /HWResolution get - aload pop 1200 eq - { pop (Premium) } - { 1200 eq - { (Enhanced) } - { (Standard) } ifelse - } ifelse - } ifelse - = flush restore" -*End -*CloseUI: *OutputMode - -*OpenUI *OutputOrder/Output Order: PickOne -*OrderDependency: 60 AnySetup *OutputOrder -*DefaultOutputOrder: Reverse -*OutputOrder Normal/Face Down: " - (<<) cvx exec - /OutputFaceUp false - (>>) cvx exec setpagedevice" -*End -*OutputOrder Reverse/Face Up: " - (<<) cvx exec - /OutputFaceUp true - (>>) cvx exec setpagedevice" -*End -*?OutputOrder: " - save - currentpagedevice /OutputFaceUp get {(Reverse)}{(Normal)}ifelse - = flush restore" -*End -*CloseUI: *OutputOrder - -*OpenUI *Collate/Quick Collate: Boolean -*OrderDependency: 70 AnySetup *Collate -*DefaultCollate: False -*Collate False: " - (<<) cvx exec - /Collate false - (>>) cvx exec setpagedevice" -*End -*Collate True: " - (<<) cvx exec - /Collate true - (>>) cvx exec setpagedevice" -*End -*?Collate: " - save - currentpagedevice /Collate get {(True)}{(False)}ifelse - = flush restore" -*End -*CloseUI: *Collate - - -*% Font Information ===================== -*DefaultFont: Courier -*Font Courier: Standard "(002.003)" Standard ROM -*Font Courier-Bold: Standard "(002.003)" Standard ROM -*Font Courier-BoldOblique: Standard "(002.003)" Standard ROM -*Font Courier-Oblique: Standard "(002.003)" Standard ROM -*Font Helvetica: Standard "(001.006)" Standard ROM -*Font Helvetica-Bold: Standard "(001.007)" Standard ROM -*Font Helvetica-BoldOblique: Standard "(001.007)" Standard ROM -*Font Helvetica-Condensed: Standard "(001.001)" Standard ROM -*Font Helvetica-Condensed-Bold: Standard "(001.002)" Standard ROM -*Font Helvetica-Condensed-BoldObl: Standard "(001.002)" Standard ROM -*Font Helvetica-Condensed-Oblique: Standard "(001.001)" Standard ROM -*Font Helvetica-Narrow: Standard "(001.006)" Standard ROM -*Font Helvetica-Narrow-Bold: Standard "(001.007)" Standard ROM -*Font Helvetica-Narrow-BoldOblique: Standard "(001.007)" Standard ROM -*Font Helvetica-Narrow-Oblique: Standard "(001.006)" Standard ROM -*Font Helvetica-Oblique: Standard "(001.006)" Standard ROM -*Font Symbol: Special "(001.007)" Special ROM -*Font Times-Bold: Standard "(001.007)" Standard ROM -*Font Times-BoldItalic: Standard "(001.009)" Standard ROM -*Font Times-Italic: Standard "(001.007)" Standard ROM -*Font Times-Roman: Standard "(001.007)" Standard ROM -*Font ZapfChancery-MediumItalic: Standard "(001.006)" Standard ROM -*Font ZapfDingbats: Special "(001.004)" Special ROM -*?FontQuery: " - save - { count 1 gt - { exch dup 127 string cvs (/) print print (:) print - /Font resourcestatus {pop pop (Yes)} {(No)} ifelse = - } { exit } ifelse - } bind loop - (*) = flush restore" -*End - -*?FontList: " - save (*) {cvn ==} 128 string /Font resourceforall - (*) = flush restore" -*End - -*DefaultColorSep: ProcessBlack.60lpi.600x600dpi/60 lpi / 600x600 dpi - -*% For 60 lpi / 600x600dpi ================================ - -*ColorSepScreenAngle ProcessBlack.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle CustomColor.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle ProcessCyan.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle ProcessMagenta.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle ProcessYellow.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" - -*ColorSepScreenFreq ProcessBlack.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq CustomColor.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq ProcessCyan.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq ProcessMagenta.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq ProcessYellow.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" - -*% end of PPD file for MS PS5 OEM Custimization diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemdll.inf b/print/OEM Printer Customization Plug-in Samples/C++/oemdll.inf deleted file mode 100644 index 5f49b577..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/oemdll.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemdll.sln b/print/OEM Printer Customization Plug-in Samples/C++/oemdll.sln deleted file mode 100644 index 2d0d56ed..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemdll.sln +++ /dev/null @@ -1,809 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 12.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bitmap", "Bitmap", "{EFB5E861-A892-49B4-BA05-38F6F5F42D48}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Custhlp", "Custhlp", "{F3DB5340-C664-40EB-986F-2A48790AEDC5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{EC75B371-D09D-4D95-9816-3429B6D3806B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gdl", "Gdl", "{A6BA54B0-ADB8-4032-8C4B-770474042B09}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oemprean", "Oemprean", "{E7B7C6C6-5396-42D3-9BDE-DFAC86D0AFE3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oemps", "Oemps", "{80510096-C37F-488D-A426-E3BA4B1A1600}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oemui", "Oemui", "{35933BA0-56E6-4DD4-84E9-C8AADAA19AFA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oemuni", "Oemuni", "{7AC217E4-4DB5-414C-A39F-B783020E43AA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PSUIRep", "PSUIRep", "{03A523F4-091A-416B-97B5-A84FA1B1D3EE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{CCF8F861-A2C2-4C28-AB19-29CC47C6D560}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PTPCPlPr", "PTPCPlPr", "{F8AB36BA-6C96-42BA-90F5-378D3B73634C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SyncSet", "SyncSet", "{C52A574A-6122-48EB-875C-07CE190B0808}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ThemeUI", "ThemeUI", "{F3C654B9-A286-494E-8558-3A2526D52A37}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{C4BCC65A-6423-4569-A1D6-AAA82CE821A9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Uniuirep", "Uniuirep", "{1BA35560-35CD-4E6E-8B67-AD7ED043874A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wmarkps", "Wmarkps", "{9F8B052F-1649-4F54-ABE9-42E51AFB32AA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Watermark", "Watermark", "{575FCB22-ADB3-4025-8F23-040500F6C11A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wmarkui", "Wmarkui", "{2A597978-AD6A-41D0-9B97-CC1B69CE054A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wmarkui", "Wmarkui", "{D0C95EA5-D23F-44E6-91C3-2BA65CE3991E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Watermarkuni", "Watermarkuni", "{5A8A1EF7-4454-43F3-8A69-484AF81D0771}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wmarkuni", "Wmarkuni", "{90BABB1D-0FDD-4A9A-BA18-3319FF12363B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitmap", "bitmap\bitmap.vcxproj", "{EDCCC34A-50DF-4894-B7B9-FC156F899947}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUSTHLP", "custhlp\CUSTHLP.vcxproj", "{CA70C64A-75C8-48CD-9224-335C2ED689A6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GDLSMPL", "gdl\src\GDLSMPL.vcxproj", "{F0118F7B-9DF5-49FC-B4FF-951C54033F3D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oemprean", "oemprean\oemprean.vcxproj", "{D5E225D5-EEEA-45FD-AD07-E4678C542E1A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OEMPS", "oemps\OEMPS.vcxproj", "{9F374241-B8F9-45D3-B163-7E84E8E22C1F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OEMUI", "oemui\OEMUI.vcxproj", "{452209BF-AEB7-457D-956B-90CDE70CED7D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OEMUNI", "oemuni\OEMUNI.vcxproj", "{B0F13767-2056-47FC-B37B-41D7E339900B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PSUIREP", "PSUIRep\PSUIREP.vcxproj", "{5D63CD51-110C-41B7-B8B0-6AB27398690B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PTPCPLPR", "PTPCPlPr\src\PTPCPLPR.vcxproj", "{CED613CF-6666-43FC-9414-02AFBDA83A34}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SYNCSET", "SyncSet\SYNCSET.vcxproj", "{60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ThemeUISmpl", "ThemeUI\ThemeUISmpl.vcxproj", "{EA206DEA-26E6-4FD4-BF68-23F222C5E211}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UNIUIREP", "uniuirep\src\UNIUIREP.vcxproj", "{7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WMARKPS", "watermark\wmarkps\WMARKPS.vcxproj", "{4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WMARKUI", "watermark\wmarkui\WMARKUI.vcxproj", "{BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WMARKUNIUI", "watermarkuni\wmarkui\WMARKUNIUI.vcxproj", "{1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WMARKUNI", "watermarkuni\wmarkuni\WMARKUNI.vcxproj", "{866141A6-4989-41D7-9409-4A5A73B535B0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Win10 Debug|ARM64 = Win10 Debug|ARM64 - Win10 Debug|Win32 = Win10 Debug|Win32 - Win10 Debug|x64 = Win10 Debug|x64 - Win10 Release|ARM64 = Win10 Release|ARM64 - Win10 Release|Win32 = Win10 Release|Win32 - Win10 Release|x64 = Win10 Release|x64 - Win7 Debug|ARM64 = Win7 Debug|ARM64 - Win7 Debug|Win32 = Win7 Debug|Win32 - Win7 Debug|x64 = Win7 Debug|x64 - Win7 Release|ARM64 = Win7 Release|ARM64 - Win7 Release|Win32 = Win7 Release|Win32 - Win7 Release|x64 = Win7 Release|x64 - Win8 Debug|ARM64 = Win8 Debug|ARM64 - Win8 Debug|Win32 = Win8 Debug|Win32 - Win8 Debug|x64 = Win8 Debug|x64 - Win8 Release|ARM64 = Win8 Release|ARM64 - Win8 Release|Win32 = Win8 Release|Win32 - Win8 Release|x64 = Win8 Release|x64 - Win8.1 Debug|ARM64 = Win8.1 Debug|ARM64 - Win8.1 Debug|Win32 = Win8.1 Debug|Win32 - Win8.1 Debug|x64 = Win8.1 Debug|x64 - Win8.1 Release|ARM64 = Win8.1 Release|ARM64 - Win8.1 Release|Win32 = Win8.1 Release|Win32 - Win8.1 Release|x64 = Win8.1 Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {EDCCC34A-50DF-4894-B7B9-FC156F899947}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {CA70C64A-75C8-48CD-9224-335C2ED689A6}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {9F374241-B8F9-45D3-B163-7E84E8E22C1F}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {452209BF-AEB7-457D-956B-90CDE70CED7D}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {B0F13767-2056-47FC-B37B-41D7E339900B}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {5D63CD51-110C-41B7-B8B0-6AB27398690B}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {CED613CF-6666-43FC-9414-02AFBDA83A34}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {EA206DEA-26E6-4FD4-BF68-23F222C5E211}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Debug|ARM64.ActiveCfg = Win10 Debug|ARM64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Debug|ARM64.Build.0 = Win10 Debug|ARM64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Debug|Win32.ActiveCfg = Win10 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Debug|Win32.Build.0 = Win10 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Debug|x64.ActiveCfg = Win10 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Debug|x64.Build.0 = Win10 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Release|ARM64.ActiveCfg = Win10 Release|ARM64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Release|ARM64.Build.0 = Win10 Release|ARM64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Release|Win32.ActiveCfg = Win10 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Release|Win32.Build.0 = Win10 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Release|x64.ActiveCfg = Win10 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win10 Release|x64.Build.0 = Win10 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Debug|ARM64.ActiveCfg = Win7 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Debug|x64.Build.0 = Win7 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Release|ARM64.ActiveCfg = Win7 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Release|Win32.Build.0 = Win7 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Release|x64.ActiveCfg = Win7 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win7 Release|x64.Build.0 = Win7 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Debug|ARM64.ActiveCfg = Win8 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Debug|x64.Build.0 = Win8 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Release|ARM64.ActiveCfg = Win8 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Release|Win32.Build.0 = Win8 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Release|x64.ActiveCfg = Win8 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8 Release|x64.Build.0 = Win8 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Debug|ARM64.ActiveCfg = Win8.1 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Release|ARM64.ActiveCfg = Win8.1 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64 - {866141A6-4989-41D7-9409-4A5A73B535B0}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {EC75B371-D09D-4D95-9816-3429B6D3806B} = {A6BA54B0-ADB8-4032-8C4B-770474042B09} - {CCF8F861-A2C2-4C28-AB19-29CC47C6D560} = {F8AB36BA-6C96-42BA-90F5-378D3B73634C} - {C4BCC65A-6423-4569-A1D6-AAA82CE821A9} = {1BA35560-35CD-4E6E-8B67-AD7ED043874A} - {9F8B052F-1649-4F54-ABE9-42E51AFB32AA} = {575FCB22-ADB3-4025-8F23-040500F6C11A} - {2A597978-AD6A-41D0-9B97-CC1B69CE054A} = {575FCB22-ADB3-4025-8F23-040500F6C11A} - {D0C95EA5-D23F-44E6-91C3-2BA65CE3991E} = {5A8A1EF7-4454-43F3-8A69-484AF81D0771} - {90BABB1D-0FDD-4A9A-BA18-3319FF12363B} = {5A8A1EF7-4454-43F3-8A69-484AF81D0771} - {EDCCC34A-50DF-4894-B7B9-FC156F899947} = {EFB5E861-A892-49B4-BA05-38F6F5F42D48} - {CA70C64A-75C8-48CD-9224-335C2ED689A6} = {F3DB5340-C664-40EB-986F-2A48790AEDC5} - {F0118F7B-9DF5-49FC-B4FF-951C54033F3D} = {EC75B371-D09D-4D95-9816-3429B6D3806B} - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A} = {E7B7C6C6-5396-42D3-9BDE-DFAC86D0AFE3} - {9F374241-B8F9-45D3-B163-7E84E8E22C1F} = {80510096-C37F-488D-A426-E3BA4B1A1600} - {452209BF-AEB7-457D-956B-90CDE70CED7D} = {35933BA0-56E6-4DD4-84E9-C8AADAA19AFA} - {B0F13767-2056-47FC-B37B-41D7E339900B} = {7AC217E4-4DB5-414C-A39F-B783020E43AA} - {5D63CD51-110C-41B7-B8B0-6AB27398690B} = {03A523F4-091A-416B-97B5-A84FA1B1D3EE} - {CED613CF-6666-43FC-9414-02AFBDA83A34} = {CCF8F861-A2C2-4C28-AB19-29CC47C6D560} - {60E61442-4E2A-41A1-BC70-EDC0B8DC4EB8} = {C52A574A-6122-48EB-875C-07CE190B0808} - {EA206DEA-26E6-4FD4-BF68-23F222C5E211} = {F3C654B9-A286-494E-8558-3A2526D52A37} - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16} = {C4BCC65A-6423-4569-A1D6-AAA82CE821A9} - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5} = {9F8B052F-1649-4F54-ABE9-42E51AFB32AA} - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE} = {2A597978-AD6A-41D0-9B97-CC1B69CE054A} - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62} = {D0C95EA5-D23F-44E6-91C3-2BA65CE3991E} - {866141A6-4989-41D7-9409-4A5A73B535B0} = {90BABB1D-0FDD-4A9A-BA18-3319FF12363B} - EndGlobalSection -EndGlobal diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.gpd b/print/OEM Printer Customization Plug-in Samples/C++/oemprean.gpd deleted file mode 100644 index 3328de18..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.gpd +++ /dev/null @@ -1,706 +0,0 @@ -*GPDFileName: "oemprean.gpd" -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*Include: "ttfsub.gpd" -*ModelName: "OEM Pre-Analysis sample" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 -*PrintRate: 16 -*PrintRateUnit: PPM -*PrintRatePPM: 16 - -*PreAnalysisOptions: 8 - -*%****************************************************************************************** -*% Orientation -*%****************************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l0O" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *Cmd: "<1B>&l1O" - } - } -} - -*%****************************************************************************************** -*% Input Bin -*%****************************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: AUTO - *Option: AUTO - { - *rcNameID: =AUTO_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l0H" - } - } - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l1H" - } - } -} - -*%****************************************************************************************** -*% Resolution -*%****************************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: Option2 - *Option: Option1 - { - *Name: "600 x 600" =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=600<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t600R" - } - } - *Option: Option2 - { - *Name: "300 x 300" =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } - *Option: Option3 - { - *Name: "150 x 150" =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(150, 150) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=150<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t150R" - } - } -} - -*%****************************************************************************************** -*% HP-GL/2 Graphics Support -*%****************************************************************************************** -*Ifdef: WINNT_51 -*Personality: =PERSONALITY_HPGL2 -*Feature: GraphicsMode -{ - *rcNameID: =GRAPHICSMODE_DISPLAY - *DefaultOption: RASTERMODE - *Option: HPGL2MODE - { - *rcNameID: =GRAPHICSMODE_HPGL2_DISPLAY - } - *Option: RASTERMODE - { - *rcNameID: =GRAPHICSMODE_RASTER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "@PJL SET LIMAGEENHANCE=OFF<0A>" - } - } -} -*Endif: - -*%****************************************************************************************** -*% Paper Size -*%****************************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5260x7704Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7332x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5880x8900Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t8900x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(288, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(204, 13824) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t4970x7040Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t6780x4970Y" - } - } - } - } -} - -*%****************************************************************************************** -*% Media Type -*%****************************************************************************************** -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: PLAIN - *Option: PLAIN - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n6WdPlain" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n13WdTransparency" - } - } -} - -*%****************************************************************************************** -*% Color Mode -*%****************************************************************************************** -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *DefaultOption: 24bpp - *Option: Mono - { - *rcNameID: =MONO_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 1 - *Color?: FALSE - } - *Option: Color - { - *rcNameID: =COLOR_DISPLAY - *DevNumOfPlanes: 3 - *DevBPP: 1 - *DrvBPP: 4 - EXTERN_GLOBAL: *RasterSendAllData?: TRUE - *ColorPlaneOrder: LIST(CYAN, MAGENTA, YELLOW) - *Command: CmdSendCyanData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } - *Command: CmdSendMagentaData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"V" } - *Command: CmdSendYellowData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelectBlackColor { *Cmd : "<1B>*v7S" } - *Command: CmdSelectRedColor { *Cmd : "<1B>*v6S" } - *Command: CmdSelectGreenColor { *Cmd : "<1B>*v5S" } - *Command: CmdSelectYellowColor { *Cmd : "<1B>*v4S" } - *Command: CmdSelectBlueColor { *Cmd : "<1B>*v3S" } - *Command: CmdSelectMagentaColor { *Cmd : "<1B>*v2S" } - *Command: CmdSelectCyanColor { *Cmd : "<1B>*v1S" } - *Command: CmdSelectWhiteColor { *Cmd : "<1B>*v0S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*r-3U" - } - } - *Option: 8bpp - { - *rcNameID: =8BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 8 - *DrvBPP: 8 - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*t0I<1B>*l184O<1B>*v6W<000108080808>" - } - } - *Option: 24bpp - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 - *Command: CmdEnableDRC { *Cmd : "<1B>*b3M" } - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSetSrcBmpWidth { *Cmd : "<1B>*r" %d{RasterDataWidthInBytes / 3}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<0003080808081B>*v0a0b0c7i255a255b255c0I<1B>*" -+ "o3W<060400>" - } - } -} - -*%****************************************************************************************** -*% HalfTone -*%****************************************************************************************** -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%****************************************************************************************** -*% Memory -*% -*% Note: Unidrv uses the font memory information to estimate when it needs to stop -*% downloading fonts for a page, and thus driver writers should err on the conservative -*% side. Otherwise, printers will generate "out of memory" device errors for pages with -*% a large number of fonts / unique glyphs. -*%****************************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 32768KB - *Option: 4096KB - { - *Name: "4MB" - *MemoryConfigKB: PAIR(4096, 6750) - } - *Option: 8192KB - { - *Name: "8MB" - *MemoryConfigKB: PAIR(8192, 10350) - } - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 24576KB - { - *Name: "24MB" - *MemoryConfigKB: PAIR(24576, 21150) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } - *Option: 49152KB - { - *Name: "48MB" - *MemoryConfigKB: PAIR(49152, 43050) - } - *Option: 65536KB - { - *Name: "64MB" - *MemoryConfigKB: PAIR(65536, 57150) - } - *Option: 98304KB - { - *Name: "96MB" - *MemoryConfigKB: PAIR(98304, 85950) - } - *Option: 102400KB - { - *Name: "100MB" - *MemoryConfigKB: PAIR(102400, 89700) - } - *Option: 114688KB - { - *Name: "112MB" - *MemoryConfigKB: PAIR(114688, 100550) - } - *Option: 131072KB - { - *Name: "128MB" - *MemoryConfigKB: PAIR(131072, 116250) - } -} - -*%****************************************************************************************** -*% Duplex Unit -*%****************************************************************************************** -*Feature: DuplexUnit -{ - *rcNameID: 429 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *rcNameID: 444 - *DisabledFeatures: LIST(Duplex.VERTICAL, Duplex.HORIZONTAL) - } - *Option: TRUE - { - *rcNameID: 443 - } -} - -*%****************************************************************************************** -*% Duplex Type -*%****************************************************************************************** -*Feature: Duplex -{ - *rcNameID: =TWO_SIDED_PRINTING_DISPLAY - *DefaultOption: NONE - *Option: NONE - { - *rcNameID: =NONE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l0S" - } - } - *Option: VERTICAL - { - *rcNameID: =FLIP_ON_LONG_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l1S" - } - } - *Option: HORIZONTAL - { - *rcNameID: =FLIP_ON_SHORT_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l2S" - } - } -} - -*%****************************************************************************************** -*% Page Protect -*%****************************************************************************************** -*Feature: PageProtect -{ - *rcNameID: =PAGE_PROTECTION_DISPLAY - *DefaultOption: OFF - *Option: ON - { - *rcNameID: =ON_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=LETTER<0A>" - } - } - *Option: OFF - { - *rcNameID: =OFF_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=OFF<0A>" - } - } -} - -*%****************************************************************************************** -*% Doc setup commands -*%****************************************************************************************** -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.7 - *Cmd: "<1B>&u1200D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X@PJL<20>LPORTROTATE<0A><1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.13 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} - -*%****************************************************************************************** -*% Cursor, Page and Color Commands -*%****************************************************************************************** -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT, RASTER, VECTOR) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel) }"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel) }"Y" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*%****************************************************************************************** -*% Font Descriptions and Commands -*%****************************************************************************************** -*TTFSEnabled?: TRUE -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*DeviceFonts: LIST(136,138,146,147,148,149,150,151,152,153,154,155,156,157, -+ 163,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) -*MinFontID: 16534 -*MaxFontID: 32768 -*switch: Resolution -{ - *case: Option1 - { - *FontFormat: HPPCL_OUTLINE - } - *case: Option2 - { - *FontFormat: HPPCL_OUTLINE - } - *case: Option3 - { - *FontFormat: HPPCL_RES - } -} -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } - - -*%******************************************************************************************** -*%* Vector Commands. -*%******************************************************************************************** -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.htm b/print/OEM Printer Customization Plug-in Samples/C++/oemprean.htm deleted file mode 100644 index 87662eb5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.htm +++ /dev/null @@ -1,514 +0,0 @@ - - - - - - - - -OEMPREAN SAMPLE - - - - - - - -
- -

OEMPREAN SAMPLE

- -

 

- -

Summary

- -

This -sample illustrates how you can leverage the preanalysis feature in Unidrv. This -sample is built upon the redesigned version of the oemuni sample.

- -

 

- -

When -preanalysis is enabled in the GPD, Unidrv defines the surface as a banding -surface but causes the first playback to be of the entire page. Unidrv does -this by setting the GDI clip window to the entire page. Unidrv allows all -drawing commands to be hooked but returns before any drawing can be done. On -the following passes Unidrv resets the clip window back to the original band -size and bands normally. In order to enable this feature in the GPD, specify -the following GPD parameter: “*PreAnalysisOptions: 8”.

- -

 

- -

The OEM -rendering plug-in is required to hook both DrvStartBanding and DrvNextBand when -this mode is enabled in the GPD. The OEM rendering plug-in must test the pptl -parameter of the DrvStartBanding call to determine whether preanalysis has been -enabled on this page. If the pptl parameter is NULL, then preanalysis has been -enabled. The pptl parameter can be used by Unidrv since it has no meaning at -this point. This parameter has not been updated with the band position and for -preanalysis the band position is always be set to 0, 0. If the pptl parameter -is NULL, then the OEM rendering plug-in should consider all drawing calls up to -the first call to DrvNextBand to be part of preanalysis. During this phase no -drawing onto the surface is allowed. You should be aware that after -preanalysis, you might get more calls than you saw in the normal rendering, -because primitives that cross band boundaries yield two or more DDI calls after -the preanalysis pass.

- -

 

- -

The -sample uses the bPreAnalysis flag in the OEMPDEV structure to denote whether a -particular pass is the preanalysis pass or the actual rendering pass. If the -bPreAnalysis flag is set, it indicates that the current pass is the preanalysis -pass. The sample implements all of the drawing function hooks in ddihook.cpp. -The sample uses the OEMStartBanding and OEMNextBand functions, to respectively -set and reset the bPreAnalysis flag. The sample also uses the DBG_CLIPOBJ debug -macro function to dump the bounds of the clipping rectangle available for -preanalysis in each of the drawing functions during the preanalysis pass. To -view all of the debug output in the debugger, you must set the debug level to -VERBOSE. The rest of the sample is identical to the oemuni sample that -illustrates a basic OEM rendering plug-in.

- -

 

- -

Note that -the surface used during preanalysis might differ from the surface passed in -during the rendering pass. Also note that during the preanalysis pass, although -Unidrv calls the hooked drawing functions, it returns before any drawing is -done. For this reason you should not perform any drawing on the surface during -the preanalysis pass. All other preanalysis tasks should be performed during -this pass. For example, certain printers need to handle black objects that -intersect with color objects differently from black objects that appear by -themselves. Other printers might need to halftone StretchBlt objects -differently from BitBlt objects. Basically, the plug-in can analyze the objects -on the page. A final point to note is that during the preanalysis pass, drawing -functions should not call back into Unidrv. When the bPreAnalysis flag is set, -the sample returns without calling back into Unidrv.

- -

 

- -

Note that -this sample will not build with the Windows 2000 build environment. This -version of the sample implements the IPrintOemUni2 interface which is available -only on Windows XP and later. The table shown below will help identify which -operating systems this sample will build/work on.

- -

 

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Operating System

-
-

Can sample be built in the OS?

-
-

Does sample work in the OS?

-
-

Can sample be used in a production environment - for the OS?

-
-

Windows - codenamed Longhorn

-
-

Yes

-
-

Yes

-
-

No

-
-

Windows - Server 2003

-
-

Yes

-
-

No

-
-

No

-
-

Windows - XP

-
-

Yes

-
-

No

-
-

No

-
-

Windows - 2000

-
-

No

-
-

No

-
-

No

-
-

Windows - Me

-
-

No

-
-

No

-
-

No

-
-

Windows - 98 SE

-
-

No

-
-

No

-
-

No

-
- -

 

- -

 

- -

Building the sample

- -

To build -the samples, run “build –cZ” from -the directory. The resulting DLL will be placed in the appropriate platform directory -(i.e. i386 or Alpha). To create a version with verbose debug output, add _DEBUG -to the compile defines in the sources file.

- -

 

- -

Installing the sample

- -

After -building the sample, you can install it using the Add Printer Wizard and -supplying the INF that is part of the sample when you are prompted for an INF -in the wizard. The Unidrv binaries required for this driver need not be copied -to the local directory containing oemdll.inf.

- -

 

- -

Resources

- -

For the -latest release of the Windows Device Driver Development Kit, see http://www.microsoft.com/whdc/ddk/winddk.mspx.

- -

 

- -

If you -have questions on using or adapting this sample for your project, you can -either contact Microsoft Technical -Support or post your questions in the Microsoft -driver development newsgroup.

- -

 

- -

 

- -

File Manifest

- -

 

- -

Root:

- -

 

- -

Files                       Description

- -

readme.htm             The documentation for this sample -(this file).

- -

oemprean.gpd          The generic GPD file for this sample.

- -

oemprean.inf            The printer INF that will install -this sample once it is built.

- -

oemprean.ini            The printer ini file that specifies -the OEM customization DLLs for this sample.

- -

 

- -

 

- -

OEMPREAN directory:

- -

 

- -

Files                       Description

- -

ddihook.cpp             Source module for DDI Hook routines -for the rendering plug-in. (OEMBitBlt, OEMStrokePath, OEMTextOut, OEMNextBand -etc.)

- -

ddihook.h                Source module that defines the -constants used to control DDI hooking. (IMPL_ALPHABLEND, IMPL_BITBLT, -IMPL_NEXTBAND etc.)

- -

debug.cpp               Source module that contains the -debugging functions. (COemUniDbg::vDumpSURFOBJ, COemUniDbg::vDumpSTROBJ etc.)

- -

debug.h                  The header file for the debug -module defined in debug.cpp. (Definition of the COemUniDbg class)

- -

devmode.cpp           Source module that contains -implementation of the OEM Devmode functions. (hrOEMDevmode, bConvertOEMDevmode -etc.)

- -

devmode.h              The header for devmode.cpp.

- -

dllentry.cpp             Source module for DLL entry -functions. (DllMain)

- -

enable.cpp              Source module that contains the -enable routines for the rendering plug-in. (OEMEnableDriver, OEMEnablePDEV, -OEMDisableDriver etc.)

- -

intrface.cpp             Source module that implements the -OEM COM printer customization rendering plug-in interface. -(COemUni2::ImageProcessing, COemUni2::FilterGraphics etc.)

- -

intrface.h                The header for intrface.cpp that -defines the COM interface for the rendering plug-in. (Definition of the -COemUni2 class)

- -

makefile                  The generic makefile for -building the code sample.

- -

oemprean.def           The file that lists the exported -functions for the sample.

- -

oemprean.h             The header file that defines the -PDEV class for the sample. (Definition and implementation of the COemPDEV -class)

- -

oemprean.rc            The resources file for the rendering -plugin’s resources.

- -

precomp.h               The header that includes the -headers to precompile.

- -

resource.h               The header file the resources -file.

- -

sources                   The generic sources file for building -the code sample.

- -

 

- -
- - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.inf b/print/OEM Printer Customization Plug-in Samples/C++/oemprean.inf deleted file mode 100644 index e2905f70..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.ini b/print/OEM Printer Customization Plug-in Samples/C++/oemprean.ini deleted file mode 100644 index ad5eed92..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean.ini +++ /dev/null @@ -1,4 +0,0 @@ -[OEMFiles] -OEMDriverFile1=OEMPREAN.DLL - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/ddihook.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/ddihook.cpp deleted file mode 100644 index b3843090..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/ddihook.cpp +++ /dev/null @@ -1,2069 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: DDIHook.cpp -// -// -// PURPOSE: DDI Hook routines for User Mode COM Customization DLL. -// -// This module implements the following functions defined in printoem.h: -// OEMCopyBits -// OEMBitBlt -// OEMStretchBlt -// OEMDitherColor -// OEMStretchBltROP -// OEMPlgBlt -// OEMPaint -// OEMRealizeBrush -// OEMStrokePath -// OEMFillPath -// OEMStrokeAndFillPath -// OEMLineTo -// OEMAlphaBlend -// OEMGradientFill -// OEMTransparentBlt -// OEMTextOut -// OEMQueryFont -// OEMQueryFontTree -// OEMQueryFontData -// OEMFontManagement -// OEMQueryAdvanceWidths -// OEMGetGlyphMode -// OEMStartDoc -// OEMEndDoc -// OEMStartPage -// OEMSendPage -// OEMStartBanding -// OEMNextBand -// OEMEscape -// -// History: -// 06/24/03 xxx created. -// -// - -#include "precomp.h" -#include "oemprean.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -BOOL APIENTRY -OEMCopyBits( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - POINTL *pptlSrc - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvCopyBits. - - DrvCopyBits translates between device-managed - raster surfaces and GDI standard-format bitmaps. - GDI will call DrvCopyBits when it needs to copy from - one surface to another and at least one of the - surfaces is device-managed. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Points to the Dstination surface - psoSrc - Points to the source surface - pxlo - XLATEOBJ provided by the engine - pco - Defines a clipping region on the Dstination surface - pxlo - Defines the translation of color indices - between the source and target surfaces - prclDst - Defines the area to be modified - pptlSrc - Defines the upper-left corner of the source rectangle - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMCopyBits entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMCopyBits: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMCopyBits: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvCopyBits)(psoDst, - psoSrc, - pco, - pxlo, - prclDst, - pptlSrc); -} - -BOOL APIENTRY -OEMBitBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - POINTL *pptlSrc, - POINTL *pptlMask, - BRUSHOBJ *pbo, - POINTL *pptlBrush, - ROP4 rop4 - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvBitBlt. - - DrvBitBlt provides general bit-block transfer capabilities - between device-managed surfaces, between GDI-managed - standard-format bitmaps, or between a device-managed - surface and a GDI-managed standard-format bitmap. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Describes the target surface - psoSrc - Describes the source surface - psoMask - Describes the mask for rop4 - pco - Limits the area to be modified - pxlo - Specifies how color indices are translated - between the source and target surfaces - prclDst - Defines the area to be modified - pptlSrc - Defines the upper left corner of the source rectangle - pptlMask - Defines which pixel in the mask corresponds to - the upper left corner of the source rectangle - pbo - Defines the pattern for bitblt - pptlBrush - Defines the origin of the brush in the Dstination surface - rop4 - ROP code that defines how the mask, pattern, source, and - Dstination pixels are combined to write to the Dstination surface - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMBitBlt entry."); - - DBG_SURFOBJ(DBG_VERBOSE, L"psoDst", psoDst); - DBG_SURFOBJ(DBG_VERBOSE, L"psoSrc", psoSrc); - DBG_SURFOBJ(DBG_VERBOSE, L"psoMask", psoMask); - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - DBG_XLATEOBJ(DBG_VERBOSE, L"pxlo", pxlo); - DBG_RECTL(DBG_VERBOSE, L"prclDst", prclDst); - DBG_POINTL(DBG_VERBOSE, L"pptlSrc", pptlSrc); - DBG_POINTL(DBG_VERBOSE, L"pptlMask", pptlMask); - DBG_BRUSHOBJ(DBG_VERBOSE, L"pbo", pbo); - DBG_POINTL(DBG_VERBOSE, L"pptlBrush", pptlBrush); - VERBOSE(TEXT("\nrop4: %#x\r\n\n"), rop4); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMBitBlt: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMBitBlt: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvBitBlt)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - prclDst, - pptlSrc, - pptlMask, - pbo, - pptlBrush, - rop4); -} - -BOOL APIENTRY -OEMStretchBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDst, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStretchBlt. - - DrvStretchBlt provides stretching bit-block transfer - capabilities between any combination of device-managed - and GDI-managed surfaces. DrvStretchBlt enables the - device driver to write to GDI bitmaps, especially when the - driver can do halftoning. This function allows the same - halftoning algorithm to be applied to GDI bitmaps and - device surfaces. This function can be provided to handle - only certain forms of stretching, such as by integer multiples. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Defines the surface on which to draw - psoSrc - Defines the source for blt operation - psoMask - Defines a surface that provides a mask for the source - pco - Limits the area to be modified on the Dstination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - pca - Defines color adjustment values to be applied to the source bitmap - pptlHTOrg - Specifies the origin of the halftone brush - prclDst - Defines the area to be modified on the Dstination surface - prclSrc - Defines the area to be copied from the source surface - pptlMask - Specifies which pixel in the given mask corresponds to - the upper left pixel in the source rectangle - iMode - Specifies how source pixels are combined to get output pixels - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMStretchBlt entry."); - - DBG_SURFOBJ(DBG_VERBOSE, L"psoDst", psoDst); - DBG_SURFOBJ(DBG_VERBOSE, L"psoSrc", psoSrc); - DBG_SURFOBJ(DBG_VERBOSE, L"psoMask", psoMask); - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - DBG_XLATEOBJ(DBG_VERBOSE, L"pxlo", pxlo); - DBG_COLORADJUSTMENT(DBG_VERBOSE, L"pca", pca); - DBG_POINTL(DBG_VERBOSE, L"pptlHTOrg", pptlHTOrg); - DBG_RECTL(DBG_VERBOSE, L"prclDst", prclDst); - DBG_RECTL(DBG_VERBOSE, L"prclSrc", prclSrc); - DBG_POINTL(DBG_VERBOSE, L"pptlMask", pptlMask); - VERBOSE(TEXT("\niMode: %#x\r\n\n"), iMode); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMStretchBlt: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMStretchBlt: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStretchBlt)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDst, - prclSrc, - pptlMask, - iMode); -} - -ULONG APIENTRY -OEMDitherColor( - DHPDEV dhpdev, - ULONG iMode, - ULONG rgbColor, - ULONG *pulDither - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvDitherColor. - - DrvDitherColor requests the device to create a - brush dithered against a device palette. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - DHPDEV passed, it is our pDEV - iMode - Not used - rgbColor - Solid rgb color to be used - pulDither - buffer to put the halftone brush. - -Return Value: - - Returns halftone method. - - DCR_DRIVER if the dither values have been calculated by the driver. - DCR_SOLID if the engine should use the best solid color approximation of the color. - DCR_HALFTONE if the engine should create a halftone approximation for the driver. - ---*/ - -{ - VERBOSE(L"OEMDitherColor entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvDitherColor)(dhpdev, - iMode, - rgbColor, - pulDither); -} - -BOOL APIENTRY -OEMStretchBltROP( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDst, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode, - BRUSHOBJ *pbo, - ROP4 rop4 - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStretchBltROP. - - DrvStretchBltROP performs a stretching bit-block transfer - using a ROP. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Specifies the target surface - psoSrc - Specifies the source surface - psoMask - Specifies the mask surface - pco - Limits the area to be modified - pxlo - Specifies how color indices are translated - between the source and target surfaces - pca - Defines color adjustment values to be applied to the source bitmap - pptlHTOrg - Specifies the halftone origin - prclDst - Area to be modified on the destination surface - prclSrc - Rectangle area on the source surface - pptlMask - Defines which pixel in the mask corresponds to - the upper left corner of the source rectangle - iMode - Specifies how source pixels are combined to get output pixels - pbo - Defines the pattern for bitblt - rop4 - ROP code that defines how the mask, pattern, source, and - destination pixels are combined on the destination surface - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMStretchBltROP entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMStretchBltROP: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMStretchBltROP: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStretchBltROP)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDst, - prclSrc, - pptlMask, - iMode, - pbo, - rop4); -} - -BOOL APIENTRY -OEMPlgBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlBrushOrg, - POINTFIX *pptfixDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) -/*++ - -Routine Description: - - Implementation of DDI hook for DrvPlgBlt. - - DrvPlgBlt provides rotate bit-block transfer capabilities between - combinations of device-managed and GDI-managed surfaces. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Defines the surface on which to draw - psoSrc - Defines the source for blt operation - psoMask - Defines a surface that provides a mask for the source - pco - Limits the area to be modified on the Dstination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - pca - Defines color adjustment values to be applied to the source bitmap - pptlBrushOrg - Specifies the origin of the halftone brush - pptfixDest - Defines the area to be modified on the Dstination surface - prclSrc - Defines the area to be copied from the source surface - pptlMask - Specifies which pixel in the given mask corresponds to - the upper left pixel in the source rectangle - iMode - Specifies how source pixels are combined to get output pixels - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMPlgBlt entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMPlgBlt: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMPlgBlt: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvPlgBlt)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlBrushOrg, - pptfixDest, - prclSrc, - pptlMask, - iMode); -} - -BOOL APIENTRY -OEMPaint( - SURFOBJ *pso, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - MIX mix - ) -/*++ - -Routine Description: - - Implementation of DDI hook for DrvPaint. - - DrvPaint is an obsolete function. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to draw - pco - Limits the area to be modified on the Dstination - pbo - Points to a BRUSHOBJ which defined the pattern and colors to fill with - pptlBrushOrg - Specifies the origin of the halftone brush - mix - Defines the foreground and background raster operations to use for - the brush - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMPaint entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMPaint: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMPaint: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvPaint)(pso, - pco, - pbo, - pptlBrushOrg, - mix); -} - -BOOL APIENTRY -OEMRealizeBrush( - BRUSHOBJ *pbo, - SURFOBJ *psoTarget, - SURFOBJ *psoPattern, - SURFOBJ *psoMask, - XLATEOBJ *pxlo, - ULONG iHatch - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvRealizeBrush. - - DrvRealizeBrush requests that the driver realize a specified brush - for a specified surface. To realize a brush, the driver converts a - GDI brush into a form that can be used internally. A realized brush - contains device-specific information needed by the device to - accelerate drawing using the brush. The driver's realization of a brush - is written into the buffer allocated by a call to BRUSHOBJ_pvAllocRBrush. - - Please refer to DDK documentation for more details. - -Arguments: - - pbo - BRUSHOBJ to be realized - psoTarget - Defines the surface for which the brush is to be realized - psoPattern - Defines the pattern for the brush - psoMask - Transparency mask for the brush - pxlo - Defines the interpretration of colors in the pattern - iHatch - Specifies whether psoPattern is one of the hatch brushes - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMRealizeBrush entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoTarget->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvRealizeBrush)(pbo, - psoTarget, - psoPattern, - psoMask, - pxlo, - iHatch); -} - -BOOL APIENTRY -OEMStrokePath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - LINEATTRS *plineattrs, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStrokePath. - - DrvStrokePath strokes a path when called by GDI. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Identifies the surface on which to draw - ppo - Defines the path to be stroked - pco - Defines the clipping path - pxo - Specifies the world to device coordinate transformation - pbo - Specifies the brush to be used when drawing the path - pptlBrushOrg - Defines the brush origin - plineattrs - Defines the line attributes - mix - Specifies how to combine the brush with the destination - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE(L"OEMStrokePath entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMStrokePath: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMStrokePath: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStrokePath)(pso, - ppo, - pco, - pxo, - pbo, - pptlBrushOrg, - plineattrs, - mix); -} - -BOOL APIENTRY -OEMFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - MIX mix, - FLONG flOptions - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvFillPath. - - DrvFillPath is an optional entry point to handle the filling of closed paths. - GDI can call DrvFillPath to fill a path on a device-managed surface. - When deciding whether to call this function, GDI compares the fill - requirements with the following flags in the flGraphicsCaps member of - the DEVINFO structure: GCAPS_BEZIERS, GCAPS_ALTERNATEFILL, - and GCAPS_WINDINGFILL. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to draw. - ppo - Defines the path to be filled - pco - Defines the clipping path - pbo - Defines the pattern and colors to fill with - pptlBrushOrg - Defines the brush origin - mix - Defines the foreground and background ROPs to use for the brush - flOptions - Whether to use zero-winding or odd-even rule - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE(L"OEMFillPath entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMFillPath: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMFillPath: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvFillPath)(pso, - ppo, - pco, - pbo, - pptlBrushOrg, - mix, - flOptions); -} - -BOOL APIENTRY -OEMStrokeAndFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pboStroke, - LINEATTRS *plineattrs, - BRUSHOBJ *pboFill, - POINTL *pptlBrushOrg, - MIX mixFill, - FLONG flOptions - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStrokeAndFillPath. - - DrvStrokeAndFillPath strokes and fills a path concurrently. - The driver can return FALSE if the path or the clipping is too - complex for the device to handle; in that case, GDI converts - to a simpler call. For example, if the device driver has set the - GCAPS_BEZIERS flag in the flGraphicsCaps member of the - DEVINFO structure and then receives a path with Bezier curves, - it can return FALSE; GDI will then convert the Bezier curves to - lines and call DrvStrokeAndFillPath again. If the device driver - returns FALSE again, GDI will further simplify the call, making - calls to DrvStrokePath and DrvFillPath, or to DrvBitBlt, depending - on the mix and width of the lines making up the path. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Describes the surface on which to draw - ppo - Describes the path to be filled - pco - Defines the clipping path - pxo - Specifies the world to device coordinate transformation - pboStroke - Specifies the brush to use when stroking the path - plineattrs - Specifies the line attributes - pboFill - Specifies the brush to use when filling the path - pptlBrushOrg - Specifies the brush origin for both brushes - mixFill - Specifies the foreground and background ROPs to use - for the fill brush - flOptions - Whether to use zero-winding or odd-even rule - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE(L"OEMStrokeAndFillPath entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMStrokeAndFillPath: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMStrokeAndFillPath: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStrokeAndFillPath)(pso, - ppo, - pco, - pxo, - pboStroke, - plineattrs, - pboFill, - pptlBrushOrg, - mixFill, - flOptions); -} - -BOOL APIENTRY -OEMLineTo( - SURFOBJ *pso, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - LONG x1, - LONG y1, - LONG x2, - LONG y2, - RECTL *prclBounds, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvLineTo. - - DrvLineTo draws a single, solid, integer-only cosmetic line. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Describes the surface on which to draw - pco - Defines the clipping path - pbo - Defines the brush used to draw the line - x1,y1 - Specifies the line's starting point - x2,y2 - Specifies the line's ending point - prclBounds - Defines a rectangle that bounds the unclipped line. - mix - Specifies the foreground and background ROP - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE(L"OEMLineTo entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMLineTo: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMLineTo: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvLineTo)(pso, - pco, - pbo, - x1, - y1, - x2, - y2, - prclBounds, - mix); -} - -BOOL APIENTRY -OEMAlphaBlend( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDest, - RECTL *prclSrc, - BLENDOBJ *pBlendObj - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvAlphaBlend. - - DrvAlphaBlend provides bit-block transfer capabilities with alpha blending. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDest - Defines the surface on which to draw - psoSrc - Defines the source - pco - Limits the area to be modified on the Destination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - prclDest - Defines the area to be modified on the Destination surface - prclSrc - Defines the area to be copied from the source surface - BlendFunction - Specifies the blend function to be used - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMAlphaBlend entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDest->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMAlphaBlend: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMAlphaBlend: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvAlphaBlend)(psoDest, - psoSrc, - pco, - pxlo, - prclDest, - prclSrc, - pBlendObj); -} - -BOOL APIENTRY -OEMGradientFill( - SURFOBJ *psoDest, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - TRIVERTEX *pVertex, - ULONG nVertex, - PVOID pMesh, - ULONG nMesh, - RECTL *prclExtents, - POINTL *pptlDitherOrg, - ULONG ulMode - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvGradientFill. - - DrvGradientFill shades the specified primitives. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDest - Defines the surface on which to draw - pco - Limits the area to be modified on the Destination - pxlo - Should be ignored by the driver - pVertex - Pointer to an array of TRIVERTEX structures, - with each entry containing position and color information - nVertex - Specifies the number of TRIVERTEX structures in the - array to which pVertex points - pMesh - Pointer to an array of structures that define the connectivity - of the TRIVERTEX elements to which pVertex points - nMesh - Specifies the number of elements in the array to which - pMesh points - prclExtents - Pointer to a RECTL structure that defines the area in - which the gradient drawing is to occur - pptlDitherOrg - Pointer to a POINTL structure that defines the origin - on the surface for dithering - ulMode - Specifies the current drawing mode and how to interpret - the array to which pMesh points - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMGradientFill entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDest->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMGradientFill: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMGradientFill: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvGradientFill)(psoDest, - pco, - pxlo, - pVertex, - nVertex, - pMesh, - nMesh, - prclExtents, - pptlDitherOrg, - ulMode); -} - -BOOL APIENTRY -OEMTransparentBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - RECTL *prclSrc, - ULONG iTransColor, - ULONG ulReserved - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvTransparentBlt. - - DrvTransparentBlt provides bit-block transfer capabilities with - transparency. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Defines the surface on which to draw - psoSrc - Defines the source - pco - Limits the area to be modified on the Destination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - prclDst - Defines the area to be modified on the Destination surface - prclSrc - Defines the area to be copied from the source surface - iTransColor - Specifies the transparent color - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMTransparentBlt entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMTransparentBlt: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMTransparentBlt: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvTransparentBlt)(psoDst, - psoSrc, - pco, - pxlo, - prclDst, - prclSrc, - iTransColor, - ulReserved); -} - -BOOL APIENTRY -OEMTextOut( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvTextOut. - - DrvTextOut is the entry point from GDI that calls for the - driver to render a set of glyphs at specified positions. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to be written. - pstro - Defines the glyphs to be rendered and their positions - pfo - Specifies the font to be used - pco - Defines the clipping path - prclExtra - A NULL-terminated array of rectangles to be filled - prclOpaque - Specifies an opaque rectangle - pboFore - Defines the foreground brush - pboOpaque - Defines the opaque brush - pptlOrg - Pointer to POINT struct , defining th origin - mix - Specifies the foreground and background ROPs for pboFore - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMTextOut entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - DBG_SURFOBJ(DBG_VERBOSE, L"pso", pso); - DBG_STROBJ(DBG_VERBOSE, L"pstro", pstro); - DBG_FONTOBJ(DBG_VERBOSE, L"pfo", pfo); - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - DBG_BRUSHOBJ(DBG_VERBOSE, L"pboFore", pboFore); - DBG_BRUSHOBJ(DBG_VERBOSE, L"pboOpaque", pboOpaque); - - if (pOemPDEV->bPreAnalysis) - { - VERBOSE(TEXT("OEMTextOut: Begin pre-analysis...\r\n")); - - // Since the bPreAnalysis flag is set, this indicates that the current pass is the pre-analysis pass. - // Perform any pre-analysis tasks here. Note that the surface used during pre-analysis might - // differ from the surface passed in during the rendering pass. - - // Dump the bounds of the clip window available for pre-analysis. - DBG_CLIPOBJ(DBG_VERBOSE, L"pco", pco); - - // Although unidrv calls the hooked drawing functions, it will return before any drawing is done. - // So we should not perform any drawing on the surface. But all other pre-analysis tasks should - // be performed here. For example, certain printers need to handle black objects differently if - // they intersect with any color objects versus being stand alone. Another task could be to halftone - // stretchblt objects differently from bitblt objects. Basically, the plug-in can analyze the objects on the page. - - // During the pre-analysis pass, drawing functions should not call back into Unidrv. - // So we return here. - VERBOSE(TEXT("OEMTextOut: End pre-analysis...\r\n")); - - return TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvTextOut)(pso, - pstro, - pfo, - pco, - prclExtra, - prclOpaque, - pboFore, - pboOpaque, - pptlOrg, - mix); -} - -PIFIMETRICS APIENTRY -OEMQueryFont( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG_PTR *pid - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryFont. - - DrvQueryFont is used by GDI to get the IFIMETRICS structure - for a given font. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - iFile - Identifies the driver font file - iFace - One-based index of the driver font - pid - Points to a LONG variable for returning an identifier - which GDI will pass to DrvFree - -Return Value: - - Pointer to an IFIMETRICS structure for the given font. - NULL if there is an error - ---*/ - -{ - VERBOSE(L"OEMQueryFont entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryFont)(dhpdev, - iFile, - iFace, - pid); -} - -PVOID APIENTRY -OEMQueryFontTree( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG iMode, - ULONG_PTR *pid - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryFontTree. - - DrvQueryFontTree provides GDI with a pointer to a structure that - defines one of the following: - - A mapping from Unicode to glyph handles, including glyph variants - - A mapping of kerning pairs to kerning handles - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - iFile - Identifies the driver font file - iFace - One-based index of the driver font - iMode - Specifies the type of information to be provided - pid - Points to a LONG variable for returning an identifier - which GDI will pass to DrvFree - -Return Value: - - Pointer to the structure requested based on iMode. - NULL if there is an error - ---*/ - -{ - VERBOSE(L"OEMQueryFontTree entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryFontTree)(dhpdev, - iFile, - iFace, - iMode, - pid); -} - -LONG APIENTRY -OEMQueryFontData( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - HGLYPH hg, - GLYPHDATA *pgd, - _Out_writes_bytes_(cjSize) PVOID pv, - ULONG cjSize - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryFontData. - - DrvQueryFontData retrieves information about a realized font. - GDI provides a pointer to an array of glyph or kerning handles, - and the driver returns information about the glyphs or kerning - pairs. The driver can assume that all handles in the array are valid. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - pfo - Points to a FONTOBJ structure - iMode - Type of information requested - hg - A glyph handle - pgd - Points to a GLYPHDATA structure - pv - Points to output buffer - cjSize - Size of output buffer - -Return Value: - - Depends on iMode. FD_ERROR if there is an error - ---*/ - -{ - VERBOSE(L"OEMQueryFontData entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryFontData)(dhpdev, - pfo, - iMode, - hg, - pgd, - pv, - cjSize); -} - -ULONG APIENTRY -OEMFontManagement( - SURFOBJ *pso, - FONTOBJ *pfo, - ULONG iMode, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvFontManagement. - - Is this function valid for Unidrv drivers? - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Points to a SURFOBJ structure - pfo - Points to a FONTOBJ structure - iMode - Escape number - cjIn - Size of input buffer - pvIn - Points to input buffer - cjOut - Size of output buffer - pvOut - Points to output buffer - -Return Value: - - 0x00000001 to 0x7fffffff for success - 0x80000000 to 0xffffffff for failure - 0 if the specified escape number if not supported - ---*/ - -{ - VERBOSE(L"OEMFontManagement entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvFontManagement)(pso, - pfo, - iMode, - cjIn, - pvIn, - cjOut, - pvOut); -} - -BOOL APIENTRY -OEMQueryAdvanceWidths( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - _In_reads_(cGlyphs) HGLYPH *phg, - _Out_writes_bytes_(cGlyphs*sizeof(USHORT)) PVOID pvWidths, - ULONG cGlyphs - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryAdvanceWidths. - - DrvQueryAdvanceWidths returns character advance widths - for a specified set of glyphs. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - pfo - Points to a FONTOBJ structure - iMode - Type of information to be provided - phg - Points to an array of HGLYPHs for which the driver will - provide character advance widths - pvWidths - Points to a buffer for returning width data - cGlyphs - Number of glyphs in the phg array - -Return Value: - - Depends on iMode - ---*/ - -{ - VERBOSE(L"OEMQueryAdvanceWidths entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryAdvanceWidths)(dhpdev, - pfo, - iMode, - phg, - pvWidths, - cGlyphs); -} - -ULONG APIENTRY -OEMGetGlyphMode( - DHPDEV dhpdev, - FONTOBJ *pfo - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvGetGlyphMode. - - DrvGetGlyphMode tells GDI how to cache glyph information. - GDI calls a driver's DrvGetGlyphMode routine to determine the - range of font information that should be cached for a particular - font; that is, DrvGetGlyphMode determines what GDI stores in - its font cache. A device that caches fonts on its own should return - FO_HGLYPHS to minimize the storage requirements for the font. - GDI calls DrvGetGlyphMode for each font realization. For example, - a driver might want to download outlines for point sizes larger than - 12 point, but raster images for smaller fonts. However, GDI reserves - the right to refuse this request. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - pfo - Points to a FONTOBJ structure - -Return Value: - - The glyph mode or FO_GLYPHMODE, which is the default. - ---*/ - -{ - VERBOSE(L"OEMGetGlyphMode entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvGetGlyphMode)(dhpdev, - pfo); -} - -BOOL APIENTRY -OEMStartDoc( - SURFOBJ *pso, - _In_ PWSTR pwszDocName, - DWORD dwJobId - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStartDoc. - - DrvStartDoc is called by GDI when it is ready to - start sending a document to the driver for rendering. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - pDocName - Specifies a Unicode document name - jobId - Identifies the print job - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMStartDoc entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStartDoc)(pso, - pwszDocName, - dwJobId); -} - -BOOL APIENTRY -OEMEndDoc( - SURFOBJ *pso, - FLONG fl - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvEndDoc. - - DrvEndDoc is called by GDI when it has finished - sending a document to the driver for rendering. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - flags - A set of flag bits - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMEndDoc entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvEndDoc)(pso, - fl); -} - -BOOL APIENTRY -OEMStartPage( - SURFOBJ *pso - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStartPage. - - DrvStartPage is called by GDI when it is ready to - start sending the contents of a physical page to the - driver for rendering. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMStartPage entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStartPage)(pso); -} - -BOOL APIENTRY -OEMSendPage( - SURFOBJ *pso - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvSendPage. - - DrvSendPage is called by GDI when it has finished - drawing a physical page, so the driver can send - the page to the printer. - - Please refer to DDK documentation for more details. - - NOTE: OEMSendPage will not be called in any driver that enables - pre-analysis. But the reason we implement this is that the driver - might be pushed to a down-level client and thereby have to run - without pre-analysis support. In this case, it might have to support - OEMSendPage. - -Arguments: - - pso - Defines the surface object - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMSendPage entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvSendPage)(pso); -} - -BOOL APIENTRY -OEMStartBanding( - SURFOBJ *pso, - POINTL *pptl - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStartBanding. - - DrvStartBanding is called by GDI when it is ready to start - sending bands of a physical page to the driver for rendering. - Note: DrvStartBanding is called to prepare the driver - for banding, call only once per page (not at everyband!!) - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - pptl - Pointer to origin of next band (to return to GDI) - -Return Value: - - Fill out pptl to contain the origin of the first band - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMStartBanding entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - DBG_POINTL(DBG_VERBOSE, L"pptl", pptl); - - if (pptl == NULL) - { - VERBOSE(TEXT("OEMStartBanding: Start of OEM Pre-analysis pass...\r\n")); - VERBOSE(TEXT("\tOEM Pre-analysis pass...no drawing on surface in this pass.\r\n")); - pOemPDEV->bPreAnalysis = TRUE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStartBanding)(pso, - pptl); -} - -BOOL APIENTRY -OEMNextBand( - SURFOBJ *pso, - POINTL *pptl - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvNextBand. - - DrvNextBand is called by GDI when it has finished - drawing a band for a physical page, so the driver - can send the band to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - pptl - Pointer to origin of next band (to return to GDI) - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"OEMNextBand entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - DBG_POINTL(DBG_VERBOSE, L"pptl", pptl); - - if (pOemPDEV->bPreAnalysis) - { - // - // First call into OEMNextBand indicates end of pre-analysis path. - // - VERBOSE(TEXT("OEMNextBand: End of OEM Pre-analysis pass...\r\n")); - pOemPDEV->bPreAnalysis = FALSE; - } - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvNextBand)(pso, - pptl); -} - -ULONG APIENTRY -OEMEscape( - SURFOBJ *pso, - ULONG iEsc, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) - -/*++ - -Routine Description: - - Implementation of DDI entry point DrvEscape. - - DrvEscape is used for retrieving information from a device - that is not available in a device-independent device driver - interface; the particular query depends on the value of the - iEsc parameter. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Describes the surface the call is directed to - iEsc - Specifies a query - cjIn - Specifies the size in bytes of the buffer pointed to by pvIn - pvIn - Points to input data buffer - cjOut - Specifies the size in bytes of the buffer pointed to by pvOut - pvOut - Points to the output buffer - -Return Value: - - Depends on the query specified by iEsc parameter. - - Zero if the function specified by the query is not supported. - ---*/ - -{ - VERBOSE(L"OEMEscape entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvEscape)(pso, - iEsc, - cjIn, - pvIn, - cjOut, - pvOut); -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.cpp deleted file mode 100644 index f1807066..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.cpp +++ /dev/null @@ -1,1503 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.cpp -// -// PURPOSE: Implementation of the debug functions. -// -// -// History: -// 06/28/03 xxx created. -// -// - -#include "precomp.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// INTERNAL DEFINES -//////////////////////////////////////////////////////// - -#define DEBUG_BUFFER_SIZE 1024 -#define PATH_SEPARATOR '\\' - -//////////////////////////////////////////////////////// -// EXTERNAL GLOBALS -//////////////////////////////////////////////////////// - -#ifdef DBG - -INT giDebugLevel = DEBUG_LEVEL; - - -PCWSTR -EnsureLabel( - _In_opt_ PCWSTR pszInLabel, - _In_ PCWSTR pszDefLabel - ) - -/*++ - -Routine Description: - - This function checks if pszInLabel is valid. If not, it returns - pszDefLabel else pszInLabel is returned. - -Arguments: - - pszInLabel - custom label string passed in with the call to the dump function - pszDefLabel - default label string in case custom label string is not valid - -Return Value: - - pszInLabel if it is valid, else pszDefLabel - ---*/ - -{ - // By design, pszDefLabel is assumed to be a valid, non-empty - // string (since it is supplied internally). - // - if (!pszInLabel || !*pszInLabel) - { - // The caller supplied a NULL string or empty string; - // supply the internal default. - // - return pszDefLabel; - } - - return pszInLabel; -} - -BOOL OEMDebugMessage( - LPCWSTR lpszMessage, - ... - ) - -/*++ - -Routine Description: - - Outputs variable argument debug string. - -Arguments: - - dwSize - size of temp buffer to hold formatted string - lpszMessage - format string - arglist - Variable argument list... - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - va_list VAList; - HRESULT hResult; - - // Parameter checking. - if( NULL == lpszMessage) - { - return FALSE; - } - - LPWSTR lpszMsgBuf = new WCHAR[DEBUG_BUFFER_SIZE]; - if(NULL == lpszMsgBuf) - return FALSE; - - va_start(VAList, lpszMessage); - // Pass the variable parameters to wvsprintf to be formatted. - hResult = StringCchVPrintfW(lpszMsgBuf, DEBUG_BUFFER_SIZE, lpszMessage, VAList); - va_end(VAList); - - // Dump string to debug output. - OutputDebugStringW(lpszMsgBuf); - - // Clean up. - delete[] lpszMsgBuf; - - return SUCCEEDED(hResult); -} - -PCSTR -StripDirPrefixA( - IN PCSTR pstrFilename - ) - -/*++ - -Routine Description: - - Strip the directory prefix off a filename (ANSI version) - -Arguments: - - pstrFilename - Pointer to filename string - -Return Value: - - Pointer to the last component of a filename (without directory prefix) - ---*/ - -{ - PCSTR pstr; - - pstr = strrchr(pstrFilename, PATH_SEPARATOR); - if (pstr) - return pstr + 1; - - return pstrFilename; -} - -void -vDumpFlags( - DWORD dwFlags, - PDBG_FLAGS pDebugFlags - ) - -/*++ - -Routine Description: - - Dumps the combination of flags in members such as - pso->fjBitmap, pstro->flAccel, pfo->flFontType etc. - -Arguments: - - dwFlags - combined value of the relevant member - Example values are pso->fjBitmap, pstro->flAccel - pDebugFlags - structure containing the different possible values - that can be combined in dwFlags - -Return Value: - - NONE - ---*/ - -{ - DWORD dwFound = 0; - BOOL bFirstFlag = FALSE; - - OEMDebugMessage(L"%#x [", dwFlags); - - // Traverse through the list of flags to see if any match - // - for ( ; pDebugFlags->dwFlag; ++pDebugFlags) - { - if(dwFlags & pDebugFlags->dwFlag) - { - if (!bFirstFlag) - { - OEMDebugMessage(L"%s", pDebugFlags->pszFlag); - bFirstFlag = TRUE; - } - else - { - OEMDebugMessage(L" | %s", pDebugFlags->pszFlag); - } - dwFound |= pDebugFlags->dwFlag; - } - } - - OEMDebugMessage(L"]"); - - // - // Check if there are extra bits set that we don't understand. - // - if(dwFound != dwFlags) - { - OEMDebugMessage(L" ", dwFlags & ~dwFound); - } - - OEMDebugMessage(L"\r\n"); -} - -void -vDumpOemDMParam( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - POEMDMPARAM pOemDMParam - ) - -/*++ - -Routine Description: - - Dumps the members of a OEMDMPARAM structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pOemDMParam - pointer to the OEMDMPARAM strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pOemDMParam"); - - // Return if strct to be dumped is invalid - // - if (!pOemDMParam) - { - OEMDebugMessage(L"\npOemDMParam [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\npOemDMParam [%s]: %#x\r\n", pszLabel, pOemDMParam); - OEMDebugMessage(L"\tcbSize = %d\r\n", pOemDMParam->cbSize); - OEMDebugMessage(L"\tpdriverobj = %#x\r\n", pOemDMParam->pdriverobj); - OEMDebugMessage(L"\thPrinter = %#x\r\n", pOemDMParam->hPrinter); - OEMDebugMessage(L"\thModule = %#x\r\n", pOemDMParam->hModule); - OEMDebugMessage(L"\tpPublicDMIn = %#x\r\n", pOemDMParam->pPublicDMIn); - OEMDebugMessage(L"\tpPublicDMOut = %#x\r\n", pOemDMParam->pPublicDMOut); - OEMDebugMessage(L"\tpOEMDMIn = %#x\r\n", pOemDMParam->pOEMDMIn); - OEMDebugMessage(L"\tpOEMDMOut = %#x\r\n", pOemDMParam->pOEMDMOut); - OEMDebugMessage(L"\tcbBufSize = %d\r\n", pOemDMParam->cbBufSize); - - OEMDebugMessage(L"\n"); - -} - -#if DBG - DBG_FLAGS gafdSURFOBJ_fjBitmap[] = { - { L"BMF_TOPDOWN", BMF_TOPDOWN}, - { L"BMF_NOZEROINIT", BMF_NOZEROINIT}, - { L"BMF_DONTCACHE", BMF_DONTCACHE}, - { L"BMF_USERMEM", BMF_USERMEM}, - { L"BMF_KMSECTION", BMF_KMSECTION}, - { L"BMF_NOTSYSMEM", BMF_NOTSYSMEM}, - { L"BMF_WINDOW_BLT", BMF_WINDOW_BLT}, - {NULL, 0} // The NULL entry is important -// { L"BMF_UMPDMEM", BMF_UMPDMEM}, -// { L"BMF_RESERVED", BMF_RESERVED}, - }; -#else - DBG_FLAGS gafdSURFOBJ_fjBitmap[] = { - {NULL, 0} - }; -#endif - -void -vDumpSURFOBJ( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - SURFOBJ *pso - ) - -/*++ - -Routine Description: - - Dumps the members of a SURFOBJ structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pso - pointer to the SURFOBJ strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pso"); - - // Return if strct to be dumped is invalid - // - if (!pso) - { - OEMDebugMessage(L"\nSURFOBJ [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nSURFOBJ [%s]: %#x\r\n", pszLabel, pso); - OEMDebugMessage(L"\tdhSurf: %#x\r\n", pso->dhsurf); - OEMDebugMessage(L"\thSurf: %#x\r\n", pso->hsurf); - OEMDebugMessage(L"\tdhpdev: %#x\r\n", pso->dhpdev); - OEMDebugMessage(L"\thdev: %#x\r\n", pso->hdev); - OEMDebugMessage(L"\tsizlBitmap: [%ld x %ld]\r\n", pso->sizlBitmap.cx, pso->sizlBitmap.cy); - OEMDebugMessage(L"\tcjBits: %ld\r\n", pso->cjBits); - OEMDebugMessage(L"\tpvBits: %#x\r\n", pso->pvBits); - OEMDebugMessage(L"\tpvScan0: %#x\r\n", pso->pvScan0); - OEMDebugMessage(L"\tlDelta: %ld\r\n", pso->lDelta); - OEMDebugMessage(L"\tiUniq: %ld\r\n", pso->iUniq); - - PWSTR psziBitmapFormat = L"0"; - switch (pso->iBitmapFormat) - { - case BMF_1BPP : psziBitmapFormat = L"BMF_1BPP" ; break; - case BMF_4BPP : psziBitmapFormat = L"BMF_4BPP" ; break; - case BMF_8BPP : psziBitmapFormat = L"BMF_8BPP" ; break; - case BMF_16BPP: psziBitmapFormat = L"BMF_16BPP"; break; - case BMF_24BPP: psziBitmapFormat = L"BMF_24BPP"; break; - case BMF_32BPP: psziBitmapFormat = L"BMF_32BPP"; break; - case BMF_4RLE : psziBitmapFormat = L"BMF_4RLE" ; break; - case BMF_8RLE : psziBitmapFormat = L"BMF_8RLE" ; break; - case BMF_JPEG : psziBitmapFormat = L"BMF_JPEG" ; break; - case BMF_PNG : psziBitmapFormat = L"BMF_PNG " ; break; - } - OEMDebugMessage(L"\tiBitmapFormat: %s\r\n", psziBitmapFormat); - - PWSTR psziType = L"0"; - switch (pso->iType) - { - case STYPE_BITMAP : psziType = L"STYPE_BITMAP" ; break; - case STYPE_DEVBITMAP: psziType = L"STYPE_DEVBITMAP"; break; - case STYPE_DEVICE : psziType = L"STYPE_DEVICE" ; break; - } - OEMDebugMessage(L"\tiType: %s\r\n", psziType); - - OEMDebugMessage(L"\tfjBitmap: "); - if (STYPE_BITMAP == pso->iType) - vDumpFlags(pso->fjBitmap, gafdSURFOBJ_fjBitmap); - else - OEMDebugMessage(L"IGNORE\r\n"); - - OEMDebugMessage(L"\n"); - -} - -#if DBG - DBG_FLAGS gafdSTROBJ_flAccel[] = { - { L"SO_FLAG_DEFAULT_PLACEMENT", SO_FLAG_DEFAULT_PLACEMENT}, - { L"SO_HORIZONTAL", SO_HORIZONTAL}, - { L"SO_VERTICAL", SO_VERTICAL}, - { L"SO_REVERSED", SO_REVERSED}, - { L"SO_ZERO_BEARINGS", SO_ZERO_BEARINGS}, - { L"SO_CHAR_INC_EQUAL_BM_BASE", SO_CHAR_INC_EQUAL_BM_BASE}, - { L"SO_MAXEXT_EQUAL_BM_SIDE", SO_MAXEXT_EQUAL_BM_SIDE}, - { L"SO_DO_NOT_SUBSTITUTE_DEVICE_FONT", SO_DO_NOT_SUBSTITUTE_DEVICE_FONT}, - { L"SO_GLYPHINDEX_TEXTOUT", SO_GLYPHINDEX_TEXTOUT}, - { L"SO_ESC_NOT_ORIENT", SO_ESC_NOT_ORIENT}, - { L"SO_DXDY", SO_DXDY}, - { L"SO_CHARACTER_EXTRA", SO_CHARACTER_EXTRA}, - { L"SO_BREAK_EXTRA", SO_BREAK_EXTRA}, - {NULL, 0} // The NULL entry is important - }; -#else - DBG_FLAGS gafdSTROBJ_flAccel[] = { - {NULL, 0} - }; -#endif - -void -vDumpSTROBJ( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - STROBJ *pstro - ) - -/*++ - -Routine Description: - - Dumps the members of a STROBJ structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pstro - pointer to the STROBJ strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pstro"); - - // Return if strct to be dumped is invalid - // - if (!pstro) - { - OEMDebugMessage(L"\nSTROBJ [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nSTROBJ [%s]: %#x\r\n", pszLabel, pstro); - OEMDebugMessage(L"\tcGlyphs: %ld\r\n", pstro->cGlyphs); - OEMDebugMessage(L"\tflAccel: "); - vDumpFlags(pstro->flAccel, gafdSTROBJ_flAccel); - OEMDebugMessage(L"\tulCharInc: %ld\r\n", pstro->ulCharInc); - OEMDebugMessage(L"\trclBkGround: (%ld, %ld) (%ld, %ld)\r\n", pstro->rclBkGround.left, pstro->rclBkGround.top, pstro->rclBkGround.right, pstro->rclBkGround.bottom); - if (!pstro->pgp) - OEMDebugMessage(L"\tpgp: NULL\r\n"); - else - OEMDebugMessage(L"\tpgp: %#x\r\n", pstro->pgp); - OEMDebugMessage(L"\tpwszOrg: \"%s\"\r\n", pstro->pwszOrg); - - OEMDebugMessage(L"\n"); - -} - -#if DBG - DBG_FLAGS gafdFONTOBJ_flFontType[] = { - { L"FO_TYPE_RASTER", FO_TYPE_RASTER}, - { L"FO_TYPE_DEVICE", FO_TYPE_DEVICE}, - { L"FO_TYPE_TRUETYPE", FO_TYPE_TRUETYPE}, - { L"FO_TYPE_OPENTYPE", 0x8}, - { L"FO_SIM_BOLD", FO_SIM_BOLD}, - { L"FO_SIM_ITALIC", FO_SIM_ITALIC}, - { L"FO_EM_HEIGHT", FO_EM_HEIGHT}, - { L"FO_GRAY16", FO_GRAY16}, - { L"FO_NOGRAY16", FO_NOGRAY16}, - { L"FO_CFF", FO_CFF}, - { L"FO_POSTSCRIPT", FO_POSTSCRIPT}, - { L"FO_MULTIPLEMASTER", FO_MULTIPLEMASTER}, - { L"FO_VERT_FACE", FO_VERT_FACE}, - { L"FO_DBCS_FONT", FO_DBCS_FONT}, - {NULL, 0} // The NULL entry is important - }; -#else - DBG_FLAGS gafdFONTOBJ_flFontType[] = { - {NULL, 0} - }; -#endif - -void -vDumpFONTOBJ( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - FONTOBJ *pfo - ) - -/*++ - -Routine Description: - - Dumps the members of a FONTOBJ structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pfo - pointer to the FONTOBJ strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pfo"); - - // Return if strct to be dumped is invalid - // - if (!pfo) - { - OEMDebugMessage(L"\nFONTOBJ [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nFONTOBJ [%s]: %#x\r\n", pszLabel, pfo); - OEMDebugMessage(L"\tiUniq: %ld\r\n", pfo->iUniq); - OEMDebugMessage(L"\tiFace: %ld\r\n", pfo->iFace); - OEMDebugMessage(L"\tcxMax: %ld\r\n", pfo->cxMax); - OEMDebugMessage(L"\tflFontType: "); - vDumpFlags(pfo->flFontType, gafdFONTOBJ_flFontType); - OEMDebugMessage(L"\tiTTUniq: %#x\r\n", pfo->iTTUniq); - OEMDebugMessage(L"\tiFile: %#x\r\n", pfo->iFile); - OEMDebugMessage(L"\tsizLogResPpi: [%ld x %ld]\r\n", pfo->sizLogResPpi.cx, pfo->sizLogResPpi.cy); - OEMDebugMessage(L"\tulStyleSize: %ld\r\n", pfo->ulStyleSize); - if (!pfo->pvConsumer) - OEMDebugMessage(L"\tpvConsumer: NULL\r\n"); - else - OEMDebugMessage(L"\tpvConsumer: %#x\r\n", pfo->pvConsumer); - if (!pfo->pvProducer) - OEMDebugMessage(L"\tpvProducer: NULL\r\n"); - else - OEMDebugMessage(L"\tpvProducer: %#x\r\n", pfo->pvProducer); - - OEMDebugMessage(L"\n"); - -} - -void -vDumpCLIPOBJ( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - CLIPOBJ *pco - ) - -/*++ - -Routine Description: - - Dumps the members of a CLIPOBJ structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pco - pointer to the CLIPOBJ strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pco"); - - // Return if strct to be dumped is invalid - // - if (!pco) - { - OEMDebugMessage(L"\nCLIPOBJ [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nCLIPOBJ [%s]: %#x\r\n", pszLabel, pco); - OEMDebugMessage(L"\tiUniq: %ld\r\n", pco->iUniq); - OEMDebugMessage(L"\trclBounds: (%ld, %ld) (%ld, %ld)\r\n", pco->rclBounds.left, pco->rclBounds.top, pco->rclBounds.right, pco->rclBounds.bottom); - - PWSTR psziDComplexity = L"Unknown iDComplexity."; - switch (pco->iDComplexity ) - { - case DC_COMPLEX: psziDComplexity = L"DC_COMPLEX"; break; - case DC_RECT: psziDComplexity = L"DC_RECT"; break; - case DC_TRIVIAL: psziDComplexity = L"DC_TRIVIAL"; break; - } - OEMDebugMessage(L"\tiDComplexity: %s\r\n", psziDComplexity); - - PWSTR psziFComplexity = L"0"; - switch (pco->iFComplexity) - { - case FC_COMPLEX: psziFComplexity = L"FC_COMPLEX"; break; - case FC_RECT: psziFComplexity = L"FC_RECT"; break; - case FC_RECT4: psziFComplexity = L"FC_RECT4"; break; - } - OEMDebugMessage(L"\tiFComplexity: %s\r\n", psziFComplexity); - - PWSTR psziMode = L"0"; - switch (pco->iMode) - { - case TC_PATHOBJ: psziMode = L"TC_PATHOBJ"; break; - case TC_RECTANGLES: psziMode = L"TC_RECTANGLES"; break; - } - OEMDebugMessage(L"\tiMode: %s\r\n", psziMode); - - PWSTR pszfjOptions = L"0"; - switch (pco->fjOptions) - { - case OC_BANK_CLIP: pszfjOptions = L"TC_PATHOBJ"; break; - } - OEMDebugMessage(L"\tfjOptions: %s\r\n", pszfjOptions); - - OEMDebugMessage(L"\n"); -} - -#if DBG - DBG_FLAGS gafdBRUSHOBJ_flColorType[] = { - { L"BR_CMYKCOLOR", BR_CMYKCOLOR}, - { L"BR_DEVICE_ICM", BR_DEVICE_ICM}, - { L"BR_HOST_ICM", BR_HOST_ICM}, - {NULL, 0} // The NULL entry is important - }; -#else - DBG_FLAGS gafdBRUSHOBJ_flColorType[] = { - {NULL, 0} - }; -#endif - -void -vDumpBRUSHOBJ( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - BRUSHOBJ *pbo - ) - -/*++ - -Routine Description: - - Dumps the members of a BRUSHOBJ structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pbo - pointer to the BRUSHOBJ strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pbo"); - - // Return if strct to be dumped is invalid - // - if (!pbo) - { - OEMDebugMessage(L"\nBRUSHOBJ [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nBRUSHOBJ [%s]: %#x\r\n", pszLabel, pbo); - OEMDebugMessage(L"\tiSolidColor: %#x\r\n", pbo->iSolidColor); - OEMDebugMessage(L"\tpvRbrush: %#x\r\n", pbo->pvRbrush); - OEMDebugMessage(L"\tflColorType: "); - vDumpFlags(pbo->flColorType, gafdBRUSHOBJ_flColorType); - - OEMDebugMessage(L"\n"); -} - -#if DBG - DBG_FLAGS gafdGDIINFO_flHTFlags[] = { - { L"HT_FLAG_8BPP_CMY332_MASK", HT_FLAG_8BPP_CMY332_MASK}, - { L"HT_FLAG_ADDITIVE_PRIMS", HT_FLAG_ADDITIVE_PRIMS}, - { L"HT_FLAG_DO_DEVCLR_XFORM", HT_FLAG_DO_DEVCLR_XFORM}, - { L"HT_FLAG_HAS_BLACK_DYE", HT_FLAG_HAS_BLACK_DYE}, - { L"HT_FLAG_HIGH_INK_ABSORPTION", HT_FLAG_HIGH_INK_ABSORPTION}, - { L"HT_FLAG_HIGHER_INK_ABSORPTION", HT_FLAG_HIGHER_INK_ABSORPTION}, - { L"HT_FLAG_HIGHEST_INK_ABSORPTION", HT_FLAG_HIGHEST_INK_ABSORPTION}, - { L"HT_FLAG_INK_ABSORPTION_IDX0", HT_FLAG_INK_ABSORPTION_IDX0}, - { L"HT_FLAG_INK_ABSORPTION_IDX1", HT_FLAG_INK_ABSORPTION_IDX1}, - { L"HT_FLAG_INK_ABSORPTION_IDX2", HT_FLAG_INK_ABSORPTION_IDX2}, - { L"HT_FLAG_INK_ABSORPTION_IDX3", HT_FLAG_INK_ABSORPTION_IDX3}, - { L"HT_FLAG_INK_HIGH_ABSORPTION", HT_FLAG_INK_HIGH_ABSORPTION}, - { L"HT_FLAG_LOW_INK_ABSORPTION", HT_FLAG_LOW_INK_ABSORPTION}, - { L"HT_FLAG_LOWER_INK_ABSORPTION", HT_FLAG_LOWER_INK_ABSORPTION}, - { L"HT_FLAG_LOWEST_INK_ABSORPTION", HT_FLAG_LOWEST_INK_ABSORPTION}, - { L"HT_FLAG_OUTPUT_CMY", HT_FLAG_OUTPUT_CMY}, - { L"HT_FLAG_PRINT_DRAFT_MODE", HT_FLAG_PRINT_DRAFT_MODE}, - { L"HT_FLAG_SQUARE_DEVICE_PEL", HT_FLAG_SQUARE_DEVICE_PEL}, - { L"HT_FLAG_USE_8BPP_BITMASK", HT_FLAG_USE_8BPP_BITMASK}, - { L"HT_FLAG_NORMAL_INK_ABSORPTION", HT_FLAG_NORMAL_INK_ABSORPTION}, -// { L"HT_FLAG_INVERT_8BPP_BITMASK_IDX", HT_FLAG_INVERT_8BPP_BITMASK_IDX}, - {NULL, 0} // The NULL entry is important - }; -#else - DBG_FLAGS gafdGDIINFO_flHTFlags[] = { - {NULL, 0} - }; -#endif - -void -vDumpGDIINFO( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - GDIINFO *pGdiInfo - ) - -/*++ - -Routine Description: - - Dumps the members of a GDIINFO structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pGdiInfo - pointer to the GDIINFO strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pGdiInfo"); - - // Return if strct to be dumped is invalid - // - if (!pGdiInfo) - { - OEMDebugMessage(L"\nGDIINFO [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nGDIINFO [%s]: %#x\r\n", pszLabel, pGdiInfo); - OEMDebugMessage(L"\tulVersion: %#x\r\n", pGdiInfo->ulVersion); - - PWSTR pszulTechnology = L"???"; - switch (pGdiInfo->ulTechnology) - { - case DT_PLOTTER: pszulTechnology = L"DT_PLOTTER"; break; - case DT_RASDISPLAY: pszulTechnology = L"DT_RASDISPLAY"; break; - case DT_RASPRINTER: pszulTechnology = L"DT_RASPRINTER"; break; - case DT_RASCAMERA: pszulTechnology = L"DT_RASCAMERA"; break; - case DT_CHARSTREAM: pszulTechnology = L"DT_CHARSTREAM"; break; - } - OEMDebugMessage(L"\tulTechnology: %ld [%s]\r\n", pGdiInfo->ulTechnology, pszulTechnology); - - OEMDebugMessage(L"\tulHorzSize: %ld\r\n", pGdiInfo->ulHorzSize); - OEMDebugMessage(L"\tulVertSize: %ld\r\n", pGdiInfo->ulVertSize); - OEMDebugMessage(L"\tulHorzRes: %ld\r\n", pGdiInfo->ulHorzRes); - OEMDebugMessage(L"\tulVertRes: %ld\r\n", pGdiInfo->ulVertRes); - OEMDebugMessage(L"\tcBitsPixel: %ld\r\n", pGdiInfo->cBitsPixel); - OEMDebugMessage(L"\tcPlanes: %ld\r\n", pGdiInfo->cPlanes); - OEMDebugMessage(L"\tulNumColors: %ld\r\n", pGdiInfo->ulNumColors); - OEMDebugMessage(L"\tflRaster: %#x\r\n", pGdiInfo->flRaster); - OEMDebugMessage(L"\tulLogPixelsX: %ld\r\n", pGdiInfo->ulLogPixelsX); - OEMDebugMessage(L"\tulLogPixelsY: %ld\r\n", pGdiInfo->ulLogPixelsY); - - PWSTR pszTextCaps = L"Text scrolling through DrvBitBlt/DrvCopyBits"; - if (TC_SCROLLBLT == (pGdiInfo->flTextCaps & TC_SCROLLBLT)) - { - pszTextCaps = L"Text scrolling through DrvTextOut"; - } - OEMDebugMessage(L"\tflTextCaps: %s\n", pszTextCaps); - - OEMDebugMessage(L"\tulDACRed: %#x\r\n", pGdiInfo->ulDACRed); - OEMDebugMessage(L"\tulDACGreen: %#x\r\n", pGdiInfo->ulDACGreen); - OEMDebugMessage(L"\tulDACBlue: %#x\r\n", pGdiInfo->ulDACBlue); - OEMDebugMessage(L"\tulAspectX: %ld\r\n", pGdiInfo->ulAspectX); - OEMDebugMessage(L"\tulAspectY: %ld\r\n", pGdiInfo->ulAspectY); - OEMDebugMessage(L"\tulAspectXY: %ld\r\n", pGdiInfo->ulAspectXY); - OEMDebugMessage(L"\txStyleStep: %ld\r\n", pGdiInfo->xStyleStep); - OEMDebugMessage(L"\tyStyleStep: %ld\r\n", pGdiInfo->yStyleStep); - OEMDebugMessage(L"\tdenStyleStep: %ld\r\n", pGdiInfo->denStyleStep); - OEMDebugMessage(L"\tptlPhysOffset: (%ld, %ld)\r\n", pGdiInfo->ptlPhysOffset.x, pGdiInfo->ptlPhysOffset.y); - OEMDebugMessage(L"\tszlPhysSize: (%ld, %ld)\r\n", pGdiInfo->szlPhysSize.cx, pGdiInfo->szlPhysSize.cy); - OEMDebugMessage(L"\tulNumPalReg: %ld\r\n", pGdiInfo->ulNumPalReg); - OEMDebugMessage(L"\tulDevicePelsDPI: %ld\r\n", pGdiInfo->ulDevicePelsDPI); - - PWSTR pszPrimaryOrder = L"???"; - switch(pGdiInfo->ulPrimaryOrder) - { - case PRIMARY_ORDER_ABC: pszPrimaryOrder = L"PRIMARY_ORDER_ABC [RGB/CMY]"; break; - case PRIMARY_ORDER_ACB: pszPrimaryOrder = L"PRIMARY_ORDER_ACB [RBG/CYM]"; break; - case PRIMARY_ORDER_BAC: pszPrimaryOrder = L"PRIMARY_ORDER_BAC [GRB/MCY]"; break; - case PRIMARY_ORDER_BCA: pszPrimaryOrder = L"PRIMARY_ORDER_BCA [GBR/MYC]"; break; - case PRIMARY_ORDER_CBA: pszPrimaryOrder = L"PRIMARY_ORDER_CBA [BGR/YMC]"; break; - case PRIMARY_ORDER_CAB: pszPrimaryOrder = L"PRIMARY_ORDER_CAB [BRG/YCM]"; break; - } - OEMDebugMessage(L"\tulPrimaryOrder: %s\n", pszPrimaryOrder); - - PWSTR pszHTPat = L"???"; - switch(pGdiInfo->ulHTPatternSize) - { - case HT_PATSIZE_2x2 : pszHTPat = L"HT_PATSIZE_2x2 "; break; - case HT_PATSIZE_2x2_M : pszHTPat = L"HT_PATSIZE_2x2_M"; break; - case HT_PATSIZE_4x4 : pszHTPat = L"HT_PATSIZE_4x4"; break; - case HT_PATSIZE_4x4_M : pszHTPat = L"HT_PATSIZE_4x4_M"; break; - case HT_PATSIZE_6x6 : pszHTPat = L"HT_PATSIZE_6x6"; break; - case HT_PATSIZE_6x6_M : pszHTPat = L"HT_PATSIZE_6x6_M"; break; - case HT_PATSIZE_8x8 : pszHTPat = L"HT_PATSIZE_8x8"; break; - case HT_PATSIZE_8x8_M : pszHTPat = L"HT_PATSIZE_8x8_M"; break; - case HT_PATSIZE_10x10 : pszHTPat = L"HT_PATSIZE_10x10"; break; - case HT_PATSIZE_10x10_M : pszHTPat = L"HT_PATSIZE_10x10_M"; break; - case HT_PATSIZE_12x12 : pszHTPat = L"HT_PATSIZE_12x12"; break; - case HT_PATSIZE_12x12_M : pszHTPat = L"HT_PATSIZE_12x12_M"; break; - case HT_PATSIZE_14x14 : pszHTPat = L"HT_PATSIZE_14x14"; break; - case HT_PATSIZE_14x14_M : pszHTPat = L"HT_PATSIZE_14x14_M"; break; - case HT_PATSIZE_16x16 : pszHTPat = L"HT_PATSIZE_16x16"; break; - case HT_PATSIZE_16x16_M : pszHTPat = L"HT_PATSIZE_16x16_M"; break; - case HT_PATSIZE_SUPERCELL : pszHTPat = L"HT_PATSIZE_SUPERCELL"; break; - case HT_PATSIZE_SUPERCELL_M : pszHTPat = L"HT_PATSIZE_SUPERCELL_M"; break; - case HT_PATSIZE_USER : pszHTPat = L"HT_PATSIZE_USER"; break; -// case HT_PATSIZE_MAX_INDEX : pszHTPat = L"HT_PATSIZE_MAX_INDEX"; break; -// case HT_PATSIZE_DEFAULT : pszHTPat = L"HT_PATSIZE_DEFAULT"; break; - } - OEMDebugMessage(L"\tulHTPatternSize: %s\n", pszHTPat); - - PWSTR pszHTOutputFormat = L"???"; - switch(pGdiInfo->ulHTOutputFormat) - { - case HT_FORMAT_1BPP : pszHTOutputFormat = L"HT_FORMAT_1BPP"; break; - case HT_FORMAT_4BPP : pszHTOutputFormat = L"HT_FORMAT_4BPP"; break; - case HT_FORMAT_4BPP_IRGB : pszHTOutputFormat = L"HT_FORMAT_4BPP_IRGB"; break; - case HT_FORMAT_8BPP : pszHTOutputFormat = L"HT_FORMAT_8BPP"; break; - case HT_FORMAT_16BPP : pszHTOutputFormat = L"HT_FORMAT_16BPP"; break; - case HT_FORMAT_24BPP : pszHTOutputFormat = L"HT_FORMAT_24BPP"; break; - case HT_FORMAT_32BPP : pszHTOutputFormat = L"HT_FORMAT_32BPP"; break; - } - OEMDebugMessage(L"\tulHTOutputFormat: %s\n", pszHTOutputFormat); - - OEMDebugMessage(L"\tflHTFlags: "); - vDumpFlags(pGdiInfo->flHTFlags, gafdGDIINFO_flHTFlags); - OEMDebugMessage(L"\tulVRefresh: %ld\r\n", pGdiInfo->ulVRefresh); - OEMDebugMessage(L"\tulBltAlignment: %ld\r\n", pGdiInfo->ulBltAlignment); - OEMDebugMessage(L"\tulPanningHorzRes: %ld\r\n", pGdiInfo->ulPanningHorzRes); - OEMDebugMessage(L"\tulPanningVertRes: %ld\r\n", pGdiInfo->ulPanningVertRes); - OEMDebugMessage(L"\txPanningAlignment: %ld\r\n", pGdiInfo->xPanningAlignment); - OEMDebugMessage(L"\tyPanningAlignment: %ld\r\n", pGdiInfo->yPanningAlignment); - OEMDebugMessage(L"\tcxHTPat: %ld\r\n", pGdiInfo->cxHTPat); - OEMDebugMessage(L"\tcyHTPat: %ld\r\n", pGdiInfo->cyHTPat); - OEMDebugMessage(L"\tpHTPatA: %#x\r\n", pGdiInfo->pHTPatA); - OEMDebugMessage(L"\tpHTPatB: %#x\r\n", pGdiInfo->pHTPatB); - OEMDebugMessage(L"\tpHTPatC: %#x\r\n", pGdiInfo->pHTPatC); - OEMDebugMessage(L"\tflShadeBlend: %#x\r\n", pGdiInfo->flShadeBlend); - - PWSTR pszPhysPixChars = L"???"; - switch(pGdiInfo->ulPhysicalPixelCharacteristics) - { - case PPC_DEFAULT: pszPhysPixChars = L"PPC_DEFAULT"; break; - case PPC_BGR_ORDER_HORIZONTAL_STRIPES: pszPhysPixChars = L"PPC_BGR_ORDER_HORIZONTAL_STRIPES"; break; - case PPC_BGR_ORDER_VERTICAL_STRIPES: pszPhysPixChars = L"PPC_BGR_ORDER_VERTICAL_STRIPES"; break; - case PPC_RGB_ORDER_HORIZONTAL_STRIPES: pszPhysPixChars = L"PPC_RGB_ORDER_HORIZONTAL_STRIPES"; break; - case PPC_RGB_ORDER_VERTICAL_STRIPES: pszPhysPixChars = L"PPC_RGB_ORDER_VERTICAL_STRIPES"; break; - case PPC_UNDEFINED: pszPhysPixChars = L"PPC_UNDEFINED"; break; - } - OEMDebugMessage(L"\tulPhysicalPixelCharacteristics: %s\n", pszPhysPixChars); - - PWSTR pszPhysPixGamma = L"???"; - switch(pGdiInfo->ulPhysicalPixelGamma) - { - case PPG_DEFAULT: pszPhysPixGamma = L"PPG_DEFAULT"; break; - case PPG_SRGB : pszPhysPixGamma = L"PPG_SRGB"; break; - } - OEMDebugMessage(L"\tulPhysicalPixelGamma: %s\n", pszPhysPixGamma); - - OEMDebugMessage(L"\n"); -} - -#if DBG - DBG_FLAGS gafdDEVINFO_flGraphicsCaps[] = { - { L"GCAPS_BEZIERS", GCAPS_BEZIERS}, - { L"GCAPS_GEOMETRICWIDE", GCAPS_GEOMETRICWIDE}, - { L"GCAPS_ALTERNATEFILL", GCAPS_ALTERNATEFILL}, - { L"GCAPS_WINDINGFILL", GCAPS_WINDINGFILL}, - { L"GCAPS_HALFTONE", GCAPS_HALFTONE}, - { L"GCAPS_COLOR_DITHER", GCAPS_COLOR_DITHER}, - { L"GCAPS_HORIZSTRIKE", GCAPS_HORIZSTRIKE}, - { L"GCAPS_VERTSTRIKE", GCAPS_VERTSTRIKE}, - { L"GCAPS_OPAQUERECT", GCAPS_OPAQUERECT}, - { L"GCAPS_VECTORFONT", GCAPS_VECTORFONT}, - { L"GCAPS_MONO_DITHER", GCAPS_MONO_DITHER}, - { L"GCAPS_ASYNCCHANGE", GCAPS_ASYNCCHANGE}, - { L"GCAPS_ASYNCMOVE", GCAPS_ASYNCMOVE}, - { L"GCAPS_DONTJOURNAL", GCAPS_DONTJOURNAL}, - { L"GCAPS_DIRECTDRAW", GCAPS_DIRECTDRAW}, - { L"GCAPS_ARBRUSHOPAQUE", GCAPS_ARBRUSHOPAQUE}, - { L"GCAPS_PANNING", GCAPS_PANNING}, - { L"GCAPS_PALMANAGED", GCAPS_PALMANAGED}, - { L"GCAPS_DITHERONREALIZE", GCAPS_DITHERONREALIZE}, - { L"GCAPS_NO64BITMEMACCESS", GCAPS_NO64BITMEMACCESS}, - { L"GCAPS_FORCEDITHER", GCAPS_FORCEDITHER}, - { L"GCAPS_GRAY16", GCAPS_GRAY16}, - { L"GCAPS_ICM", GCAPS_ICM}, - { L"GCAPS_CMYKCOLOR", GCAPS_CMYKCOLOR}, - { L"GCAPS_LAYERED", GCAPS_LAYERED}, - { L"GCAPS_ARBRUSHTEXT", GCAPS_ARBRUSHTEXT}, - { L"GCAPS_SCREENPRECISION", GCAPS_SCREENPRECISION}, - { L"GCAPS_FONT_RASTERIZER", GCAPS_FONT_RASTERIZER}, - { L"GCAPS_NUP", GCAPS_NUP}, - {NULL, 0} // The NULL entry is important - }; - - DBG_FLAGS gafdDEVINFO_flGraphicsCaps2[] = { - { L"GCAPS2_JPEGSRC", GCAPS2_JPEGSRC}, - { L"GCAPS2_xxxx", GCAPS2_xxxx}, - { L"GCAPS2_PNGSRC", GCAPS2_PNGSRC}, - { L"GCAPS2_CHANGEGAMMARAMP", GCAPS2_CHANGEGAMMARAMP}, - { L"GCAPS2_ALPHACURSOR", GCAPS2_ALPHACURSOR}, - { L"GCAPS2_SYNCFLUSH", GCAPS2_SYNCFLUSH}, - { L"GCAPS2_SYNCTIMER", GCAPS2_SYNCTIMER}, - { L"GCAPS2_ICD_MULTIMON", GCAPS2_ICD_MULTIMON}, - { L"GCAPS2_MOUSETRAILS", GCAPS2_MOUSETRAILS}, - { L"GCAPS2_REMOTEDRIVER", GCAPS2_REMOTEDRIVER}, - {NULL, 0} // The NULL entry is important - }; -#else - DBG_FLAGS gafdDEVINFO_flGraphicsCaps[] = { - {NULL, 0} - }; - - DBG_FLAGS gafdDEVINFO_flGraphicsCaps2[] = { - {NULL, 0} - }; -#endif - -void -vDumpDEVINFO( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - DEVINFO *pDevInfo - ) - -/*++ - -Routine Description: - - Dumps the members of a DEVINFO structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pDevInfo - pointer to the DEVINFO strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pDevInfo"); - - // Return if strct to be dumped is invalid - // - if (!pDevInfo) - { - OEMDebugMessage(L"\nDEVINFO [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nDEVINFO [%s]: %#x\r\n", pszLabel, pDevInfo); - OEMDebugMessage(L"\tflGraphicsCaps: "); - vDumpFlags(pDevInfo->flGraphicsCaps, gafdDEVINFO_flGraphicsCaps); - OEMDebugMessage(L"\tcFonts: %ld\r\n", pDevInfo->cFonts); - - PWSTR psziDitherFormat = L"0"; - switch (pDevInfo->iDitherFormat) - { - case BMF_1BPP : psziDitherFormat = L"BMF_1BPP" ; break; - case BMF_4BPP : psziDitherFormat = L"BMF_4BPP" ; break; - case BMF_8BPP : psziDitherFormat = L"BMF_8BPP" ; break; - case BMF_16BPP: psziDitherFormat = L"BMF_16BPP"; break; - case BMF_24BPP: psziDitherFormat = L"BMF_24BPP"; break; - case BMF_32BPP: psziDitherFormat = L"BMF_32BPP"; break; - case BMF_4RLE : psziDitherFormat = L"BMF_4RLE" ; break; - case BMF_8RLE : psziDitherFormat = L"BMF_8RLE" ; break; - case BMF_JPEG : psziDitherFormat = L"BMF_JPEG" ; break; - case BMF_PNG : psziDitherFormat = L"BMF_PNG " ; break; - } - OEMDebugMessage(L"\tiDitherFormat: %s\r\n", psziDitherFormat); - - OEMDebugMessage(L"\tcxDither: %ld\r\n", pDevInfo->cxDither); - OEMDebugMessage(L"\tcyDither: %ld\r\n", pDevInfo->cyDither); - OEMDebugMessage(L"\thpalDefault: %#x\r\n", pDevInfo->hpalDefault); - OEMDebugMessage(L"\tflGraphicsCaps2: "); - vDumpFlags(pDevInfo->flGraphicsCaps2, gafdDEVINFO_flGraphicsCaps2); - - OEMDebugMessage(L"\n"); -} - -void -vDumpBitmapInfoHeader( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - BITMAPINFOHEADER *pBitmapInfoHeader - ) - -/*++ - -Routine Description: - - Dumps the members of a BITMAPINFOHEADER structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pBitmapInfoHeader - pointer to the BITMAPINFOHEADER strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pBitmapInfoHeader"); - - // Return if strct to be dumped is invalid - // - if (!pBitmapInfoHeader) - { - OEMDebugMessage(L"\nBITMAPINFOHEADER [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nBITMAPINFOHEADER [%s]: %#x\r\n", pszLabel, pBitmapInfoHeader); - OEMDebugMessage(L"\tbiSize: %ld\r\n", pBitmapInfoHeader->biSize); - OEMDebugMessage(L"\tbiWidth: %ld\r\n", pBitmapInfoHeader->biWidth); - OEMDebugMessage(L"\tbiHeight: %ld\r\n", pBitmapInfoHeader->biHeight); - OEMDebugMessage(L"\tbiPlanes: %ld\r\n", pBitmapInfoHeader->biPlanes); - OEMDebugMessage(L"\tbiBitCount: %ld\r\n", pBitmapInfoHeader->biBitCount); - - PWSTR pszbiCompression = L"0"; - switch (pBitmapInfoHeader->biCompression) - { - case BI_RGB : pszbiCompression = L"BI_RGB" ; break; - case BI_RLE8 : pszbiCompression = L"BI_RLE8" ; break; - case BI_RLE4 : pszbiCompression = L"BI_RLE4" ; break; - case BI_BITFIELDS: pszbiCompression = L"BI_BITFIELDS"; break; - case BI_JPEG : pszbiCompression = L"BI_JPEG" ; break; - case BI_PNG : pszbiCompression = L"BI_PNG " ; break; - } - OEMDebugMessage(L"\tbiCompression: %s\r\n", pszbiCompression); - - OEMDebugMessage(L"\tbiSizeImage: %ld\r\n", pBitmapInfoHeader->biSizeImage); - OEMDebugMessage(L"\tbiXPelsPerMeter: %ld\r\n", pBitmapInfoHeader->biXPelsPerMeter); - OEMDebugMessage(L"\tbiYPelsPerMeter: %ld\r\n", pBitmapInfoHeader->biYPelsPerMeter); - OEMDebugMessage(L"\tbiClrUsed: %ld\r\n", pBitmapInfoHeader->biClrUsed); - OEMDebugMessage(L"\tbiClrImportant: %ld\r\n", pBitmapInfoHeader->biClrImportant); - - OEMDebugMessage(L"\n"); -} - -void -vDumpPOINTL( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - POINTL *pptl - ) - -/*++ - -Routine Description: - - Dumps the members of a POINTL structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pptl - pointer to the POINTL strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pptl"); - - // Return if strct to be dumped is invalid - // - if (!pptl) - { - OEMDebugMessage(L"\nPOINTL [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nPOINTL [%s]: %#x (%ld, %ld)\r\n", pszLabel, pptl, pptl->x, pptl->y); - - OEMDebugMessage(L"\n"); -} - -void -vDumpRECTL( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - RECTL *prcl - ) - -/*++ - -Routine Description: - - Dumps the members of a RECTL structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - prcl - pointer to the RECTL strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"prcl"); - - // Return if strct to be dumped is invalid - // - if (!prcl) - { - OEMDebugMessage(L"\nRECTL [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nRECTL [%s]: %#x (%ld, %ld) (%ld, %ld)\r\n", pszLabel, prcl, prcl->left, prcl->top, prcl->right, prcl->bottom); - - OEMDebugMessage(L"\n"); -} - -#if DBG - DBG_FLAGS gafdXLATEOBJ_flXlate[] = { - { L"XO_DEVICE_ICM", XO_DEVICE_ICM}, - { L"XO_FROM_CMYK", XO_FROM_CMYK}, - { L"XO_HOST_ICM", XO_HOST_ICM}, - { L"XO_TABLE", XO_TABLE}, - { L"XO_TO_MONO", XO_TO_MONO}, - { L"XO_TRIVIAL", XO_TRIVIAL}, - {NULL, 0} // The NULL entry is important - }; -#else - DBG_FLAGS gafdXLATEOBJ_flXlate[] = { - {NULL, 0} - }; -#endif - -void -vDumpXLATEOBJ( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - XLATEOBJ *pxlo - ) - -/*++ - -Routine Description: - - Dumps the members of a XLATEOBJ structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pxlo - pointer to the XLATEOBJ strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pxlo"); - - // Return if strct to be dumped is invalid - // - if (!pxlo) - { - OEMDebugMessage(L"\nXLATEOBJ [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nXLATEOBJ [%s]: %#x\r\n", pszLabel, pxlo); - OEMDebugMessage(L"\tiUniq: %ld\r\n", pxlo->iUniq); - OEMDebugMessage(L"\tflXlate: "); - vDumpFlags(pxlo->flXlate, gafdXLATEOBJ_flXlate); - OEMDebugMessage(L"\tiSrcType: %ld [obsolete]\r\n", pxlo->iSrcType); - OEMDebugMessage(L"\tiDstType: %ld [obsolete]\r\n", pxlo->iDstType); - OEMDebugMessage(L"\tcEntries: %ld\r\n", pxlo->cEntries); - if (pxlo->pulXlate) - OEMDebugMessage(L"\tpulXlate: %#x [%ld]\r\n", pxlo->pulXlate, *pxlo->pulXlate); - else - OEMDebugMessage(L"\tpulXlate: %#x\r\n", pxlo->pulXlate); - - OEMDebugMessage(L"\n"); -} - -#if DBG - DBG_FLAGS gafdCOLORADJUSTMENT_caFlags[] = { - { L"CA_NEGATIVE", CA_NEGATIVE}, - { L"CA_LOG_FILTER", CA_LOG_FILTER}, - {NULL, 0} // The NULL entry is important - }; -#else - DBG_FLAGS gafdCOLORADJUSTMENT_caFlags[] = { - {NULL, 0} - }; -#endif - -void -vDumpCOLORADJUSTMENT( - INT iDebugLevel, - _In_ PWSTR pszInLabel, - COLORADJUSTMENT *pca - ) - -/*++ - -Routine Description: - - Dumps the members of a COLORADJUSTMENT structure. - -Arguments: - - iDebugLevel - desired output debug level - pszInLabel - output label string - pca - pointer to the COLORADJUSTMENT strct to be dumped - -Return Value: - - NONE - ---*/ - -{ - // Check if the debug level is appropriate - // - if (iDebugLevel < giDebugLevel) - { - // Nothing to output here - // - return; - } - - // Prepare the label string - // - PCWSTR pszLabel = EnsureLabel(pszInLabel, L"pca"); - - // Return if strct to be dumped is invalid - // - if (!pca) - { - OEMDebugMessage(L"\nCOLORADJUSTMENT [%s]: NULL\r\n", pszLabel); - - // Nothing else to output - // - return; - } - - // Format the data - // - OEMDebugMessage(L"\nCOLORADJUSTMENT [%s]: %#x\r\n", pszLabel, pca); - OEMDebugMessage(L"\tcaSize: %#x\r\n", pca->caSize); - OEMDebugMessage(L"\tcaFlags: "); - if (pca->caFlags) - vDumpFlags(pca->caFlags, gafdCOLORADJUSTMENT_caFlags); - else - OEMDebugMessage(L"NULL\r\n"); - - PWSTR pszcaIlluminantIndex = L"0"; - switch (pca->caIlluminantIndex) - { - case ILLUMINANT_DEVICE_DEFAULT: pszcaIlluminantIndex = L"ILLUMINANT_DEVICE_DEFAULT" ; break; - case ILLUMINANT_A: pszcaIlluminantIndex = L"ILLUMINANT_A [Tungsten lamp]" ; break; - case ILLUMINANT_B: pszcaIlluminantIndex = L"ILLUMINANT_B [Noon sunlight]" ; break; - case ILLUMINANT_C: pszcaIlluminantIndex = L"ILLUMINANT_C [NTSC daylight]" ; break; - case ILLUMINANT_D50: pszcaIlluminantIndex = L"ILLUMINANT_D50 [Normal print]" ; break; - case ILLUMINANT_D55: pszcaIlluminantIndex = L"ILLUMINANT_D55 [Bond paper print]" ; break; - case ILLUMINANT_D65: pszcaIlluminantIndex = L"ILLUMINANT_D65 [Standard daylight]" ; break; - case ILLUMINANT_D75: pszcaIlluminantIndex = L"ILLUMINANT_D75 [Northern daylight]" ; break; - case ILLUMINANT_F2: pszcaIlluminantIndex = L"ILLUMINANT_F2 [Cool white lamp]" ; break; - } - OEMDebugMessage(L"\tcaIlluminantIndex: %s\r\n", pszcaIlluminantIndex); - - OEMDebugMessage(L"\tcaRedGamma: %d\r\n", (int)pca->caRedGamma); - OEMDebugMessage(L"\tcaGreenGamma: %d\r\n", (int)pca->caGreenGamma); - OEMDebugMessage(L"\tcaBlueGamma: %d\r\n", (int)pca->caBlueGamma); - OEMDebugMessage(L"\tcaReferenceBlack: %d\r\n", (int)pca->caReferenceBlack); - OEMDebugMessage(L"\tcaReferenceWhite: %d\r\n", (int)pca->caReferenceWhite); - OEMDebugMessage(L"\tcaContrast: %d\r\n", (int)pca->caContrast); - OEMDebugMessage(L"\tcaBrightness: %d\r\n", (int)pca->caBrightness); - OEMDebugMessage(L"\tcaColorfulness: %d\r\n", (int)pca->caColorfulness); - OEMDebugMessage(L"\tcaRedGreenTint: %d\r\n", (int)pca->caRedGreenTint); - - OEMDebugMessage(L"\n"); -} - -#endif - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.h deleted file mode 100644 index 2b488890..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/debug.h +++ /dev/null @@ -1,215 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// -// History: -// 06/28/03 xxx created. -// -// - -#pragma once - -#include "devmode.h" - -// VC and Build use different debug defines. -// The following makes it so either will -// cause the inclusion of debugging code. -#if !defined(_DEBUG) && defined(DBG) - #define _DEBUG DBG -#elif defined(_DEBUG) && !defined(DBG) - #define DBG _DEBUG -#endif - - - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// VERBOSE(msg) -// Display a message if the current debug level is <= DBG_VERBOSE. -// -// TERSE(msg) -// Display a message if the current debug level is <= DBG_TERSE. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// ASSERTMSG(cond, msg) -// Verify a condition is true. If not, display a message and -// force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// These macros require extra parantheses for the msg argument -// example, ASSERTMSG(x > 0, ("x is less than 0\n")); -// WARNING(("App passed NULL pointer, ignoring...\n")); -// - -#define DBG_VERBOSE 1 -#define DBG_TERSE 2 -#define DBG_WARNING 3 -#define DBG_ERROR 4 -#define DBG_RIP 5 -#define DBG_NONE 6 - -// -// Determine what level of debugging messages to emit. -// This can be set in the sources file, or omitted -// completely -// -#ifdef VERBOSE_MSG - #define DEBUG_LEVEL DBG_VERBOSE -#elif TERSE_MSG - #define DEBUG_LEVEL DBG_TERSE -#elif WARNING_MSG - #define DEBUG_LEVEL DBG_WARNING -#elif ERROR_MSG - #define DEBUG_LEVEL DBG_ERROR -#elif RIP_MSG - #define DEBUG_LEVEL DBG_RIP -#elif NO_DBG_MSG - #define DEBUG_LEVEL DBG_NONE -#else - #define DEBUG_LEVEL DBG_WARNING -#endif - - -#if DBG - - extern INT giDebugLevel; - - #define DBGMSG(level, prefix, msg) { \ - if (giDebugLevel <= (level)) { \ - OEMDebugMessage(L"%s %s (%d): ", prefix, StripDirPrefixA(__FILE__), __LINE__); \ - OEMDebugMessage(msg); \ - } \ - } - - #define VERBOSE if(giDebugLevel <= DBG_VERBOSE) OEMDebugMessage - #define TERSE if(giDebugLevel <= DBG_TERSE) OEMDebugMessage - #define WARNING if(giDebugLevel <= DBG_WARNING) OEMDebugMessage - #define ERR if(giDebugLevel <= DBG_ERROR) OEMDebugMessage - - #define DBG_OEMDMPARAM(iDbgLvl, szLabel, pobj) {vDumpOemDMParam(iDbgLvl, szLabel, pobj);} - #define DBG_SURFOBJ(iDbgLvl, szLabel, pobj) {vDumpSURFOBJ(iDbgLvl, szLabel, pobj);} - #define DBG_STROBJ(iDbgLvl, szLabel, pobj) {vDumpSTROBJ(iDbgLvl, szLabel, pobj);} - #define DBG_FONTOBJ(iDbgLvl, szLabel, pobj) {vDumpFONTOBJ(iDbgLvl, szLabel, pobj);} - #define DBG_CLIPOBJ(iDbgLvl, szLabel, pobj) {vDumpCLIPOBJ(iDbgLvl, szLabel, pobj);} - #define DBG_BRUSHOBJ(iDbgLvl, szLabel, pobj) {vDumpBRUSHOBJ(iDbgLvl, szLabel, pobj);} - #define DBG_GDIINFO(iDbgLvl, szLabel, pobj) {vDumpGDIINFO(iDbgLvl, szLabel, pobj);} - #define DBG_DEVINFO(iDbgLvl, szLabel, pobj) {vDumpDEVINFO(iDbgLvl, szLabel, pobj);} - #define DBG_BMPINFO(iDbgLvl, szLabel, pobj) {vDumpBitmapInfoHeader(iDbgLvl, szLabel, pobj);} - #define DBG_POINTL(iDbgLvl, szLabel, pobj) {vDumpPOINTL(iDbgLvl, szLabel, pobj);} - #define DBG_RECTL(iDbgLvl, szLabel, pobj) {vDumpRECTL(iDbgLvl, szLabel, pobj);} - #define DBG_XLATEOBJ(iDbgLvl, szLabel, pobj) {vDumpXLATEOBJ(iDbgLvl, szLabel, pobj);} - #define DBG_COLORADJUSTMENT(iDbgLvl, szLabel, pobj) {vDumpCOLORADJUSTMENT(iDbgLvl, szLabel, pobj);} - - #define ASSERT(cond) \ - { \ - if (! (cond)) \ - { \ - RIP((L"\n")); \ - } \ - } - - #define ASSERTMSG(cond, msg) \ - { \ - if (! (cond)) { \ - RIP(msg); \ - } \ - } - - #define RIP(msg) \ - { \ - DBGMSG(DBG_RIP, L"RIP", msg); \ - DebugBreak(); \ - } - - typedef struct DBG_FLAGS { - LPWSTR pszFlag; - DWORD dwFlag; - } *PDBG_FLAGS; - - BOOL OEMDebugMessage(LPCWSTR, ...); - void vDumpOemDMParam(INT iDebugLevel, _In_ PWSTR pszInLabel, POEMDMPARAM pOemDMParam); - void vDumpSURFOBJ(INT iDebugLevel, _In_ PWSTR pszInLabel, SURFOBJ *pso); - void vDumpSTROBJ(INT iDebugLevel, _In_ PWSTR pszInLabel, STROBJ *pstro); - void vDumpFONTOBJ(INT iDebugLevel, _In_ PWSTR pszInLabel, FONTOBJ *pfo); - void vDumpCLIPOBJ(INT iDebugLevel, _In_ PWSTR pszInLabel, CLIPOBJ *pco); - void vDumpBRUSHOBJ(INT iDebugLevel, _In_ PWSTR pszInLabel, BRUSHOBJ *pbo); - void vDumpGDIINFO(INT iDebugLevel, _In_ PWSTR pszInLabel, GDIINFO *pGdiInfo); - void vDumpDEVINFO(INT iDebugLevel, _In_ PWSTR pszInLabel, DEVINFO *pDevInfo); - void vDumpBitmapInfoHeader(INT iDebugLevel, _In_ PWSTR pszInLabel, PBITMAPINFOHEADER pBitmapInfoHeader); - void vDumpPOINTL(INT iDebugLevel, _In_ PWSTR pszInLabel, POINTL *pptl); - void vDumpRECTL(INT iDebugLevel, _In_ PWSTR pszInLabel, RECTL *prcl); - void vDumpXLATEOBJ(INT iDebugLevel, _In_ PWSTR pszInLabel, XLATEOBJ *pxlo); - void vDumpCOLORADJUSTMENT(INT iDebugLevel, _In_ PWSTR pszInLabel, COLORADJUSTMENT *pca); - - BOOL OEMRealDebugMessage(DWORD dwSize, LPCWSTR lpszMessage, va_list arglist); - PCSTR StripDirPrefixA(IN PCSTR pstrFilename); - void vDumpFlags(DWORD dwFlags, PDBG_FLAGS pDebugFlags); - -#else // !DBG - - #define DebugMsg NOP_FUNCTION - - #define VERBOSE NOP_FUNCTION - #define TERSE NOP_FUNCTION - #define WARNING NOP_FUNCTION - #define ERR NOP_FUNCTION - - #define DBG_OEMDMPARAM(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_OEMDEVMODE(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_SURFOBJ(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_STROBJ(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_FONTOBJ(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_CLIPOBJ(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_BRUSHOBJ(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_GDIINFO(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_DEVINFO(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_BMPINFO(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_POINTL(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_RECTL(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_XLATEOBJ(iDbgLvl, szLabel, pobj) NOP_FUNCTION - #define DBG_COLORADJUSTMENT(iDbgLvl, szLabel, pobj) NOP_FUNCTION - - #define ASSERT(cond) - - #define ASSERTMSG(cond, msg) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.cpp deleted file mode 100644 index 92ca5dd9..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// -// History: -// 06/24/03 xxx created. -// -// - -#include "precomp.h" -#include "oemprean.h" -#include "debug.h" -#include "devmode.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -HRESULT hrOEMDevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DevMode. - hrOEMDevMode is called by IPrintOemUni::DevMode - which is defined in intrface.cpp. - - The IPrintOemUni::DevMode method, provided by - rendering plug-ins for Unidrv, performs operations - on private DEVMODE members. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - caller-supplied constant. Refer to the docs - for more information. - pOemDMParam - pointer to an OEMDMPARAM structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - ---*/ - -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - VERBOSE(L"hrOEMDevMode entry."); - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - )) - { - ERR(ERRORTEXT("DevMode() ERROR_INVALID_PARAMETER.\r\n")); - ERR(DLLTEXT("\tdwMode = %d, pOemDMParam = %#lx.\r\n"), dwMode, pOemDMParam); - - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devmode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - case OEMDM_DEFAULT: - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - break; - - case OEMDM_CONVERT: - bConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - case OEMDM_MERGE: - bConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - bMakeOEMDevmodeValid(pOEMDevOut); - break; - } - DBG_OEMDMPARAM(DBG_VERBOSE, L"pOemDMParam", pOemDMParam); - - return S_OK; -} - - -BOOL bConvertOEMDevmode( - PCOEMDEV pOEMDevIn, - POEMDEV pOEMDevOut - ) - -/*++ - -Routine Description: - - Converts private DEVMODE members to the - current version. - -Arguments: - - pOEMDevIn - pointer to OEM private devmode - pOEMDevOut - pointer to OEM private devmode - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE(L"bConvertOEMDevmode entry."); - - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR(ERRORTEXT("ConvertOEMDevmode() invalid parameters.\r\n")); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE(TEXT("Converting private OEM Devmode.\r\n")); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - VERBOSE(TEXT("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n")); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - } - - return TRUE; -} - - -BOOL bMakeOEMDevmodeValid( - POEMDEV pOEMDevmode - ) - -/*++ - -Routine Description: - - Ensures that private OEM devmode members are valid. - -Arguments: - - pOEMDevmode - pointer to OEM private devmode - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data. - pOEMDevmode->dwDriverData = 0; - - return TRUE; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.h deleted file mode 100644 index 05f98204..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/devmode.h +++ /dev/null @@ -1,43 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -// History: -// 06/24/03 xxx created. -// -// - -#pragma once - - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - BOOL dwDriverData; -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - -///////////////////////////////////////////////////////// -// Prototypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL bConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL bMakeOEMDevmodeValid(POEMDEV pOEMDevmode); - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/dllentry.cpp deleted file mode 100644 index 412f9446..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/dllentry.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// -// PURPOSE: Source module for DLL entry function(s). -// -// History: -// 06/24/03 xxx created. -// -// - -#include "precomp.h" -#include "oemprean.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// - -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - VERBOSE(L"DllMain entry."); - - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(TEXT("Process attach.\r\n")); - break; - - case DLL_THREAD_ATTACH: - VERBOSE(TEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(TEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(TEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.cpp deleted file mode 100644 index 9c102afc..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.cpp +++ /dev/null @@ -1,1819 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Interface for User Mode COM Customization DLL. -// -// -// Functions: -// IPrintOemUni2 interface functions -// COemCF class factory -// Registration functions: DllCanUnloadNow, DllGetClassObject -// -// History: -// 06/26/03 xxx created. -// -// - -#include "precomp.h" -#include -#include - -#include "oemprean.h" -#include "debug.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// ================================================================== -// Internal Globals -// -static long g_cComponents; // Count of active components -static long g_cServerLocks; // Count of locks -// -// ================================================================== - -// ================================================================== -// The purpose of this array is to inform UNIDRV of the callbacks -// that are implemented in this driver. -// -// Note that there is *NO* order dependency in this array. New -// index values and their corresponding callbacks can be placed -// anywhere within the list as needed. -// -static const DRVFN s_aOemHookFuncs[] = -{ - // The following are defined in ddihook.cpp. - // - {INDEX_DrvAlphaBlend, (PFN)OEMAlphaBlend}, - {INDEX_DrvBitBlt, (PFN)OEMBitBlt}, - {INDEX_DrvCopyBits, (PFN)OEMCopyBits}, - {INDEX_DrvDitherColor, (PFN)OEMDitherColor}, - {INDEX_DrvFillPath, (PFN)OEMFillPath}, - {INDEX_DrvFontManagement, (PFN)OEMFontManagement}, - {INDEX_DrvGetGlyphMode, (PFN)OEMGetGlyphMode}, - {INDEX_DrvGradientFill, (PFN)OEMGradientFill}, - {INDEX_DrvLineTo, (PFN)OEMLineTo}, - {INDEX_DrvPaint, (PFN)OEMPaint}, - {INDEX_DrvPlgBlt, (PFN)OEMPlgBlt}, - {INDEX_DrvQueryAdvanceWidths, (PFN)OEMQueryAdvanceWidths}, - {INDEX_DrvQueryFont, (PFN)OEMQueryFont}, - {INDEX_DrvQueryFontData, (PFN)OEMQueryFontData}, - {INDEX_DrvQueryFontTree, (PFN)OEMQueryFontTree}, - {INDEX_DrvRealizeBrush, (PFN)OEMRealizeBrush}, - {INDEX_DrvStretchBlt, (PFN)OEMStretchBlt}, - {INDEX_DrvStretchBltROP, (PFN)OEMStretchBltROP}, - {INDEX_DrvStrokeAndFillPath, (PFN)OEMStrokeAndFillPath}, - {INDEX_DrvStrokePath, (PFN)OEMStrokePath}, - {INDEX_DrvTextOut, (PFN)OEMTextOut}, - {INDEX_DrvTransparentBlt, (PFN)OEMTransparentBlt}, - {INDEX_DrvStartDoc, (PFN)OEMStartDoc}, - {INDEX_DrvEndDoc, (PFN)OEMEndDoc}, - {INDEX_DrvStartPage, (PFN)OEMStartPage}, - {INDEX_DrvSendPage, (PFN)OEMSendPage}, - {INDEX_DrvStartBanding, (PFN)OEMStartBanding}, - {INDEX_DrvNextBand, (PFN)OEMNextBand}, - {INDEX_DrvEscape, (PFN)OEMEscape} -}; - - -//////////////////////////////////////////////////////////////////////////////// -// -// COemUni2 body -// -COemUni2::COemUni2() -{ - m_cRef = 1; - - // Increment COM component count. - InterlockedIncrement(&g_cComponents); - - m_pOEMHelp = NULL; - -} - -COemUni2::~COemUni2() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall -COemUni2:: -QueryInterface( - const IID& iid, - void** ppv - ) -{ - VERBOSE(L"COemUni2::QueryInterface() entry."); - - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("COemUni2::QueryInterface IUnknown.\r\n")); - } - else if (iid == IID_IPrintOemUni2) - { - VERBOSE(DLLTEXT("COemUni2::QueryInterface IPrintOemUni2.\r\n")); - - *ppv = static_cast(this); - } - else - { - WARNING(DLLTEXT("COemUni2::QueryInterface NULL. Returning E_NOINTERFACE.\r\n")); - - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall -COemUni2:: -AddRef( - VOID - ) -{ - VERBOSE(L"COemUni2::AddRef() entry."); - - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -COemUni2:: -Release( - VOID - ) -{ - VERBOSE(L"COemUni2::Release() entry."); - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (cRef == 0) - { - delete this; - return 0; - } - return cRef; -} - -HRESULT __stdcall -COemUni2:: -CommandCallback( - PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::CommandCallback - - The IPrintOemUni::CommandCallback method is used - to provide dynamically generated printer commands - for Unidrv-supported printers. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - dwCallbackID - value representing the printer command's - *CallbackID attribute in the printer's generic printer - description (GPD) file. - dwCount - value representing the number of elements - in the array pointed to by pdwParams. Can be 0. - pdwParams - pointer to an array of DWORD-sized parameters - containing values specified by the printer commands - *Params attribute in the printer's GPD file. Can be NULL. - piResult - Receives a method-supplied result value. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::CommandCallback() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pdwParams); - - *piResult = 0; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -Compression( - PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::Compression - - The IPrintOemUni::Compression method can be used - with Unidrv-supported printers to provide a customized - bitmap compression method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pInBuf - pointer to input scan line data. - pOutBuf - pointer to an output buffer to receive - compressed scan line data. - dwInLen - length of the input data. - dwOutLen - length of the output buffer. - piResult - Receives a method-supplied result value. If the - operation succeeds, this value should be the number - of compressed bytes, which must not be larger than - the value received for dwOutLen. If an error occurs, - or if the method cannot compress, the result value - should be -1. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::Compression() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pInBuf); - UNREFERENCED_PARAMETER(pOutBuf); - UNREFERENCED_PARAMETER(dwInLen); - UNREFERENCED_PARAMETER(dwOutLen); - UNREFERENCED_PARAMETER(piResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DevMode - - The IPrintOemUni::DevMode method, provided by - rendering plug-ins for Unidrv, performs operations - on private DEVMODE members. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DevMode method. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - caller-supplied constant. Refer to the docs - for more information. - pOemDMParam - pointer to an OEMDMPARAM structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE(L"COemUni2:DevMode entry."); - - DBG_OEMDMPARAM(DBG_VERBOSE, L"pOemDMParam", pOemDMParam); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall -COemUni2:: -DisableDriver( - VOID - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DisableDriver - - The IPrintOemUni::DisableDriver method allows a rendering - plug-in for Unidrv to free resources that were allocated by the - plug-in's IPrintOemUni::EnableDriver method. This is the last - IPrintOemUni interface method that is called before the rendering - plug-in is unloaded. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DisableDriver method. - - Please refer to DDK documentation for more details. - -Arguments: - - VOID - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE(L"COemUni2::DisableDriver() entry."); - - // Release reference to Printer Driver's interface. - // - if (this->m_pOEMHelp) - { - this->m_pOEMHelp->Release(); - this->m_pOEMHelp = NULL; - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -DisablePDEV( - PDEVOBJ pdevobj - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DisablePDEV - - The IPrintOemUni::DisablePDEV method performs the same types of - operations as the DrvDisablePDEV function. Its purpose is to allow a - rendering plug-in to delete the private PDEV structure that is pointed - to by the DEVOBJ structure's pdevOEM member. This PDEV structure - is one that was allocated by the plug-in's IPrintOemUni::EnablePDEV method. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DisablePDEV method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE(L"COemUni2::DisablePDEV() entry."); - - POEMPDEV pOemPDEV = static_cast(pdevobj->pdevOEM); - delete pOemPDEV; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -DownloadCharGlyph( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DownloadCharGlyph - - The IPrintOemUni::DownloadCharGlyph method enables a - rendering plug-in for Unidrv to send a character glyph for - a specified soft font to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - hGlyph - glyph handle. - pdwWidth - pointer to receive the method-supplied width of the character. - pdwResult - Receives a method-supplied value representing the amount - of printer memory, in bytes, required to store the character glyph. - If the operation fails, the returned value should be zero. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::DownloadCharGlyph() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(hGlyph); - UNREFERENCED_PARAMETER(pdwWidth); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DownloadFontHeader( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DownloadFontHeader - - The IPrintOemUni::DownloadFontHeader method allows a - rendering plug-in for Unidrv to send a font's header - information to a printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pdwResult - Receives a method-supplied value representing the amount - of printer memory, in bytes, required to store the font header - information. If the operation fails, the returned value should be zero. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::DownloadFontHeader() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DriverDMS( - PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DriverDMS - - The IPrintOemUni::DriverDMS method allows a rendering - plug-in for Unidrv to indicate that it uses a device-managed - drawing surface instead of the default GDI-managed surface. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DriverDMS method. - - Please refer to DDK documentation for more details. For general info - on device managed surfaces and how to handle them, please refer to - the section titled "Handling Device-Managed Surfaces". - -Arguments: - - pDevObj - pointer to a DEVOBJ structure. - pBuffer - pointer to a buffer to receive method-specified flags. - cbSize - size, in bytes, of the buffer pointed to by pBuffer. - pcbNeeded - pointer to a location to receive the required - minimum pBuffer size. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE(L"COemUni2::DriverDMS() entry."); - - UNREFERENCED_PARAMETER(pDevObj); - UNREFERENCED_PARAMETER(pBuffer); - UNREFERENCED_PARAMETER(cbSize); - UNREFERENCED_PARAMETER(pcbNeeded); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -EnableDriver( - DWORD dwDriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::EnableDriver - - The IPrintOemUni::EnableDriver method allows a rendering - plug-in for Unidrv to hook out some graphics DDI functions. - - The IPrintOemUni::EnableDriver method allows a rendering - plug-in to perform the same types of operations as the - DrvEnableDriver function. Like the DrvEnableDriver function, - the IPrintOemUni::EnableDriver method is responsible for - providing addresses of internally supported graphics DDI functions, - or DDI hook functions. - - The method should fill the supplied DRVENABLEDATA structure - and allocate an array of DRVFN structures. It should fill the - array with pointers to hooking functions, along with winddi.h-defined - index values that identify the hooked out graphics DDI functions. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::EnableDriver method. - - Please refer to DDK documentation for more details. - -Arguments: - - DriverVersion - interface version number. This value is - defined by PRINTER_OEMINTF_VERSION, in printoem.h. - cbSize - size, in bytes, of the structure pointed to by pded. - pded - pointer to a DRVENABLEDATA structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - UNREFERENCED_PARAMETER(dwDriverVersion); - UNREFERENCED_PARAMETER(cbSize); - - VERBOSE(L"COemUni2::EnableDriver() entry."); - - pded->iDriverVersion = PRINTER_OEMINTF_VERSION; - pded->c = sizeof(s_aOemHookFuncs) / sizeof(DRVFN); - pded->pdrvfn = (DRVFN *) s_aOemHookFuncs; - - // Even if nothing is done, need to return S_OK so - // that DisableDriver() will be called, which releases - // the reference to the Printer Driver's interface. - // - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -EnablePDEV( - PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *ppDevOem - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::EnablePDEV - - The IPrintOemUni::EnablePDEV method performs the same types - of operations as the DrvEnablePDEV function that is exported - by a printer graphics DLL. Its purpose is to allow a rendering - plug-in to create its own PDEV structure. For more information - about PDEV structures, see "Customized PDEV Structures" in the DDK docs. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::EnablePDEV method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pPrinterName - pointer to a text string representing the - logical address of the printer. - cPatterns - value representing the number of HSURF-typed - surface handles contained in the buffer pointed to by - phsurfPatterns. - phsurfPatterns - pointer to a buffer that is large enough to - contain cPatterns number of HSURF-typed surface handles. - The handles represent surface fill patterns. - cjGdiInfo - value representing the size of the structure pointed - to by pGdiInfo. - pGdiInfo - pointer to a GDIINFO structure. - cjDevInfo - value representing the size of the structure pointed - to by pDevInfo. - pDevInfo - pointer to a DEVINFO structure. - pded - pointer to a DRVENABLEDATA structure containing the - addresses of the printer driver's graphics DDI hooking functions. - pDevOem - Receives a method-supplied pointer to a private PDEV structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - If the operation fails, the method should call SetLastError to set an error code. - - ---*/ - -{ - VERBOSE(L"COemUni2::EnablePDEV() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(cPatterns); - UNREFERENCED_PARAMETER(phsurfPatterns); - UNREFERENCED_PARAMETER(cjGdiInfo); - UNREFERENCED_PARAMETER(cjDevInfo); - - #ifndef DBG - UNREFERENCED_PARAMETER(pGdiInfo); - UNREFERENCED_PARAMETER(pDevInfo); - #endif - - // Allocate an instance of our private PDEV. - // - POEMPDEV pOemPDEV = new COemPDEV(); - *ppDevOem = pOemPDEV; - - if (NULL == pOemPDEV) - { - return E_FAIL; - } - - pOemPDEV->InitializeDDITable(pded); - - DBG_GDIINFO(DBG_VERBOSE, L"pGdiInfo", pGdiInfo); - DBG_DEVINFO(DBG_VERBOSE, L"pDevInfo", pDevInfo); - - pOemPDEV->bPreAnalysis = FALSE; // Initialize the pre-analysis flag - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -FilterGraphics( - PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::FilterGraphics - - The IPrintOemUni::FilterGraphics method can be used with - Unidrv-supported printers to modify scan line data and send - it to the spooler. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pBuf - pointer to a buffer containing scan line data to be printed. - dwLen - value representing the length, in bytes, of the data - pointed to by pBuf. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - DWORD dwResult; - - VERBOSE(L"COemUni2::FilterGraphics() entry."); - - m_pOEMHelp->DrvWriteSpoolBuf(pdevobj, pBuf, dwLen, &dwResult); - - if (dwResult == dwLen) - return S_OK; - else - return S_FALSE; -} - -HRESULT __stdcall -COemUni2:: -GetImplementedMethod( - _In_ PSTR pMethodName - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::GetImplementedMethod - - The IPrintOemUni::GetImplementedMethod method is used by - Unidrv to determine which IPrintOemUni interface methods - have been implemented by a rendering plug-in. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::GetImplemented method. - - Please refer to DDK documentation for more details. - -Arguments: - - pMethodName - pointer to a string representing the name of an - IPrintOemUni interface method, such as "ImageProcessing" - for IPrintOemUni::ImageProcessing or "FilterGraphics" for - IPrintOemUni::FilterGraphics. - -Return Value: - - S_OK The operation succeeded (the specified method is implemented). - S_FALSE The operation failed (the specified method is not implemented). - - ---*/ - -{ - HRESULT Result = S_FALSE; - - VERBOSE(L"COemUni2::GetImplementedMethod() entry."); - VERBOSE(TEXT("\tCOemUni2::%hs: "), pMethodName); - - // Unidrv only calls GetImplementedMethod for optional - // methods. The required methods are assumed to be - // supported. - - // Return S_OK for supported function (i.e. implemented), - // and S_FALSE for functions that aren't supported (i.e. not implemented). - switch (*pMethodName) - { - case 'C': - if (!strcmp(NAME_CommandCallback, pMethodName)) - { - Result = S_OK; - } - break; - case 'F': - if (!strcmp(NAME_FilterGraphics, pMethodName)) - { - Result = S_OK; - } - break; - } - - VERBOSE(Result == S_OK ? TEXT("Supported\r\n") : TEXT("NOT supported\r\n")); - - return Result; -} - -HRESULT __stdcall -COemUni2:: -GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::GetInfo - - A rendering plug-in's IPrintOemUni::GetInfo method returns - identification information. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::GetInfo method. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - Contains one of the following caller-supplied integer constants. - OEMGI_GETSIGNATURE - The method must return a unique four-byte - identification signature. The plug-in must also place this signature - in OPTITEM structures, as described in the description of the - OEMCUIPPARAM. structure's pOEMOptItems member. - OEMGI_GETVERSION - The method must return the user interface - plug-in's version number as a DWORD. The version format is - developer-defined. - pBuffer - pointer to memory allocated to receive the information specified - by dwInfo. - cbSize - size of the buffer pointed to by pBuffer. - pcbNeeded - pointer to a location to receive the number of bytes written - into the buffer pointed to by pBuffer. - -Return Value: - - S_OK The operation succeeded (the specified method is implemented). - S_FALSE The operation failed (the specified method is not implemented). - - ---*/ - -{ - PWSTR pszTag = L"COemUni2::GetInfo entry."; - - switch(dwMode) - { - case OEMGI_GETSIGNATURE: - pszTag = L"COemUni2::GetInfo entry. [OEMGI_GETSIGNATURE]"; - break; - case OEMGI_GETVERSION: - pszTag = L"COemUni2::GetInfo entry. [OEMGI_GETVERSION]"; - break; - } - - VERBOSE(pszTag); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) ) ) - { - WARNING(DLLTEXT("COemUni2::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER.\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - VERBOSE(TEXT("COemUni2::GetInfo() exit insufficient buffer!\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("COemUni2::GetInfo() exit mode not supported.\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(TEXT("COemUni2::GetInfo() exit S_OK, (*pBuffer is %#x).\r\n"), *(PDWORD)pBuffer); - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -HalftonePattern( - PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::HalftonePattern - - The IPrintOemUni::HalftonePattern method can be used with - Unidrv-supported printers to create or modify a halftone - pattern before it is used in a halftoning operation. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pHTPattern - pointer to a buffer to receive the method-supplied - halftone pattern. Buffer size, in bytes, is: - (((dwHTPatternX * dwHTPatternY) + 3)/4) * 4 * dwHTNumPatterns. - dwHTPatternX - length, in pixels, of the halftone pattern, as specified - by the GPD file's *HTPatternSize attribute. - dwHTPatternY - height, in pixels, of the halftone pattern, as specified - by the GPD file's *HTPatternSize attribute. - dwHTNumPatterns - number of patterns, as specified by the GPD file's - *HTNumPatterns attribute. This can be 1 or 3. - dwCallbackID - value identifying the halftone method, as specified by - the GPD file's *HTCallbackID attribute. - pResource - pointer to a buffer containing a halftone pattern, as - specified by the GPD file's *rcHTPatternID attribute. This can be NULL. - dwResourceSize - size of the halftone pattern contained in the buffer - pointed to by pResource. This is zero if pResource is NULL. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::HalftonePattern() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pHTPattern); - UNREFERENCED_PARAMETER(dwHTPatternX); - UNREFERENCED_PARAMETER(dwHTPatternY); - UNREFERENCED_PARAMETER(dwHTNumPatterns); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(pResource); - UNREFERENCED_PARAMETER(dwResourceSize); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -ImageProcessing( - PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::ImageProcessing - - The IPrintOemUni::ImageProcessing method can be used with - Unidrv-supported printers to modify image bitmap data, in order - to perform color formatting or halftoning. The method can return - the modified bitmap to Unidrv or send it directly to the print spooler. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pSrcBitmap - pointer to an input device-independent bitmap (DIB). - pBitmapInfoHeader - pointer to a BITMAPINFOHEADER structure - that describes the bitmap pointed to by pSrcBitmap. - pColorTable - pointer to a color table. Used only if the output format is - eight bits per pixel. - dwCallbackID - value assigned to the *IPCallbackID attribute of the - currently selected option for the ColorMode feature. - pIPParams - pointer to an IPPARAMS structure. - ppbResult - - If the method returns the converted DIB to Unidrv: - If the conversion succeeds, the method should return a - pointer to a buffer containing the converted DIB. - Otherwise it should return NULL. - If the method sends the converted DIB to the print spooler: - If the operation succeeds, the method should return TRUE. - Otherwise it should return FALSE. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::ImageProcessing() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pSrcBitmap); - UNREFERENCED_PARAMETER(pBitmapInfoHeader); - UNREFERENCED_PARAMETER(pColorTable); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(pIPParams); - UNREFERENCED_PARAMETER(ppbResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -MemoryUsage( - PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::MemoryUsage - - The IPrintOemUni::MemoryUsage method can be used with - Unidrv-supported printers to specify the amount of memory - required for use by a rendering plug-in's IPrintOemUni::ImageProcessing - method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pMemoryUsage - pointer to an OEMMEMORYUSAGE structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::MemoryUsage() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pMemoryUsage); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -OutputCharStr( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::OutputCharStr - - The IPrintOemUni::OutputCharStr method enables a rendering - plug-in to control the printing of font glyphs. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - dwType - value indicating the type of glyph specifier array - pointed to by pGlyph. Valid values are as follows: - TYPE_GLYPHHANDLE The pGlyph array elements are glyph - handles of type HGLYPH. - TYPE_GLYPHID The pGlyph array elements are glyph - identifiers of type DWORD. - dwCount - value representing the number of glyph specifiers in - the array pointed to by pGlyph. - pGlyph - pointer to an array of glyph specifiers, where the array - element type is indicated by dwType. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::OutputCharStr() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(dwType); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pGlyph); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -PublishDriverInterface( - IUnknown *pIUnknown - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::PublishDriverInterface - - The IPrintOemUni::PublishDriverInterface method allows a - rendering plug-in for Unidrv to obtain the Unidrv driver's - IPrintOemDriverUni interface. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::PublishDriverInterface method and the method - must return S_OK, or the driver will not call the plug-in's other - IPrintOemUni interface methods. - - Please refer to DDK documentation for more details. - -Arguments: - - pIUnknown - pointer to the IUnknown interface of the driver's - IPrintOemDriverUni COM interface. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE(L"COemUni2::PublishDriverInterface() entry."); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (this->m_pOEMHelp == NULL) - { - HRESULT hResult; - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUni, (void** ) &(this->m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - this->m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -ResetPDEV( - PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::ResetPDEV - - A rendering plug-in's IPrintOemUni::ResetPDEV method performs - the same types of operations as the DrvResetPDEV function. During - the processing of an application's call to the Platform SDK ResetDC - function, the IPrintOemUni::ResetPDEV method is called by Unidrv's - DrvResetPDEV function. For more information about when DrvResetPDEV - is called, see its description in the DDK docs. - - The rendering plug-in's private PDEV structure's address is contained - in the pdevOEM member of the DEVOBJ structure pointed to by pdevobjOld. - The IPrintOemUni::ResetPDEV method should use relevant members of this - old structure to fill in the new structure, which is referenced through pdevobjNew. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::ResetPDEV method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobjOld - pointer to a DEVOBJ structure containing current PDEV information. - pdevobjNew - pointer to a DEVOBJ structure into which the method should place - new PDEV information. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE(L"COemUni2::ResetPDEV() entry."); - - UNREFERENCED_PARAMETER(pdevobjOld); - UNREFERENCED_PARAMETER(pdevobjNew); - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -SendFontCmd( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::SendFontCmd - - The IPrintOemUni::SendFontCmd method enables a rendering - plug-in to modify a printer's font selection command and then - send it to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pFInv - pointer to an FINVOCATION structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::SendFontCmd() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pFInv); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TextOutAsBitmap( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TextOutAsBitmap - - The IPrintOemUni::TextOutAsBitmap method allows a rendering - plug-in to create a bitmap image of a text string, in case a - downloadable font is not available. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to be written. - pstro - Defines the glyphs to be rendered and their positions - pfo - Specifies the font to be used - pco - Defines the clipping path - prclExtra - A NULL-terminated array of rectangles to be filled - prclOpaque - Specifies an opaque rectangle - pboFore - Defines the foreground brush - pboOpaque - Defines the opaque brush - pptlOrg - Pointer to POINT struct , defining th origin - mix - Specifies the foreground and background ROPs for pboFore - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::TextOutAsBitmap() entry."); - - UNREFERENCED_PARAMETER(pso); - UNREFERENCED_PARAMETER(pstro); - UNREFERENCED_PARAMETER(pfo); - UNREFERENCED_PARAMETER(pco); - UNREFERENCED_PARAMETER(prclExtra); - UNREFERENCED_PARAMETER(prclOpaque); - UNREFERENCED_PARAMETER(pboFore); - UNREFERENCED_PARAMETER(pboOpaque); - UNREFERENCED_PARAMETER(pptlOrg); - UNREFERENCED_PARAMETER(mix); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TTDownloadMethod( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TTDownloadMethod - - The IPrintOemUni::TTDownloadMethod method enables a rendering - plug-in to indicate the format that Unidrv should use for a specified - TrueType soft font. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pdwResult - Receives one of the following method-supplied constant values: - TTDOWNLOAD_BITMAP Unidrv should download the specified font as bitmaps. - TTDOWNLOAD_DONTCARE Unidrv can select the font format. - TTDOWNLOAD_GRAPHICS Unidrv should print TrueType fonts as graphics, - instead of downloading the font. - TTDOWNLOAD_TTOUTLINE Unidrv should download the specified font as outlines. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::TTDownloadMethod() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TTYGetInfo( - PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TTYGetInfo - - The IPrintOemUni::TTYGetInfo method enables a rendering plug-in - to supply Unidrv with information relevant to text-only printers. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - dwInfoIndex - constant identifying the type of information being requested. - The following constant values are defined: - OEMTTY_INFO_CODEPAGE - The pOutputBuf parameter points to a - DWORD in which the method should return the number of the - code page to be used. - OEMTTY_INFO_MARGINS - The pOutputBuf parameter points to a - RECT structure in which the method should return page margin - widths, in tenths of millimeters (for example, 20 represents 2 mm). - If the entire page is printable, all margin values must be 0. - OEMTTY_INFO_NUM_UFMS - The pOutputBuf parameter points to a - DWORD in which the method should return the number of resource - IDs of the UFMs for 10, 12, and 17 CPI fonts. To actually obtain - these resource IDs, perform a query using OEMTTY_INFO_UFM_IDS. - OEMTTY_INFO_UFM_IDS - The pOutputBuf parameter points to an array - of DWORDs of sufficient size to hold the number of resource IDs of - the UFMs for 10, 12, and 17 CPI fonts. (This number is obtained by - using OEMTTY_INFO_NUM_UFMS in a query.) The method should - return the resource IDs of the UFMs for 10,12, and 17 CPI fonts. - pOutputBuf - pointer to a buffer to receive the requested information. - dwSize - size, in bytes, of the buffer pointed to by pOutputBuf. - pcbcNeeded - pointer to a location to receive the number of bytes written into - the buffer pointed to by pOutputBuf. If the number of bytes required is - smaller than the number specified by dwSize, the method should supply - the required size and return E_FAIL. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::TTYGetInfo() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwInfoIndex); - UNREFERENCED_PARAMETER(pOutputBuf); - UNREFERENCED_PARAMETER(dwSize); - UNREFERENCED_PARAMETER(pcbcNeeded); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -WritePrinter( - PDEVOBJ pdevobj, - PVOID pBuf, - DWORD cbBuffer, - PDWORD pcbWritten - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni2::WritePrinter - - The IPrintOemUni2::WritePrinter method, if supported, enables a - rendering plug-in to capture all output data generated by a Unidrv - driver. If this method is not supported, the output data would - otherwise be sent to the spooler in a call to the spooler's WritePrinter API. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pBuf - pointer to the first byte of an array of bytes that contains - the output data generated by the Unidrv driver. - cbBuffer - size, in bytes, of the array pointed to by pBuf. - pcbWritten - pointer to a DWORD value that receives the number - of bytes of data that were successfully sent to the plug-in. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE(L"COemUni2::WritePrinter() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pBuf); - UNREFERENCED_PARAMETER(cbBuffer); - UNREFERENCED_PARAMETER(pcbWritten); - - return E_NOTIMPL; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class COemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef)(THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release)(THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance)(THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer)(THIS_ BOOL bLock); - - - // Constructor - COemCF(): m_cRef(1) { }; - - // Destructor - ~COemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall -COemCF:: -QueryInterface( - const IID& iid, - void** ppv) -{ - VERBOSE(L"COemCF::QueryInterface entry."); - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; -#if DBG && defined(USERMODE_DRIVER) - TCHAR szOutput[80] = {0}; - StringFromGUID2(iid, szOutput, _countof(szOutput)); // can not fail! - VERBOSE(TEXT("COemCF::QueryInterface %s not supported.\r\n"), szOutput); -#endif - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall -COemCF:: -AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -COemCF:: -Release() -{ -// ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall -COemCF:: -CreateInstance( - IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - VERBOSE(L"Class factory:Create component."); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - // Create component. - COemUni2* pOemCP = new COemUni2; - if (pOemCP == NULL) - { - return E_OUTOFMEMORY; - } - - // Get the requested interface. - HRESULT hr = pOemCP->QueryInterface(iid, ppv); - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCP->Release(); - return hr; -} - -// LockServer -HRESULT __stdcall -COemCF:: -LockServer( - BOOL bLock - ) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - return S_OK; -} - - -// -// Registration functions -// - -// -// Can DLL unload now? -// -STDAPI DllCanUnloadNow(void) -{ - VERBOSE(L"DllCanUnloadNow entry."); - - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv - ) -{ - VERBOSE(L"DllGetClassObject:\tCreate class factory."); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMRENDER) - { - ERR(ERRORTEXT("DllGetClassObject:\tClass not available!\r\n")); - return CLASS_E_CLASSNOTAVAILABLE; - } - - // Create class factory. - COemCF* pFontCF = new COemCF; // Reference count set to 1 in constructor - if (pFontCF == NULL) - { - ERR(ERRORTEXT("DllGetClassObject:\tOut of Memory!\r\n")); - return E_OUTOFMEMORY; - } - - // Get requested interface. - HRESULT hrResult = pFontCF->QueryInterface(iid, ppv); - pFontCF->Release(); - - return hrResult; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.h deleted file mode 100644 index 28b2a82f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/intrface.h +++ /dev/null @@ -1,288 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.H -// -// -// PURPOSE: Define COM interface for User Mode Printer Customization DLL. -// -// History: -// 06/26/03 xxx created. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// String Literals -///////////////////////////////////////////////////////// - -CONST CHAR NAME_CommandCallback[] = "CommandCallback"; -CONST CHAR NAME_FilterGraphics[] = "FilterGraphics"; - -//////////////////////////////////////////////////////////////////////////////// -// -// COemUni2 -// -// Interface for Unidrv OEM sample rendering module -// -class COemUni2 : public IPrintOemUni2 -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Method for getting the implemented methods. - // Returns S_OK if the given method is implemneted. - // Returns S_FALSE if the given method is notimplemneted. - // - - STDMETHOD(GetImplementedMethod)(THIS_ _In_ PSTR pMethodName); - - // - // Method for OEM to specify DDIs that have been hooked - // - - STDMETHOD(EnableDriver) (THIS_ DWORD DriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded); - - // - // Method to notify OEM plugin that it is no longer required - // - - STDMETHOD(DisableDriver) (THIS); - - // - // Method for OEM plugin to contruct its own PDEV - // - - STDMETHOD(EnablePDEV)(THIS_ PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem); - - // - // Method for OEM to free any resource associated with its PDEV - // - - STDMETHOD(DisablePDEV)(THIS_ PDEVOBJ pdevobj); - - // - // Method for OEM to transfer from old PDEV to new PDEV - // - - STDMETHOD(ResetPDEV)(THIS_ PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo)(THIS_ DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDriverDMS - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(DriverDMS)(THIS_ PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode)(THIS_ DWORD dwMode, - POEMDMPARAM pOemDMParam); - - // - // OEMCommandCallback - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(CommandCallback)(THIS_ PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult); - - // - // OEMImageProcessing - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(ImageProcessing)(THIS_ PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult); - - // - // OEMFilterGraphics - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(FilterGraphics)(THIS_ PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen); - // - // OEMCompression - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(Compression)(THIS_ PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult); - - // - // OEMHalftone - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(HalftonePattern)(THIS_ PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize); - - // - // OEMMemoryUsage - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(MemoryUsage)(THIS_ PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage); - - // - // OEMTTYGetInfo - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(TTYGetInfo)(THIS_ PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded); - - // - // OEMDownloadFontheader - UNIDRV only - // - - STDMETHOD(DownloadFontHeader)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMDownloadCharGlyph - UNIDRV only - // - - STDMETHOD(DownloadCharGlyph)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult); - - // - // OEMTTDownloadMethod - UNIDRV only - // - - STDMETHOD(TTDownloadMethod)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMOutputCharStr - UNIDRV only - // - - STDMETHOD(OutputCharStr)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph); - - // - // OEMSendFontCmd - UNIDRV only - // - - - STDMETHOD(SendFontCmd)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv); - - // - // OEMTextOutAsBitmap - UNIDRV only - // - - STDMETHOD(TextOutAsBitmap)(THIS_ SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix); - - // - // IPrintOemUni2 methods - // - - // - // Method for plugin to hook out spooler's WritePrinter API so it - // can get access to output data Universal driver is generating - // - // At DrvEnablePDEV time, Universal driver will call this function with - // pdevobj = NULL, pBuf = NULL, cbBuffer = 0 to detect if the plugin - // implements this function. Plugin should return S_OK to indicate it is - // implementing this function, or return E_NOTIMPL otherwise. - // - // In pcbWritten, plugins should return the number of bytes written to the - // spooler's WritePrinter function. Zero doesn't carry a special meaning, - // errors must be reported through the returned HRESULT. - // - - STDMETHOD(WritePrinter)(THIS_ PDEVOBJ pdevobj, - PVOID pBuf, - DWORD cbBuffer, - PDWORD pcbWritten); - - - COemUni2(); - ~COemUni2(); - -protected: - LONG m_cRef; - IPrintOemDriverUni* m_pOEMHelp; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.def b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.def deleted file mode 100644 index a9534822..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY OEMPREAN -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.h b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.h deleted file mode 100644 index f8fa44a7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.h +++ /dev/null @@ -1,259 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUNI.H -// -// -// PURPOSE: Define the COemPDEV class which stores the private -// PDEV for the driver. -// -// -// Functions: -// COemPDEV constructor and destructor -// COemPDEV::InitializeDDITable -// COemPDEV::_SavePFN -// COemPDEV::_ResetPointers -// -// History: -// 06/24/03 xxx created. -// -// - -#pragma once - -#include "debug.h" - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -#define DLLTEXT(s) TEXT("OEMUNI: ") TEXT(s) -#define ERRORTEXT(s) TEXT("ERROR ") DLLTEXT(s) - -class COemPDEV -{ -public: - __stdcall COemPDEV(void) - { - - // Note that since our parent has AddRef'd the UNIDRV interface, - // we don't do so here since our scope is identical to our - // parent. - // - - VERBOSE(L"In COemPDEV constructor..."); - - _ResetPointers(); - } - - __stdcall ~COemPDEV(void) - { - VERBOSE(L"In COemPDEV destructor..."); - } - - void __stdcall InitializeDDITable(DRVENABLEDATA* pded) - { - VERBOSE(L"COemPDEV::InitializeDDITable entry."); - - UINT iDrvFn; - UINT cDrvFn = pded->c; - PDRVFN pDrvFn = pded->pdrvfn; - - for (iDrvFn = 0; iDrvFn < cDrvFn; ++iDrvFn, ++pDrvFn) - { - _SavePFN(pDrvFn->iFunc, pDrvFn->pfn); - } - } - -private: - - void __stdcall _SavePFN(ULONG uFunc, PFN pfn) - { - - // Note: if a "pass-through" driver is being constructed, then - // there is nothing for this method to do. So, to keep the - // compiler from complaining about a switch with no case - // statements, but which has a default statement, we surround - // the entire construct with preprocessor controls. - // - switch(uFunc) - { - // The following are the page/band related DDI hooks. - // - - case INDEX_DrvStartDoc: - m_pfnDrvStartDoc = (PFN_DrvStartDoc)pfn; - break; - case INDEX_DrvEndDoc: - m_pfnDrvEndDoc = (PFN_DrvEndDoc)pfn; - break; - case INDEX_DrvStartPage: - m_pfnDrvStartPage = (PFN_DrvStartPage)pfn; - break; - case INDEX_DrvSendPage: - m_pfnDrvSendPage = (PFN_DrvSendPage)pfn; - break; - case INDEX_DrvStartBanding: - m_pfnDrvStartBanding = (PFN_DrvStartBanding)pfn; - break; - case INDEX_DrvNextBand: - m_pfnDrvNextBand = (PFN_DrvNextBand)pfn; - break; - case INDEX_DrvEscape: - m_pfnDrvEscape = (PFN_DrvEscape)pfn; - break; - - // The following are the drawing related DDI hooks. - // - case INDEX_DrvAlphaBlend: - m_pfnDrvAlphaBlend = (PFN_DrvAlphaBlend)pfn; - break; - case INDEX_DrvBitBlt: - m_pfnDrvBitBlt = (PFN_DrvBitBlt)pfn; - break; - case INDEX_DrvCopyBits: - m_pfnDrvCopyBits = (PFN_DrvCopyBits)pfn; - break; - case INDEX_DrvDitherColor: - m_pfnDrvDitherColor = (PFN_DrvDitherColor)pfn; - break; - case INDEX_DrvFillPath: - m_pfnDrvFillPath = (PFN_DrvFillPath)pfn; - break; - case INDEX_DrvFontManagement: - m_pfnDrvFontManagement = (PFN_DrvFontManagement)pfn; - break; - case INDEX_DrvGetGlyphMode: - m_pfnDrvGetGlyphMode = (PFN_DrvGetGlyphMode)pfn; - break; - case INDEX_DrvGradientFill: - m_pfnDrvGradientFill = (PFN_DrvGradientFill)pfn; - break; - case INDEX_DrvLineTo: - m_pfnDrvLineTo = (PFN_DrvLineTo)pfn; - break; - case INDEX_DrvPaint: - m_pfnDrvPaint = (PFN_DrvPaint)pfn; - break; - case INDEX_DrvPlgBlt: - m_pfnDrvPlgBlt = (PFN_DrvPlgBlt)pfn; - break; - case INDEX_DrvQueryAdvanceWidths: - m_pfnDrvQueryAdvanceWidths = (PFN_DrvQueryAdvanceWidths)pfn; - break; - case INDEX_DrvQueryFont: - m_pfnDrvQueryFont = (PFN_DrvQueryFont)pfn; - break; - case INDEX_DrvQueryFontData: - m_pfnDrvQueryFontData = (PFN_DrvQueryFontData)pfn; - break; - case INDEX_DrvQueryFontTree: - m_pfnDrvQueryFontTree = (PFN_DrvQueryFontTree)pfn; - break; - case INDEX_DrvRealizeBrush: - m_pfnDrvRealizeBrush = (PFN_DrvRealizeBrush)pfn; - break; - case INDEX_DrvStretchBlt: - m_pfnDrvStretchBlt = (PFN_DrvStretchBlt)pfn; - break; - case INDEX_DrvStretchBltROP: - m_pfnDrvStretchBltROP = (PFN_DrvStretchBltROP)pfn; - break; - case INDEX_DrvStrokeAndFillPath: - m_pfnDrvStrokeAndFillPath = (PFN_DrvStrokeAndFillPath)pfn; - break; - case INDEX_DrvStrokePath: - m_pfnDrvStrokePath = (PFN_DrvStrokePath)pfn; - break; - case INDEX_DrvTextOut: - m_pfnDrvTextOut = (PFN_DrvTextOut)pfn; - break; - case INDEX_DrvTransparentBlt: - m_pfnDrvTransparentBlt = (PFN_DrvTransparentBlt)pfn; - break; - - } // switch(uFunc) - } - - void __stdcall _ResetPointers(void) - { - m_pfnDrvAlphaBlend = NULL; - m_pfnDrvBitBlt = NULL; - m_pfnDrvCopyBits = NULL; - m_pfnDrvDitherColor = NULL; - m_pfnDrvEndDoc = NULL; - m_pfnDrvEscape = NULL; - m_pfnDrvFillPath = NULL; - m_pfnDrvFontManagement = NULL; - m_pfnDrvGetGlyphMode = NULL; - m_pfnDrvGradientFill = NULL; - m_pfnDrvLineTo = NULL; - m_pfnDrvNextBand = NULL; - m_pfnDrvPaint = NULL; - m_pfnDrvPlgBlt = NULL; - m_pfnDrvQueryAdvanceWidths = NULL; - m_pfnDrvQueryFont = NULL; - m_pfnDrvQueryFontData = NULL; - m_pfnDrvQueryFontTree = NULL; - m_pfnDrvRealizeBrush = NULL; - m_pfnDrvSendPage = NULL; - m_pfnDrvStartBanding = NULL; - m_pfnDrvStartDoc = NULL; - m_pfnDrvStartPage = NULL; - m_pfnDrvStretchBlt = NULL; - m_pfnDrvStretchBltROP = NULL; - m_pfnDrvStrokeAndFillPath = NULL; - m_pfnDrvStrokePath = NULL; - m_pfnDrvTextOut = NULL; - m_pfnDrvTransparentBlt = NULL; - } - -public: - - // Unidrv function pointers so that we can punt - // back from the DDI hooks - // - PFN_DrvAlphaBlend m_pfnDrvAlphaBlend; - PFN_DrvBitBlt m_pfnDrvBitBlt; - PFN_DrvCopyBits m_pfnDrvCopyBits; - PFN_DrvDitherColor m_pfnDrvDitherColor; - PFN_DrvEndDoc m_pfnDrvEndDoc; - PFN_DrvEscape m_pfnDrvEscape; - PFN_DrvFillPath m_pfnDrvFillPath; - PFN_DrvFontManagement m_pfnDrvFontManagement; - PFN_DrvGetGlyphMode m_pfnDrvGetGlyphMode; - PFN_DrvGradientFill m_pfnDrvGradientFill; - PFN_DrvLineTo m_pfnDrvLineTo; - PFN_DrvNextBand m_pfnDrvNextBand; - PFN_DrvPaint m_pfnDrvPaint; - PFN_DrvPlgBlt m_pfnDrvPlgBlt; - PFN_DrvQueryAdvanceWidths m_pfnDrvQueryAdvanceWidths; - PFN_DrvQueryFont m_pfnDrvQueryFont; - PFN_DrvQueryFontData m_pfnDrvQueryFontData; - PFN_DrvQueryFontTree m_pfnDrvQueryFontTree; - PFN_DrvRealizeBrush m_pfnDrvRealizeBrush; - PFN_DrvSendPage m_pfnDrvSendPage; - PFN_DrvStartBanding m_pfnDrvStartBanding; - PFN_DrvStartDoc m_pfnDrvStartDoc; - PFN_DrvStartPage m_pfnDrvStartPage; - PFN_DrvStretchBlt m_pfnDrvStretchBlt; - PFN_DrvStretchBltROP m_pfnDrvStretchBltROP; - PFN_DrvStrokeAndFillPath m_pfnDrvStrokeAndFillPath; - PFN_DrvStrokePath m_pfnDrvStrokePath; - PFN_DrvTextOut m_pfnDrvTextOut; - PFN_DrvTransparentBlt m_pfnDrvTransparentBlt; - - /*******************************************/ - /* */ - /* Add any custom PDEV members here */ - /* */ - /*******************************************/ - - BOOL bPreAnalysis; // Indicates if a current pass is the pre-analysis pass - -}; -typedef COemPDEV* POEMPDEV; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.rc b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.rc deleted file mode 100644 index 875705f1..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.rc +++ /dev/null @@ -1,110 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by DDK Support Team\0" - VALUE "CompanyName", "Microsoft Corp.\0" - VALUE "FileDescription", "OEM Pre-Analysis Sample\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "OEMPREAN\0" - VALUE "LegalCopyright", "Copyright © 1998-2003\0" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0" - VALUE "OriginalFilename", "OEMPREAN.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Microsoft OEMPREAN\0" - VALUE "ProductVersion", "1.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj deleted file mode 100644 index b1ff3191..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj +++ /dev/null @@ -1,1096 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {D5E225D5-EEEA-45FD-AD07-E4678C542E1A} - $(MSBuildProjectName) - Win10 Debug - Win32 - {179B20BC-0106-4AEE-814D-8E6C0FD66347} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - oemprean - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - oemprean.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj.Filters deleted file mode 100644 index eae4ad4e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/oemprean.vcxproj.Filters +++ /dev/null @@ -1,177 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {846460B0-CFA8-4A48-BE85-411A0055B60C} - - - h;hpp;hxx;hm;inl;inc;xsd - {B95DE626-65CE-4B7F-A90F-6094DB24D175} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {3E039E41-E6A5-4CB3-8B97-DBE76450B55B} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/precomp.h deleted file mode 100644 index 3bfba083..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/precomp.h +++ /dev/null @@ -1,49 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.h -// -// PURPOSE: Consolidate common headers that do not change frequently. -// -// History: -// 06/24/03 xxx created. -// -// - -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - -// Required header files that shouldn't change often. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/oemprean/resource.h deleted file mode 100644 index 8e941820..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemprean/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by OEMUNI.rc -// - - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps.ini b/print/OEM Printer Customization Plug-in Samples/C++/oemps.ini deleted file mode 100644 index 7ad0e62a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMDriverFile1=OEMPS.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.rc b/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.rc deleted file mode 100644 index 49008d4c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.rc +++ /dev/null @@ -1,109 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team\0" - VALUE "CompanyName", "Microsoft Corp.\0" - VALUE "FileDescription", "OEM Customization Sample\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "OEMPS\0" - VALUE "LegalCopyright", "Copyright © 1998-2003\0" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0" - VALUE "OriginalFilename", "OEMPS.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Microsoft OEMPS\0" - VALUE "ProductVersion", "1.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj deleted file mode 100644 index c30249a8..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj +++ /dev/null @@ -1,1096 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {9F374241-B8F9-45D3-B163-7E84E8E22C1F} - $(MSBuildProjectName) - Win10 Debug - Win32 - {143DF0A4-9C2F-48FB-A070-C9D9465D83B2} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - OEMPS - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - OEMPS.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj.Filters deleted file mode 100644 index 6935f366..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/OEMPS.vcxproj.Filters +++ /dev/null @@ -1,220 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {CFF33BBA-FC87-4E95-B9C5-476E1462EEBF} - - - h;hpp;hxx;hm;inl;inc;xsd - {9BFF3627-E67C-4BAB-A7A6-BCE2D1B5C993} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {87727098-2810-47BA-A965-219906793BC2} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/command.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemps/command.cpp deleted file mode 100644 index 06e049c9..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/command.cpp +++ /dev/null @@ -1,278 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: command.cpp -// -// PURPOSE: Source module for OEM customized Command(s). -// - -#include "precomp.h" -#include "oemps.h" -#include "debug.h" -#include "command.h" -#include "resource.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal String Literals -//////////////////////////////////////////////////////// - -const CHAR TEST_BEGINSTREAM[] = "%%Test: Before begin stream\r\n"; -const CHAR TEST_PSADOBE[] = "%%Test: Before %!PS-Adobe\r\n"; -const CHAR TEST_PAGESATEND[] = "%%Test: Replace driver's %%PagesAtend\r\n"; -const CHAR TEST_PAGES[] = "%%Test: Replace driver's %%Pages: (atend)\r\n"; -const CHAR TEST_DOCUMENTPROCESSCOLORS[] = "%%Test: Replace driver's %%DocumentProcessColors: (atend)\r\n"; -const CHAR TEST_COMMENTS[] = "%%Test: Before %%EndComments\r\n"; -const CHAR TEST_DEFAULTS[] = "%%Test: Before %%BeginDefaults and %%EndDefaults\r\n"; -const CHAR TEST_BEGINPROLOG[] = "%%Test: After %%BeginProlog\r\n"; -const CHAR TEST_ENDPROLOG[] = "%%Test: Before %%EndProlog\r\n"; -const CHAR TEST_BEGINSETUP[] = "%%Test: After %%BeginSetup\r\n"; -const CHAR TEST_ENDSETUP[] = "%%Test: Before %%EndSetup\r\n"; -const CHAR TEST_BEGINPAGESETUP[] = "%%Test: After %%BeginPageSetup\r\n"; -const CHAR TEST_ENDPAGESETUP[] = "%%Test: Before %%EndpageSetup\r\n"; -const CHAR TEST_PAGETRAILER[] = "%%Test: After %%PageTrailer\r\n"; -const CHAR TEST_TRAILER[] = "%%Test: After %%Trailer\r\n"; -const CHAR TEST_PAGENUMBER[] = "%%Test: Replace driver's %%Page:\r\n"; -const CHAR TEST_PAGEORDER[] = "%%Test: Replace driver's %%PageOrder:\r\n"; -const CHAR TEST_ORIENTATION[] = "%%Test: Replace driver's %%Orientation:\r\n"; -const CHAR TEST_BOUNDINGBOX[] = "%%Test: Replace driver's %%BoundingBox:\r\n"; -const CHAR TEST_DOCNEEDEDRES[] = "%%Test: Append to driver's %%DocumentNeededResourc\r\n"; -const CHAR TEST_DOCSUPPLIEDRES[] = "%%Test: Append to driver's %%DocumentSuppliedResou\r\n"; -const CHAR TEST_EOF[] = "%%Test: After %%EOF\r\n"; -const CHAR TEST_ENDSTREAM[] = "%%Test: After the last byte of job stream\r\n"; -const CHAR TEST_DOCUMENTPROCESSCOLORSATEND[] = "%%Test: DocumentProcessColorsAtend\r\n"; -const CHAR TEST_VMSAVE[] = "%%Test: %%VMSave\r\n"; -const CHAR TEST_VMRESTORE[] = "%%Test: %%VMRestore\r\n"; -const CHAR TEST_PLATECOLOR[] = "%%Test: %%PlateColor:\r\n"; -const CHAR TEST_SHOWPAGE[] = "%%Test: %%SowPage:\r\n"; -const CHAR TEST_PAGEBBOX[] = "%%Test: %%PageBox:\r\n"; -const CHAR TEST_ENDPAGECOMMENTS[] = "%%Test: %%EndPageComments:\r\n"; - - -//////////////////////////////////////////////////////////////////////////////////// -// The PSCRIPT driver calls this OEM function at specific points during output -// generation. This gives the OEM DLL an opportunity to insert code fragments -// at specific injection points in the driver's code. It should use -// DrvWriteSpoolBuf for generating any output it requires. - -HRESULT PSCommand(PDEVOBJ pdevobj, DWORD dwIndex, PVOID pData, DWORD cbSize, - IPrintOemDriverPS* pOEMHelp, PDWORD pdwReturn) -{ - PCSTR pProcedure = NULL; - DWORD dwLen = 0; - DWORD dwSize = 0; - HRESULT hResult = E_FAIL; - - VERBOSE("Entering OEMCommand...\r\n"); - - UNREFERENCED_PARAMETER(cbSize); - UNREFERENCED_PARAMETER(pData); - - switch (dwIndex) - { - case PSINJECT_BEGINSTREAM: - VERBOSE("OEMCommand PSINJECT_BEGINSTREAM\n"); - pProcedure = TEST_BEGINSTREAM; - break; - - case PSINJECT_PSADOBE: - VERBOSE("OEMCommand PSINJECT_PSADOBE\n"); - pProcedure = TEST_PSADOBE; - break; - - case PSINJECT_PAGESATEND: - VERBOSE("OEMCommand PSINJECT_PAGESATEND\n"); - pProcedure = TEST_PAGESATEND; - break; - - case PSINJECT_PAGES: - VERBOSE("OEMCommand PSINJECT_PAGES\n"); - pProcedure = TEST_PAGES; - break; - - case PSINJECT_DOCNEEDEDRES: - VERBOSE("OEMCommand PSINJECT_DOCNEEDEDRES\n"); - pProcedure = TEST_DOCNEEDEDRES; - break; - - case PSINJECT_DOCSUPPLIEDRES: - VERBOSE("OEMCommand PSINJECT_DOCSUPPLIEDRES\n"); - pProcedure = TEST_DOCSUPPLIEDRES; - break; - - case PSINJECT_PAGEORDER: - VERBOSE("OEMCommand PSINJECT_PAGEORDER\n"); - pProcedure = TEST_PAGEORDER; - break; - - case PSINJECT_ORIENTATION: - VERBOSE("OEMCommand PSINJECT_ORIENTATION\n"); - pProcedure = TEST_ORIENTATION; - break; - - case PSINJECT_BOUNDINGBOX: - VERBOSE("OEMCommand PSINJECT_BOUNDINGBOX\n"); - pProcedure = TEST_BOUNDINGBOX; - break; - - case PSINJECT_DOCUMENTPROCESSCOLORS: - VERBOSE("OEMCommand PSINJECT_DOCUMENTPROCESSCOLORS\n"); - pProcedure = TEST_DOCUMENTPROCESSCOLORS; - break; - - case PSINJECT_COMMENTS: - VERBOSE("OEMCommand PSINJECT_COMMENTS\n"); - pProcedure = TEST_COMMENTS; - break; - - case PSINJECT_BEGINDEFAULTS: - VERBOSE("OEMCommand PSINJECT_BEGINDEFAULTS\n"); - pProcedure = TEST_DEFAULTS; - break; - - case PSINJECT_ENDDEFAULTS: - VERBOSE("OEMCommand PSINJECT_BEGINDEFAULTS\n"); - pProcedure = TEST_DEFAULTS; - break; - - case PSINJECT_BEGINPROLOG: - VERBOSE("OEMCommand PSINJECT_BEGINPROLOG\n"); - pProcedure = TEST_BEGINPROLOG; - break; - - case PSINJECT_ENDPROLOG: - VERBOSE("OEMCommand PSINJECT_ENDPROLOG\n"); - pProcedure = TEST_ENDPROLOG; - break; - - case PSINJECT_BEGINSETUP: - VERBOSE("OEMCommand PSINJECT_BEGINSETUP\n"); - pProcedure = TEST_BEGINSETUP; - break; - - case PSINJECT_ENDSETUP: - VERBOSE("OEMCommand PSINJECT_ENDSETUP\n"); - pProcedure = TEST_ENDSETUP; - break; - - case PSINJECT_BEGINPAGESETUP: - VERBOSE("OEMCommand PSINJECT_BEGINPAGESETUP\n"); - pProcedure = TEST_BEGINPAGESETUP; - break; - - case PSINJECT_ENDPAGESETUP: - VERBOSE("OEMCommand PSINJECT_ENDPAGESETUP\n"); - pProcedure = TEST_ENDPAGESETUP; - break; - - case PSINJECT_PAGETRAILER: - VERBOSE("OEMCommand PSINJECT_PAGETRAILER\n"); - pProcedure = TEST_PAGETRAILER; - break; - - case PSINJECT_TRAILER: - VERBOSE("OEMCommand PSINJECT_TRAILER\n"); - pProcedure = TEST_TRAILER; - break; - - case PSINJECT_PAGENUMBER: - VERBOSE("OEMCommand PSINJECT_PAGENUMBER\n"); - pProcedure = TEST_PAGENUMBER; - break; - - case PSINJECT_EOF: - VERBOSE("OEMCommand PSINJECT_EOF\n"); - pProcedure = TEST_EOF; - break; - - case PSINJECT_ENDSTREAM: - VERBOSE("OEMCommand PSINJECT_ENDSTREAM\n"); - pProcedure = TEST_ENDSTREAM; - break; - - case PSINJECT_DOCUMENTPROCESSCOLORSATEND: - VERBOSE("OEMCommand PSINJECT_DOCUMENTPROCESSCOLORSATEND\n"); - pProcedure = TEST_DOCUMENTPROCESSCOLORSATEND; - break; - - case PSINJECT_VMSAVE: - VERBOSE("OEMCommand PSINJECT_VMSAVE\n"); - pProcedure = TEST_VMSAVE; - break; - - case PSINJECT_VMRESTORE: - VERBOSE("OEMCommand PSINJECT_VMRESTORE\n"); - pProcedure = TEST_VMRESTORE; - break; - - case PSINJECT_PLATECOLOR: - VERBOSE("OEMCommand PSINJECT_PLATECOLOR\n"); - pProcedure = TEST_PLATECOLOR; - break; - - case PSINJECT_SHOWPAGE: - VERBOSE("OEMCommand PSINJECT_SHOWPAGE\n"); - pProcedure = TEST_SHOWPAGE; - break; - - case PSINJECT_PAGEBBOX: - VERBOSE("OEMCommand PSINJECT_PAGEBBOX\n"); - pProcedure = TEST_PAGEBBOX; - break; - - case PSINJECT_ENDPAGECOMMENTS: - VERBOSE("OEMCommand PSINJECT_ENDPAGECOMMENTS\n"); - pProcedure = TEST_ENDPAGECOMMENTS; - break; - - default: - ERR("Undefined PSCommand!\r\n"); - *pdwReturn = ERROR_NOT_SUPPORTED; - return E_NOTIMPL; - } - - // INVARIANT: should have injection string. - - if(NULL != pProcedure) - { - // Write PostScript to spool file. - dwLen = (DWORD)strlen(pProcedure); - if (dwLen > 0) - { - hResult = pOEMHelp->DrvWriteSpoolBuf(pdevobj, const_cast(pProcedure), dwLen, &dwSize); - } - - // Set return values. - if(SUCCEEDED(hResult) && (dwLen == dwSize)) - { - *pdwReturn = ERROR_SUCCESS; - } - else - { - // Return a meaningful - // error value. - *pdwReturn = GetLastError(); - if(ERROR_SUCCESS == *pdwReturn) - { - *pdwReturn = ERROR_WRITE_FAULT; - } - - // Make sure we return failure - // if the write didn't succeded. - if(SUCCEEDED(hResult)) - { - hResult = HRESULT_FROM_WIN32(*pdwReturn); - } - } - } - - return hResult; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/command.h b/print/OEM Printer Customization Plug-in Samples/C++/oemps/command.h deleted file mode 100644 index e18cdfac..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/command.h +++ /dev/null @@ -1,24 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Command.h -// -// -// PURPOSE: Declare the function that handles custom -// processing of commands. -// - -#pragma once - -///////////////////////////////////////////////////////// -// Prototypes -///////////////////////////////////////////////////////// - -HRESULT PSCommand(PDEVOBJ, DWORD, PVOID, DWORD, IPrintOemDriverPS*, PDWORD); - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/ddihook.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemps/ddihook.cpp deleted file mode 100644 index e14d9cdd..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/ddihook.cpp +++ /dev/null @@ -1,1049 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: DDIHook.cpp -// -// -// PURPOSE: DDI Hook routines for User Mode COM Customization DLL. -// - -#include "precomp.h" -#include "debug.h" -#include "oemps.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -// -// OEMBitBlt -// - -BOOL APIENTRY -OEMBitBlt( - SURFOBJ *psoTrg, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclTrg, - POINTL *pptlSrc, - POINTL *pptlMask, - BRUSHOBJ *pbo, - POINTL *pptlBrush, - ROP4 rop4 - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMBitBlt() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoTrg->dhpdev; - - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvBitBlt)(poempdev->pfnPS[UD_DrvBitBlt])) ( - psoTrg, - psoSrc, - psoMask, - pco, - pxlo, - prclTrg, - pptlSrc, - pptlMask, - pbo, - pptlBrush, - rop4)); - -} - -// -// OEMStretchBlt -// - -BOOL APIENTRY -OEMStretchBlt( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMStretchBlt() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - - // - // turn around to call PS - // - - return (((PFN_DrvStretchBlt)(poempdev->pfnPS[UD_DrvStretchBlt])) ( - psoDest, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDest, - prclSrc, - pptlMask, - iMode)); - -} - - -// -// OEMCopyBits -// - -BOOL APIENTRY -OEMCopyBits( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDest, - POINTL *pptlSrc - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMCopyBits() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvCopyBits)(poempdev->pfnPS[UD_DrvCopyBits])) ( - psoDest, - psoSrc, - pco, - pxlo, - prclDest, - pptlSrc)); - -} - -// -// OEMTextOut -// - -BOOL APIENTRY -OEMTextOut( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMTextOut() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvTextOut)(poempdev->pfnPS[UD_DrvTextOut])) ( - pso, - pstro, - pfo, - pco, - prclExtra, - prclOpaque, - pboFore, - pboOpaque, - pptlOrg, - mix)); - -} - -// -// OEMStrokePath -// - -BOOL APIENTRY -OEMStrokePath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - LINEATTRS *plineattrs, - MIX mix - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMStokePath() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvStrokePath)(poempdev->pfnPS[UD_DrvStrokePath])) ( - pso, - ppo, - pco, - pxo, - pbo, - pptlBrushOrg, - plineattrs, - mix)); - -} - -// -// OEMFillPath -// - -BOOL APIENTRY -OEMFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - MIX mix, - FLONG flOptions - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMFillPath() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvFillPath)(poempdev->pfnPS[UD_DrvFillPath])) ( - pso, - ppo, - pco, - pbo, - pptlBrushOrg, - mix, - flOptions)); - -} - -// -// OEMStrokeAndFillPath -// - -BOOL APIENTRY -OEMStrokeAndFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pboStroke, - LINEATTRS *plineattrs, - BRUSHOBJ *pboFill, - POINTL *pptlBrushOrg, - MIX mixFill, - FLONG flOptions - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMStrokeAndFillPath() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvStrokeAndFillPath)(poempdev->pfnPS[UD_DrvStrokeAndFillPath])) ( - pso, - ppo, - pco, - pxo, - pboStroke, - plineattrs, - pboFill, - pptlBrushOrg, - mixFill, - flOptions)); - -} - -// -// OEMRealizeBrush -// - -BOOL APIENTRY -OEMRealizeBrush( - BRUSHOBJ *pbo, - SURFOBJ *psoTarget, - SURFOBJ *psoPattern, - SURFOBJ *psoMask, - XLATEOBJ *pxlo, - ULONG iHatch - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMRealizeBrush() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoTarget->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvRealizeBrush)(poempdev->pfnPS[UD_DrvRealizeBrush])) ( - pbo, - psoTarget, - psoPattern, - psoMask, - pxlo, - iHatch)); - -} - -// -// OEMStartPage -// - -BOOL APIENTRY -OEMStartPage( - SURFOBJ *pso - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMStartPage() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvStartPage)(poempdev->pfnPS[UD_DrvStartPage]))(pso)); - -} - -#define OEM_TESTSTRING "The DDICMDCB DLL adds this line of text." - -// -// OEMSendPage -// - -BOOL APIENTRY -OEMSendPage( - SURFOBJ *pso - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMSendPage() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // print a line of text, just for testing - // - if (pso->iType == STYPE_BITMAP) - { - pdevobj->pDrvProcs->DrvXMoveTo(pdevobj, 0, 0); - pdevobj->pDrvProcs->DrvYMoveTo(pdevobj, 0, 0); - pdevobj->pDrvProcs->DrvWriteSpoolBuf(pdevobj, OEM_TESTSTRING, - sizeof(OEM_TESTSTRING)); - } - - // - // turn around to call PS - // - - return (((PFN_DrvSendPage)(poempdev->pfnPS[UD_DrvSendPage]))(pso)); - -} - -// -// OEMEscape -// - -ULONG APIENTRY -OEMEscape( - SURFOBJ *pso, - ULONG iEsc, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMEscape() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvEscape)(poempdev->pfnPS[UD_DrvEscape])) ( - pso, - iEsc, - cjIn, - pvIn, - cjOut, - pvOut)); - -} - -// -// OEMStartDoc -// - -BOOL APIENTRY -OEMStartDoc( - SURFOBJ *pso, - _In_ PWSTR pwszDocName, - DWORD dwJobId - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMStartDoc() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvStartDoc)(poempdev->pfnPS[UD_DrvStartDoc])) ( - pso, - pwszDocName, - dwJobId)); - -} - -// -// OEMEndDoc -// - -BOOL APIENTRY -OEMEndDoc( - SURFOBJ *pso, - FLONG fl - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMEndDoc() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvEndDoc)(poempdev->pfnPS[UD_DrvEndDoc])) ( - pso, - fl)); - -} - -//////// -// NOTE: -// OEM DLL needs to hook out the following six font related DDI calls only -// if it enumerates additional fonts beyond what's in the GPD file. -// And if it does, it needs to take care of its own fonts for all font DDI -// calls and DrvTextOut call. -/////// - -// -// OEMQueryFont -// - -PIFIMETRICS APIENTRY -OEMQueryFont( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG_PTR *pid - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMQueryFont() entry.\r\n"); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvQueryFont)(poempdev->pfnPS[UD_DrvQueryFont])) ( - dhpdev, - iFile, - iFace, - pid)); - -} - -// -// OEMQueryFontTree -// - -PVOID APIENTRY -OEMQueryFontTree( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG iMode, - ULONG_PTR *pid - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMQueryFontTree() entry.\r\n"); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvQueryFontTree)(poempdev->pfnPS[UD_DrvQueryFontTree])) ( - dhpdev, - iFile, - iFace, - iMode, - pid)); - -} - -// -// OEMQueryFontData -// - -LONG APIENTRY -OEMQueryFontData( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - HGLYPH hg, - GLYPHDATA *pgd, - _Out_writes_bytes_(cjSize) PVOID pv, - ULONG cjSize - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMQueryFontData() entry.\r\n"); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS if this is not the font that OEM enumerated. - // - - return (((PFN_DrvQueryFontData)(poempdev->pfnPS[UD_DrvQueryFontData])) ( - dhpdev, - pfo, - iMode, - hg, - pgd, - pv, - cjSize)); - -} - -// -// OEMQueryAdvanceWidths -// - -BOOL APIENTRY -OEMQueryAdvanceWidths( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - _In_reads_(cGlyphs) HGLYPH *phg, - _Out_writes_bytes_(cGlyphs*sizeof(USHORT)) PVOID pvWidths, - ULONG cGlyphs - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMQueryAdvanceWidths() entry.\r\n"); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS if this is not the font that OEM enumerated. - // - - return (((PFN_DrvQueryAdvanceWidths) - (poempdev->pfnPS[UD_DrvQueryAdvanceWidths])) ( - dhpdev, - pfo, - iMode, - phg, - pvWidths, - cGlyphs)); - -} - -// -// OEMFontManagement -// - -ULONG APIENTRY -OEMFontManagement( - SURFOBJ *pso, - FONTOBJ *pfo, - ULONG iMode, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMFontManagement() entry.\r\n"); - - // - // Note that PS will not call OEM DLL for iMode==QUERYESCSUPPORT. - // So pso is not NULL for sure. - // - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS if this is not the font that OEM enumerated. - // - - return (((PFN_DrvFontManagement)(poempdev->pfnPS[UD_DrvFontManagement])) ( - pso, - pfo, - iMode, - cjIn, - pvIn, - cjOut, - pvOut)); - -} - -// -// OEMGetGlyphMode -// - -ULONG APIENTRY -OEMGetGlyphMode( - DHPDEV dhpdev, - FONTOBJ *pfo - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMGetGlyphMode() entry.\r\n"); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS if this is not the font that OEM enumerated. - // - - return (((PFN_DrvGetGlyphMode)(poempdev->pfnPS[UD_DrvGetGlyphMode])) ( - dhpdev, - pfo)); - -} - - -// -// OEMStretchBltROP -// - -BOOL APIENTRY -OEMStretchBltROP( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode, - BRUSHOBJ *pbo, - ROP4 rop4 - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMStretchBltROP() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvStretchBltROP)(poempdev->pfnPS[UD_DrvStretchBltROP])) ( - psoDest, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDest, - prclSrc, - pptlMask, - iMode, - pbo, - rop4 - )); - - -} - -// -// OEMPlgBlt -// - -BOOL APIENTRY -OEMPlgBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlBrushOrg, - POINTFIX *pptfixDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMPlgBlt() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoDst->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvPlgBlt)(poempdev->pfnPS[UD_DrvPlgBlt])) ( - psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlBrushOrg, - pptfixDest, - prclSrc, - pptlMask, - iMode)); - -} - -// -// OEMAlphaBlend -// - -BOOL APIENTRY -OEMAlphaBlend( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDest, - RECTL *prclSrc, - BLENDOBJ *pBlendObj - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMAlphaBlend() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvAlphaBlend)(poempdev->pfnPS[UD_DrvAlphaBlend])) ( - psoDest, - psoSrc, - pco, - pxlo, - prclDest, - prclSrc, - pBlendObj - )); - -} - -// -// OEMGradientFill -// - -BOOL APIENTRY -OEMGradientFill( - SURFOBJ *psoDest, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - TRIVERTEX *pVertex, - ULONG nVertex, - PVOID pMesh, - ULONG nMesh, - RECTL *prclExtents, - POINTL *pptlDitherOrg, - ULONG ulMode - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMGradientFill() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvGradientFill)(poempdev->pfnPS[UD_DrvGradientFill])) ( - psoDest, - pco, - pxlo, - pVertex, - nVertex, - pMesh, - nMesh, - prclExtents, - pptlDitherOrg, - ulMode - )); - -} - -BOOL APIENTRY -OEMTransparentBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - RECTL *prclSrc, - ULONG iTransColor, - ULONG ulReserved - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMTransparentBlt() entry.\r\n"); - - pdevobj = (PDEVOBJ)psoDst->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvTransparentBlt)(poempdev->pfnPS[UD_DrvTransparentBlt])) ( - psoDst, - psoSrc, - pco, - pxlo, - prclDst, - prclSrc, - iTransColor, - ulReserved - )); - -} - -HANDLE APIENTRY -OEMIcmCreateColorTransform( - DHPDEV dhpdev, - LPLOGCOLORSPACEW pLogColorSpace, - _In_reads_bytes_opt_(cjSourceProfile) PVOID pvSourceProfile, - ULONG cjSourceProfile, - _In_reads_bytes_(cjDestProfile) PVOID pvDestProfile, - ULONG cjDestProfile, - _In_reads_bytes_opt_(cjTargetProfile) PVOID pvTargetProfile, - ULONG cjTargetProfile, - DWORD dwReserved - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMCreateColorTransform() entry.\r\n"); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvIcmCreateColorTransform)(poempdev->pfnPS[UD_DrvIcmCreateColorTransform])) ( - dhpdev, - pLogColorSpace, - pvSourceProfile, - cjSourceProfile, - pvDestProfile, - cjDestProfile, - pvTargetProfile, - cjTargetProfile, - dwReserved - )); - -} - -BOOL APIENTRY -OEMIcmDeleteColorTransform( - DHPDEV dhpdev, - HANDLE hcmXform - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMDeleteColorTransform() entry.\r\n"); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvIcmDeleteColorTransform)(poempdev->pfnPS[UD_DrvIcmDeleteColorTransform])) ( - dhpdev, - hcmXform - )); - -} - -BOOL APIENTRY -OEMQueryDeviceSupport( - SURFOBJ *pso, - XLATEOBJ *pxlo, - XFORMOBJ *pxo, - ULONG iType, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE("OEMQueryDeviceSupport() entry.\r\n"); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call PS - // - - return (((PFN_DrvQueryDeviceSupport)(poempdev->pfnPS[UD_DrvQueryDeviceSupport])) ( - pso, - pxlo, - pxo, - iType, - cjIn, - pvIn, - cjOut, - pvOut - )); -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/oemps/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.cpp deleted file mode 100644 index 3e66faeb..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - -#include "precomp.h" -#include "oemps.h" -#include "debug.h" -#include "devmode.h" - - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR("DevMode() ERROR_INVALID_PARAMETER.\r\n"); - - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - case OEMDM_DEFAULT: - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - break; - - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return S_OK; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut) -{ - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR("ConvertOEMDevmode() invalid parameters.\r\n"); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE("Converting private OEM Devmode.\r\n"); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n"); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - } - - return TRUE; -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data. - pOEMDevmode->dwDriverData = 0; - - return TRUE; -} - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.h deleted file mode 100644 index 3cf13641..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/devmode.h +++ /dev/null @@ -1,44 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - BOOL dwDriverData; - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - -///////////////////////////////////////////////////////// -// Prototypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); -void Dump(PCOEMDEV pOEMDevIn); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemps/dllentry.cpp deleted file mode 100644 index d9851eff..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/dllentry.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "oemps.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE("Process attach.\r\n"); - break; - - case DLL_THREAD_ATTACH: - VERBOSE("Thread attach.\r\n"); - break; - - case DLL_PROCESS_DETACH: - VERBOSE("Process detach.\r\n"); - break; - - case DLL_THREAD_DETACH: - VERBOSE("Thread detach.\r\n"); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.cpp deleted file mode 100644 index 34f0914c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.cpp +++ /dev/null @@ -1,632 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Interface for User Mode COM Customization DLL. -// - -#include "precomp.h" - -#include "debug.h" - -#include "devmode.h" -#include "oemps.h" -#include "command.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents; // Count of active components -static long g_cServerLocks; // Count of locks - -//////////////////////////////////////////////////////// -// Internal Constants -//////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////// -// Warning: the following array order must match the -// order in enum ENUMHOOKS. -/////////////////////////////////////////////////////// -static const DRVFN OEMHookFuncs[] = -{ - { INDEX_DrvRealizeBrush, (PFN) OEMRealizeBrush }, - { INDEX_DrvCopyBits, (PFN) OEMCopyBits }, - { INDEX_DrvBitBlt, (PFN) OEMBitBlt }, - { INDEX_DrvStretchBlt, (PFN) OEMStretchBlt }, - { INDEX_DrvTextOut, (PFN) OEMTextOut }, - { INDEX_DrvStrokePath, (PFN) OEMStrokePath }, - { INDEX_DrvFillPath, (PFN) OEMFillPath }, - { INDEX_DrvStrokeAndFillPath, (PFN) OEMStrokeAndFillPath }, - { INDEX_DrvStartPage, (PFN) OEMStartPage }, - { INDEX_DrvSendPage, (PFN) OEMSendPage }, - { INDEX_DrvEscape, (PFN) OEMEscape }, - { INDEX_DrvStartDoc, (PFN) OEMStartDoc }, - { INDEX_DrvEndDoc, (PFN) OEMEndDoc }, - { INDEX_DrvQueryFont, (PFN) OEMQueryFont }, - { INDEX_DrvQueryFontTree, (PFN) OEMQueryFontTree }, - { INDEX_DrvQueryFontData, (PFN) OEMQueryFontData }, - { INDEX_DrvQueryAdvanceWidths, (PFN) OEMQueryAdvanceWidths }, - { INDEX_DrvFontManagement, (PFN) OEMFontManagement }, - { INDEX_DrvGetGlyphMode, (PFN) OEMGetGlyphMode }, - { INDEX_DrvStretchBltROP, (PFN) OEMStretchBltROP }, - { INDEX_DrvPlgBlt, (PFN) OEMPlgBlt }, - { INDEX_DrvTransparentBlt, (PFN) OEMTransparentBlt }, - { INDEX_DrvAlphaBlend, (PFN) OEMAlphaBlend }, - { INDEX_DrvGradientFill, (PFN) OEMGradientFill }, - { INDEX_DrvIcmCreateColorTransform, (PFN) OEMIcmCreateColorTransform }, - { INDEX_DrvIcmDeleteColorTransform, (PFN) OEMIcmDeleteColorTransform }, - { INDEX_DrvQueryDeviceSupport, (PFN) OEMQueryDeviceSupport }, -}; - - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemPS body -// -IOemPS::IOemPS() : m_cRef(1) -{ - VERBOSE("IOemPS::IOemPS() entered.\r\n"); - - // Increment COM component count. - InterlockedIncrement(&g_cComponents); - - m_pOEMHelp = NULL; - - VERBOSE("IOemPS::IOemPS() leaving.\r\n"); -} - - -IOemPS::~IOemPS() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); - - // Decrement COM compontent count. - InterlockedDecrement(&g_cComponents); -} - - -HRESULT __stdcall IOemPS::QueryInterface(const IID& iid, void** ppv) -{ - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE("IOemPS::QueryInterface IUnknown.\r\n"); - } - else if (iid == IID_IPrintOemPS) - { - *ppv = static_cast(this); - VERBOSE("IOemPS::QueryInterface IPrintOemPs.\r\n"); - } - else - { - VERBOSE("IOemPS::QueryInterface (interface not supported).\r\n"); - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall IOemPS::AddRef() -{ - VERBOSE("IOemPS::AddRef() entry.\r\n"); - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemPS::Release() -{ - VERBOSE("IOemPS::Release() entry.\r\n"); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - - -HRESULT __stdcall IOemPS::GetInfo ( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE("IOemPS::GetInfo(%d) entry.\r\n"); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - ERR("IOemPS::GetInfo() exit pcbNeeded is NULL!\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size. - if(OEMGI_GETPUBLISHERINFO != dwMode) - { - *pcbNeeded = sizeof(DWORD); - } - else - { - *pcbNeeded = sizeof(PUBLISHERINFO); - return E_FAIL; - } - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - ERR("IOemPS::GetInfo() exit insufficient buffer!\r\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - case OEMGI_GETPUBLISHERINFO: - case OEMGI_GETREQUESTEDHELPERINTERFACES: - default: - // Set written bytes to zero since nothing was written. - ERR("IOemPS::GetInfo() exit, mode not supported.\r\n"); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - return S_OK; -} - -HRESULT __stdcall IOemPS::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE("IOemPS::PublishDriverInterface() entry.\r\n"); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (this->m_pOEMHelp == NULL) - { - HRESULT hResult; - - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverPS, (void** ) &(this->m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - this->m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - - -HRESULT __stdcall IOemPS::EnableDriver(DWORD dwDriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded) -{ - VERBOSE("IOemPS::EnableDriver() entry.\r\n"); - - UNREFERENCED_PARAMETER(dwDriverVersion); - UNREFERENCED_PARAMETER(cbSize); - - // List DDI functions that are hooked. - pded->iDriverVersion = PRINTER_OEMINTF_VERSION; - pded->c = sizeof(OEMHookFuncs) / sizeof(DRVFN); - pded->pdrvfn = (DRVFN *) OEMHookFuncs; - - // Even if nothing is done, need to return S_OK so - // that DisableDriver() will be called, which releases - // the reference to the Printer Driver's interface. - // If error occurs, return E_FAIL. - return S_OK; -} - -HRESULT __stdcall IOemPS::DisableDriver(VOID) -{ - VERBOSE("IOemPS::DisaleDriver() entry.\r\n"); - - // Release reference to Printer Driver's interface. - if (this->m_pOEMHelp) - { - this->m_pOEMHelp->Release(); - this->m_pOEMHelp = NULL; - } - - return S_OK; -} - -HRESULT __stdcall IOemPS::DisablePDEV( - PDEVOBJ pdevobj) -{ - VERBOSE("IOemPS::DisablePDEV() entry.\r\n"); - - // - // Free memory for OEMPDEV and any memory block that hangs off OEMPDEV. - // - assert(NULL != pdevobj->pdevOEM); - delete pdevobj->pdevOEM; - - return S_OK; -}; - -HRESULT __stdcall IOemPS::EnablePDEV( - PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem) -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(cPatterns); - UNREFERENCED_PARAMETER(phsurfPatterns); - UNREFERENCED_PARAMETER(cjGdiInfo); - UNREFERENCED_PARAMETER(pGdiInfo); - UNREFERENCED_PARAMETER(cjDevInfo); - UNREFERENCED_PARAMETER(pDevInfo); - - VERBOSE("IOemPS::EnablePDEV() entry.\r\n"); - - POEMPDEV poempdev; - INT i, j; - DWORD dwDDIIndex; - PDRVFN pdrvfn; - - // - // Allocate the OEMDev - // - poempdev = new OEMPDEV; - if (NULL == poempdev) - { - return E_FAIL; - } - - // - // Fill in OEMDEV - // - - for (i = 0; i < MAX_DDI_HOOKS; i++) - { - // - // search through PS's hooks and locate the function ptr - // - dwDDIIndex = OEMHookFuncs[i].iFunc; - for (j = pded->c, pdrvfn = pded->pdrvfn; j > 0; j--, pdrvfn++) - { - if (dwDDIIndex == pdrvfn->iFunc) - { - poempdev->pfnPS[i] = pdrvfn->pfn; - break; - } - } - if (j == 0) - { - // - // Didn't find the hook. This could mean PS doesn't hook this DDI but allows OEMs to hook it out. - // - poempdev->pfnPS[i] = NULL; - } - - } - - *pDevOem = (POEMPDEV) poempdev; - - return S_OK; -} - - -HRESULT __stdcall IOemPS::ResetPDEV( - PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew) -{ - UNREFERENCED_PARAMETER(pdevobjOld); - UNREFERENCED_PARAMETER(pdevobjNew); - - VERBOSE("IOemPS::ResetPDEV() entry.\r\n"); - - // - // If any information from the previous PDEV needs to be preserved, - // copy it in this function. - // - - return TRUE; -} - - -HRESULT __stdcall IOemPS::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE("IOemPS:DevMode entry.\n"); - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IOemPS::Command( - PDEVOBJ pdevobj, - DWORD dwIndex, - PVOID pData, - DWORD cbSize, - OUT DWORD *pdwResult) -{ - HRESULT hResult = E_NOTIMPL; - - - VERBOSE("IOemPS::Command() entry.\r\n"); - hResult = PSCommand(pdevobj, dwIndex, pData, cbSize, m_pOEMHelp, pdwResult); - - return hResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(); - ~IOemCF(); - -protected: - long m_cRef; -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -IOemCF::IOemCF() : m_cRef(1) -{ - VERBOSE("IOemCF::IOemCF() entered.\r\n"); -} - -IOemCF::~IOemCF() -{ - VERBOSE("IOemCF::~IOemCF() entered.\r\n"); - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE("IOemCF::QueryInterface entered.\r\n"); - - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - WARNING("IOemCF::QueryInterface (interface not supported).\r\n"); - *ppv = NULL; - return E_NOINTERFACE; - } - - reinterpret_cast(*ppv)->AddRef(); - - VERBOSE("IOemCF::QueryInterface leaving.\r\n"); - - return S_OK; -} - -ULONG __stdcall IOemCF::AddRef() -{ - VERBOSE("IOemCF::AddRef() called.\r\n"); - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - VERBOSE("IOemCF::Release() called.\r\n"); - - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - VERBOSE("Class factory: Create component.\r\n"); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - WARNING("Class factory: non-Null pUnknownOuter.\r\n"); - - return CLASS_E_NOAGGREGATION; - } - - // Create component. - IOemPS* pOemCP = new IOemPS; - if (pOemCP == NULL) - { - ERR("Class factory: failed to allocate IOemPS.\r\n"); - - return E_OUTOFMEMORY; - } - - // Get the requested interface. - HRESULT hr = pOemCP->QueryInterface(iid, ppv); - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCP->Release(); - return hr; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - VERBOSE("IOemCF::LockServer entered.\r\n"); - - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - - VERBOSE("IOemCF::LockServer() leaving.\r\n"); - return S_OK; -} - - -// -// Registration functions -// - -// -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - VERBOSE("DllCanUnloadNow entered.\r\n"); - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE("DllGetClassObject: Create class factory entered.\r\n"); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMRENDER) - { - WARNING("DllGetClassObject: doesn't support clsid!\r\n"); - return CLASS_E_CLASSNOTAVAILABLE; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - WARNING("DllGetClassObject: memory allocation failed!\r\n"); - return E_OUTOFMEMORY; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv); - pFontCF->Release(); - - return hr; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.h deleted file mode 100644 index 87b00473..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/intrface.h +++ /dev/null @@ -1,119 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.H -// -// -// PURPOSE: Define COM interface for User Mode Printer Customization DLL. -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemPS -// -// Interface for PostScript OEM sample rendering module -// -class IOemPS : public IPrintOemPS -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IPrintOemPS methods *** - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Method for OEM to specify DDI hook out - // - - STDMETHOD(EnableDriver) (THIS_ DWORD DriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded); - - // - // Method to notify OEM plugin that it is no longer required - // - - STDMETHOD(DisableDriver) (THIS); - - // - // Method for OEM to contruct its own PDEV - // - - STDMETHOD(EnablePDEV) (THIS_ PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem); - - // - // Method for OEM to free any resource associated with its PDEV - // - - STDMETHOD(DisablePDEV) (THIS_ PDEVOBJ pdevobj); - - // - // Method for OEM to transfer from old PDEV to new PDEV - // - - STDMETHOD(ResetPDEV) (THIS_ PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew); - - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, - POEMDMPARAM pOemDMParam); - - // - // OEMCommand - PSCRIPT only, return E_NOTIMPL on Unidrv - // - - STDMETHOD(Command) (THIS_ PDEVOBJ pdevobj, - DWORD dwIndex, - PVOID pData, - DWORD cbSize, - OUT DWORD *pdwResult); - - IOemPS(); - ~IOemPS(); - -protected: - - long m_cRef; - - IPrintOemDriverPS* m_pOEMHelp; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.def b/print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.def deleted file mode 100644 index 9992eb3e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY OEMPS -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.h b/print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.h deleted file mode 100644 index 4fc07721..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/oemps.h +++ /dev/null @@ -1,76 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMPS.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for oemps.cpp. -// -#pragma once - - -/////////////////////////////////////////////////////// -// Warning: the following enum order must match the -// order in OEMHookFuncs[]. -/////////////////////////////////////////////////////// -typedef enum tag_Hooks { - UD_DrvRealizeBrush, - UD_DrvCopyBits, - UD_DrvBitBlt, - UD_DrvStretchBlt, - UD_DrvTextOut, - UD_DrvStrokePath, - UD_DrvFillPath, - UD_DrvStrokeAndFillPath, - UD_DrvStartPage, - UD_DrvSendPage, - UD_DrvEscape, - UD_DrvStartDoc, - UD_DrvEndDoc, - UD_DrvQueryFont, - UD_DrvQueryFontTree, - UD_DrvQueryFontData, - UD_DrvQueryAdvanceWidths, - UD_DrvFontManagement, - UD_DrvGetGlyphMode, - UD_DrvStretchBltROP, - UD_DrvPlgBlt, - UD_DrvTransparentBlt, - UD_DrvAlphaBlend, - UD_DrvGradientFill, - UD_DrvIcmCreateColorTransform, - UD_DrvIcmDeleteColorTransform, - UD_DrvQueryDeviceSupport, - - MAX_DDI_HOOKS, - -} ENUMHOOKS; - - -typedef struct _OEMPDEV { - // - // define whatever needed, such as working buffers, tracking information, - // etc. - // - // This test DLL hooks out every drawing DDI. So it needs to remember - // PS's hook function pointer so it call back. - // - PFN pfnPS[MAX_DDI_HOOKS]; - - // - // define whatever needed, such as working buffers, tracking information, - // etc. - // - DWORD dwReserved[1]; - -} OEMPDEV, *POEMPDEV; - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/oemps/precomp.h deleted file mode 100644 index 4efe4e6f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/precomp.h +++ /dev/null @@ -1,47 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.h -// -// PURPOSE: Header files that should be in the precompiled header. -// -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - -// Required header files that shouldn't change often. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemps/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemps/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/oemps/resource.h deleted file mode 100644 index 48f784ad..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemps/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by OEMPS.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui.ini b/print/OEM Printer Customization Plug-in Samples/C++/oemui.ini deleted file mode 100644 index 6324a104..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=OEMUI.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.def b/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.def deleted file mode 100644 index 68bdffc0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY OEMUI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.rc b/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.rc deleted file mode 100644 index c9968413..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.rc +++ /dev/null @@ -1,169 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "OEM UI Test Module." - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "OEMUI" - VALUE "LegalCopyright", "Copyright © 1998 - 2003 Microsoft Corp." - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "OEMUI.dll" - VALUE "ProductName", "Microsoft OEMUI" - VALUE "ProductVersion", "1.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DEVICE_PROPPAGE DIALOG 0, 0, 179, 113 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Device Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Added Page",IDC_STATIC,55,14,68,11 - PUSHBUTTON "Calibrate",IDC_CALIBRATE,61,34,50,14 -END - -IDD_DOC_PROPPAGE DIALOG 0, 0, 210, 154 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Document Property Page" -FONT 8, "MS Shell Dialog" -BEGIN - LTEXT "OEM UI Document Property Page",IDC_STATIC,60,73,108,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DEVICE_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 172 - TOPMARGIN, 8 - BOTTOMMARGIN, 106 - END - - IDD_DOC_PROPPAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 203 - TOPMARGIN, 7 - BOTTOMMARGIN, 147 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_SECTION "OEM UI Added Item" - IDS_CALIBRATED "Printer has been calibrated." - IDS_NAME "OEM UI Customization DLL" - IDS_DEV_SECTION "Device Settings OEM UI Added Item" - IDS_ADV_SECTION "Advanced OEM UI Added Item" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj deleted file mode 100644 index 7c5e5bcc..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj +++ /dev/null @@ -1,1042 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {452209BF-AEB7-457D-956B-90CDE70CED7D} - $(MSBuildProjectName) - Win10 Debug - Win32 - {84C69391-30E8-404B-B0F2-7C88DEB2A456} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - OEMUI - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;advapi32.lib;uuid.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - OEMUI.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj.Filters deleted file mode 100644 index 07492222..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/OEMUI.vcxproj.Filters +++ /dev/null @@ -1,220 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {03B02FF3-CA63-4469-8907-F08C69CCE4DC} - - - h;hpp;hxx;hm;inl;inc;xsd - {5AE6A39D-71A9-44D0-B561-2746C654DA3B} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {C46C5ADA-08FD-4FA4-829D-1007F014DC71} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/oemui/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.cpp deleted file mode 100644 index dd9ff650..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - -#include "precomp.h" -#include "debug.h" -#include "devmode.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// -//Performs operation on UI Plugins Private DevMode Members. -//Called via IOemUI::DevMode -// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR("DevMode() ERROR_INVALID_PARAMETER.\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - // - //The Method should return the size of the memory allocation needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - // - //Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - // - //OEM_DMEXTRAHEADER Members - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - - // - //Private members - // - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - break; - - // - //The method should convert private DEVMODE members to the current version, if necessary. - // - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - // - //The method should validate the information contained in private DEVMODE members and merge validated values into a private DEVMODE structure containing default values - // - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return S_OK; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut) -{ - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR("ConvertOEMDevmode() invalid parameters.\r\n"); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE("Converting private OEM Devmode.\r\n"); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n"); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - pOEMDevOut->dwAdvancedData = 0; - } - - return TRUE; -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data, if not valid. - if(pOEMDevmode->dwDriverData > 100) - { - pOEMDevmode->dwDriverData = 0; - } - - // Set Advanced driver data, if not valid. - if(pOEMDevmode->dwAdvancedData > 100) - { - pOEMDevmode->dwAdvancedData = 0; - } - - return TRUE; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.h deleted file mode 100644 index 3dcbba25..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/devmode.h +++ /dev/null @@ -1,52 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// - -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -// -// This structure must be prefixed by OEM_DMEXTRAHEADER -// Plug-ins must implement the IPrintOemUI::DevMode method -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - DWORD dwDriverData; - DWORD dwAdvancedData; - - // - //Private DevMode Members - // - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemui/dllentry.cpp deleted file mode 100644 index 0823030c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/dllentry.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "debug.h" -#include "globals.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE("Process attach.\r\n"); - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - VERBOSE("Thread attach.\r\n"); - break; - - case DLL_PROCESS_DETACH: - VERBOSE("Process detach.\r\n"); - break; - - case DLL_THREAD_DETACH: - VERBOSE("Thread detach.\r\n"); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.cpp deleted file mode 100644 index 40cfbbc2..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.cpp -// -// PURPOSE: File that contains all the globals. -// - -#include "precomp.h" -#include "globals.h" - - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.h b/print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.h deleted file mode 100644 index c809fdc6..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/globals.h +++ /dev/null @@ -1,17 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.h -// -// PURPOSE: Lists of globals declared in Globals.cpp. -// - -#pragma once - -// Module's Instance handle from DLLEntry of process. -extern HINSTANCE ghInstance; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.cpp deleted file mode 100644 index a05b4643..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.cpp +++ /dev/null @@ -1,567 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// PURPOSE: Implementation of interface for PScript5 and Unidrv UI plug-ins. -// - -#include "precomp.h" - -#include "debug.h" -#include "devmode.h" -#include "oemui.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0 ; // Count of active components -static long g_cServerLocks = 0 ; // Count of locks - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI body -// -IOemUI::~IOemUI() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall IOemUI::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE("IOemUI:QueryInterface entry.\r\n\r\n"); - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE("IOemUI:Return pointer to IUnknown.\r\n\r\n"); - } - else if (iid == IID_IPrintOemUI) - { - *ppv = static_cast(this) ; - VERBOSE("IOemUI:Return pointer to IPrintOemUI.\r\n"); - } - else - { - VERBOSE("IOemUI::QueryInterface IID not supported.\r\n"); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemUI::AddRef() -{ - VERBOSE("IOemUI:AddRef entry.\r\n"); - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemUI::Release() -{ - VERBOSE("IOemUI:Release entry.\r\n"); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -HRESULT __stdcall IOemUI::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE("IOemUI:PublishDriverInterface entry.\r\n"); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (m_pOEMHelp == NULL) - { - HRESULT hResult; - - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUI, (void** ) &(m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - -HRESULT __stdcall IOemUI::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE("IOemUI::GetInfo entry.\r\r\n"); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - WARNING("IOemUI::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER\r\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING("IOemUI::GetInfo() exit insufficient buffer!\r\r\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING("IOemUI::GetInfo() exit mode not supported.\r\r\n"); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE("IOemUI::GetInfo() exit S_OK\r\n"); - return S_OK; -} - -HRESULT __stdcall IOemUI::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE("IOemUI:DevMode entry.\r\n"); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IOemUI::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam) -{ - VERBOSE("IOemUI:CommonUIProp entry.\r\n"); - - return hrOEMPropertyPage(dwMode, pOemCUIPParam); -} - - -HRESULT __stdcall IOemUI::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE("IOemUI:DocumentPropertySheets entry.\r\n"); - - return hrOEMDocumentPropertySheets(pPSUIInfo, lParam, m_pOEMHelp); -} - -HRESULT __stdcall IOemUI::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE("IOemUI:DevicePropertySheets entry.\r\n"); - - return hrOEMDevicePropertySheets(pPSUIInfo, lParam); -} - -HRESULT __stdcall IOemUI::DeviceCapabilities( - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult) -{ - VERBOSE("IOemUI:DeviceCapabilities entry.\r\n"); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM) -{ - VERBOSE("IOemUI:DevQueryPrintEx entry.\r\n"); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo) -{ - VERBOSE("IOemUI:UpgradePrinter entry.\r\n"); - - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam) -{ - VERBOSE("IOemUI:PrinterEvent entry.\r\n"); - - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IOemUI::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam) -{ - VERBOSE("IOemUI:DriverEvent entry.\r\n"); - - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -#define PROFILE_NAME L"OEMPROFILE.icm\0" - -HRESULT __stdcall IOemUI::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData) -{ - HRESULT Result = E_FAIL; - - VERBOSE("IOemUI:QueryColorProfile entry.\r\n"); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - if(QCP_DEVICEPROFILE == ulQueryMode) - { - if(NULL == pvProfileData) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - if(*pcbProfileData < sizeof(PROFILE_NAME)) - { - *pcbProfileData = sizeof(PROFILE_NAME); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - } - else - { - Result = StringCbCopy((LPWSTR)pvProfileData, *pcbProfileData, PROFILE_NAME); - *pcbProfileData = sizeof(PROFILE_NAME); - *pflProfileData = QCP_PROFILEDISK; - - if(FAILED(Result)) - { - SetLastError(Result); - } - } - } - } - - return Result; -}; - -HRESULT __stdcall IOemUI::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam) -{ - VERBOSE("IOemUI:FontInstallerDlgProc entry.\r\n"); - - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IOemUI::UpdateExternalFonts( - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges) -{ - VERBOSE("IOemUI:UpdateExternalFonts entry.\r\n"); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) STDMETHOD_(ULONG,Release)(THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this) ; - } - else - { - VERBOSE("IOemCF::QueryInterface IID not supported.\r\n"); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION ; - } - - // Create component. - IOemUI* pOemCB = new IOemUI ; - if (pOemCB == NULL) - { - return E_OUTOFMEMORY ; - } - // Get the requested interface. - HRESULT hr = pOemCB->QueryInterface(iid, ppv) ; - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release() ; - return hr ; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks) ; - } - else - { - InterlockedDecrement(&g_cServerLocks) ; - } - return S_OK ; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE("DllGetClassObject:Create class factory.\r\n"); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE ; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF ; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY ; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv) ; - pFontCF->Release() ; - - return hr ; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.h deleted file mode 100644 index 3ae5c07c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/intrface.h +++ /dev/null @@ -1,178 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Header of interface for PScript5 & Unidrv UI plug-ins. -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IOemUI -// -class IOemUI: public IPrintOemUI -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) STDMETHOD_(ULONG,Release)(THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - - IOemUI() { m_cRef = 1; m_pOEMHelp = NULL; }; - ~IOemUI(); - -protected: - LONG m_cRef; - IPrintOemDriverUI* m_pOEMHelp; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.cpp deleted file mode 100644 index 421fa9d0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.cpp +++ /dev/null @@ -1,737 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.cpp -// -// PURPOSE: Main file for OEM UI test module. -// - -#include "precomp.h" - -#include "debug.h" -#include "resource.h" -#include "globals.h" -#include "devmode.h" -#include "oemui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - -typedef struct _tagCBUserData -{ - HANDLE hComPropSheet; - HANDLE hPropPage; - POEMUIPSPARAM pOEMUIParam; - PFNCOMPROPSHEET pfnComPropSheet; - -} CBUSERDATA, *PCBUSERDATA; - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam); -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam); -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems); -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems); -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams); -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource); - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM device or document property UI. -// -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hResult = S_OK; - - VERBOSE("hrOEMPropertyPage entry.\r\n"); - - // Validate parameters. - if( (OEMCUIP_DOCPROP != dwMode) - && - (OEMCUIP_PRNPROP != dwMode) - ) - { - ERR("hrOEMPropertyPage() ERROR_INVALID_PARAMETER.\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - hResult = hrDocumentPropertyPage(dwMode, pOEMUIParam); - break; - - case OEMCUIP_PRNPROP: - hResult = hrPrinterPropertyPage(dwMode, pOEMUIParam); - break; - - default: - // Should never reach this! - ERR("hrOEMPropertyPage() Invalid dwMode"); - SetLastError(ERROR_INVALID_PARAMETER); - hResult = E_FAIL; - break; - } - - return hResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM document property UI. -// -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM document property UI. - pOEMUIParam->cOEMOptItems = 1; - - VERBOSE("hrDocumentPropertyPage() requesting items.\r\n"); - } - else - { - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - VERBOSE("hrDocumentPropertyPage() fill out items.\r\n"); - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMDocUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_ADV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - } - - return S_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM printer property UI. -// -static HRESULT hrPrinterPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - UNREFERENCED_PARAMETER(dwMode); - - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM printer property UI. - pOEMUIParam->cOEMOptItems = 1; - - VERBOSE("hrPrinterPropertyPage() requesting items.\r\n"); - } - else - { - DWORD dwError; - DWORD dwDeviceValue; - DWORD dwType; - DWORD dwNeeded; - - - VERBOSE("hrPrinterPropertyPage() fill out items.\r\n"); - - // Get device settings value from printer. - dwError = GetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, &dwType, (PBYTE) &dwDeviceValue, - sizeof(dwDeviceValue), &dwNeeded); - if( (ERROR_SUCCESS != dwError) - || - (dwDeviceValue > 100) - ) - { - // Failed to get the device value or value is invalid, just use the default. - dwDeviceValue = 0; - } - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMPrinterUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // New section. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, pOEMUIParam->hModule, IDS_DEV_SECTION); - pOEMUIParam->pOEMOptItems[0].Sel = dwDeviceValue; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].lParam = 100; - } - - return S_OK; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to Document property sheet. -// -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, - IPrintOemDriverUI* pOEMHelp) -{ - LONG_PTR lResult = 0; - HRESULT hrResult = S_OK; - - VERBOSE("hrOEMDocumentPropertySheets() entry.\r\n"); - - UNREFERENCED_PARAMETER(pOEMHelp); - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR("hrOEMDocumentPropertySheets() ERROR_INVALID_PARAMETER.\r\n"); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - DWORD dwSheets = 0; - PCBUSERDATA pUserData = NULL; - POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM) pPSUIInfo->lParamInit; - HANDLE hHeap = pOEMUIParam->hOEMHeap; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - COMPROPSHEETUI Sheet; - - - // Init property page. - memset(&Sheet, 0, sizeof(COMPROPSHEETUI)); - Sheet.cbSize = sizeof(COMPROPSHEETUI); - Sheet.Flags = CPSUIF_UPDATE_PERMISSION; - Sheet.hInstCaller = ghInstance; - Sheet.pCallerName = GetStringResource(hHeap, ghInstance, IDS_NAME); - Sheet.pHelpFile = NULL; - Sheet.pfnCallBack = OEMDocUICallBack2; - Sheet.pDlgPage = CPSUI_PDLGPAGE_TREEVIEWONLY; - Sheet.cOptItem = 1; - Sheet.IconID = IDI_CPSUI_PRINTER; - Sheet.pOptItemName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.CallerVersion = 0x100; - Sheet.OptItemVersion = 0x100; - - // Init user data. - pUserData = (PCBUSERDATA) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(CBUSERDATA)); - if (NULL == pUserData) - { - ERR("hrOEMDocumentPropertySheets() failed to allocate user data.\r\n"); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - pUserData->hComPropSheet = pPSUIInfo->hComPropSheet; - pUserData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - pUserData->pOEMUIParam = pOEMUIParam; - Sheet.UserData = (ULONG_PTR) pUserData; - - // Create OptItems for page. - Sheet.pOptItem = CreateOptItems(hHeap, Sheet.cOptItem); - if (NULL == Sheet.pOptItem) - { - ERR("hrOEMDocumentPropertySheets() failed to allocate OPTITEMs.\r\n"); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // Initialize OptItems - Sheet.pOptItem[0].Level = 1; - Sheet.pOptItem[0].Flags = OPTIF_COLLAPSE; - Sheet.pOptItem[0].pName = GetStringResource(hHeap, ghInstance, IDS_SECTION); - Sheet.pOptItem[0].Sel = pOEMDev->dwDriverData; - - Sheet.pOptItem[0].pOptType = CreateOptType(hHeap, 2); - if (NULL == Sheet.pOptItem[0].pOptType) - { - ERR("hrOEMDocumentPropertySheets() failed to allocate OPTTYPE.\r\n"); - - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - Sheet.pOptItem[0].pOptType->Type = TVOT_UDARROW; - Sheet.pOptItem[0].pOptType->pOptParam[1].IconID = 0; - Sheet.pOptItem[0].pOptType->pOptParam[1].lParam = 100; - - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PCOMPROPSHEETUI, - (LPARAM)&Sheet, (LPARAM)&dwSheets); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - -Exit: - - pPSUIInfo->Result = lResult; - return hrResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Adds property page to printer property sheet. -// -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam) -{ - LONG_PTR lResult = 0; - - VERBOSE("hrOEMDevicePropertySheets entry\r\n"); - - // Validate parameters. - if( (NULL == pPSUIInfo) - || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version) - ) - { - ERR("hrOEMDevicePropertySheets() ERROR_INVALID_PARAMETER.\r\n"); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Do action. - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - PROPSHEETPAGE Page; - - // Init property page. - memset(&Page, 0, sizeof(PROPSHEETPAGE)); - Page.dwSize = sizeof(PROPSHEETPAGE); - Page.dwFlags = PSP_DEFAULT; - Page.hInstance = ghInstance; - Page.pszTemplate = MAKEINTRESOURCE(IDD_DEVICE_PROPPAGE); - Page.pfnDlgProc = DevicePropPageProc; - - // Add property sheets. - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, CPSFUNC_ADD_PROPSHEETPAGE, (LPARAM)&Page, 0); - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER) lParam; - - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // No icon - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO) lParam; - - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - - pPSUIInfo->Result = lResult; - return S_OK; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM printer property UI. -// -LONG APIENTRY OEMPrinterUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - - VERBOSE("OEMPrinterUICallBack() entry.\r\n"); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - { - DWORD dwDriverValue = pOEMUIParam->pOEMOptItems[0].Sel; - - // Store OptItems state in printer data. - SetPrinterData(pOEMUIParam->hPrinter, OEMUI_VALUE, REG_DWORD, (PBYTE) &dwDriverValue, sizeof(DWORD)); - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Call back for OEM device property UI. -// -#pragma warning(push) -#pragma warning( disable : 6262 ) // 2 MAX_PATH strings exceeds the default prefast stack size warning threshold by a few bytes. -INT_PTR CALLBACK DevicePropPageProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uiMsg) - { - case WM_COMMAND: - switch(HIWORD(wParam)) - { - case BN_CLICKED: - switch(LOWORD(wParam)) - { - case IDC_CALIBRATE: - // Just display a message that the printer is calibrated, - // since we don't acutally calibrate anything. - { - TCHAR szName[MAX_PATH]; - TCHAR szCalibrated[MAX_PATH]; - - - LoadString(ghInstance, IDS_NAME, szName, sizeof(szName)/sizeof(szName[0])); - LoadString(ghInstance, IDS_CALIBRATED, szCalibrated, sizeof(szCalibrated)/sizeof(szCalibrated[0])); - MessageBox(hDlg, szCalibrated, szName, MB_OK); - } - break; - } - break; - - default: - return FALSE; - } - return TRUE; - - case WM_NOTIFY: - { - switch (((LPNMHDR)lParam)->code) // type of notification message - { - case PSN_SETACTIVE: - break; - - case PSN_KILLACTIVE: - break; - - case PSN_APPLY: - break; - - case PSN_RESET: - break; - } - } - break; - } - - return FALSE; -} -#pragma warning(pop) - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM document property UI. -// -LONG APIENTRY OEMDocUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE("OEMDocUICallBack() entry\r\n"); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Update UI item data. - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - break; - - case CPSUICB_REASON_KILLACTIVE: - // Update devmode if settings have changed. - if(pOEMDev->dwAdvancedData != (DWORD)(pOEMUIParam->pOEMOptItems[0].Sel)) - { - // Update OEM Devmode driver data. - pOEMDev->dwAdvancedData = pOEMUIParam->pOEMOptItems[0].Sel; - } - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pOEMUIParam->pOEMOptItems[0].Sel) != pOEMDev->dwAdvancedData) - { - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->dwAdvancedData; - pOEMUIParam->pOEMOptItems[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -LONG APIENTRY OEMDocUICallBack2(PCPSUICBPARAM pCallbackParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData; - POEMDEV pOEMDev = (POEMDEV) pUserData->pOEMUIParam->pOEMDM; - - - VERBOSE("OEMDocUICallBack2() entry.\r\n"); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Update OEM devmode driver data. - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - pUserData->pfnComPropSheet(pUserData->hComPropSheet, CPSFUNC_SET_RESULT, - (LPARAM)pUserData->hPropPage, - (LPARAM)CPSUI_OK); - break; - - case CPSUICB_REASON_KILLACTIVE: - if(pOEMDev->dwDriverData != (DWORD)(pCallbackParam->pOptItem[0].Sel)) - { - // Update OEM devmode driver data. - pOEMDev->dwDriverData = pCallbackParam->pOptItem[0].Sel; - } - break; - - case CPSUICB_REASON_SETACTIVE: - if((DWORD)(pCallbackParam->pOptItem[0].Sel) != pOEMDev->dwDriverData) - { - pCallbackParam->pOptItem[0].Sel = pOEMDev->dwDriverData; - pCallbackParam->pOptItem[0].Flags |= OPTIF_CHANGED; - lReturn = CPSUICB_ACTION_OPTIF_CHANGED; - } - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Creates and Initializes OptItems. -// -static POPTITEM CreateOptItems(HANDLE hHeap, DWORD dwOptItems) -{ - POPTITEM pOptItems = NULL; - - - // Allocate memory for OptItems; - pOptItems = (POPTITEM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTITEM) * dwOptItems); - if(NULL != pOptItems) - { - InitOptItems(pOptItems, dwOptItems); - } - else - { - ERR("CreateOptItems() failed to allocate memory for OPTITEMs!\r\n"); - } - - return pOptItems; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems. -// -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems) -{ - VERBOSE("InitOptItems() entry.\r\n"); - - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for(DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OptType for OptItem. -// -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams) -{ - POPTTYPE pOptType = NULL; - - - VERBOSE("CreateOptType() entry.\r\n"); - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - if(NULL != pOptType) - { - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, wOptParams * sizeof(OPTPARAM)); - if(NULL != pOptType->pOptParam) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - ERR("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n"); - - // Free allocated memory and return NULL. - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR("CreateOptType() failed to allocated memory for OPTTYPE!\r\n"); - } - - return pOptType; -} - -//////////////////////////////////////////////////////////////////////////////////// -// -// Retrieves pointer to a String resource. -// -static PTSTR GetStringResource(HANDLE hHeap, HANDLE hModule, UINT uResource) -{ - int nResult; - DWORD dwSize = MAX_PATH; - PTSTR pszString = NULL; - - VERBOSE("GetStringResource entered.\r\n"); - - // Allocate buffer for string resource from heap; let the driver clean it up. - pszString = (PTSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(TCHAR)); - if(NULL != pszString) - { - // Load string resource; resize after loading so as not to waste memory. - nResult = LoadString((HMODULE)hModule, uResource, pszString, dwSize); - if(nResult > 0) - { - PTSTR pszTemp; - - pszTemp = (PTSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszString, (nResult + 1) * sizeof(TCHAR)); - if(NULL != pszTemp) - { - pszString = pszTemp; - } - else - { - ERR("GetStringResource() HeapReAlloc() of string retrieved failed!\r\n"); - } - } - else - { - ERR("LoadString() failed.\r\n"); - ERR("GetStringResource() failed to load string resource !\r\n"); - - pszString = NULL; - } - } - else - { - ERR("GetStringResource() failed to allocate string buffer!\r\n"); - } - - return pszString; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.h b/print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.h deleted file mode 100644 index b584893e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/oemui.h +++ /dev/null @@ -1,37 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUI.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for OEMUI Test Module. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - -// OEM Signature and version. -#define PROP_TITLE L"OEM UI Page" - -// Printer registry keys where OEM data is stored. -#define OEMUI_VALUE TEXT("OEMUI_VALUE") -#define OEMUI_DEVICE_VALUE TEXT("OEMUI_DEVICE_VALUE") - - - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam, IPrintOemDriverUI* pOEMHelp); -HRESULT hrOEMDevicePropertySheets(PPROPSHEETUI_INFO pPSUIInfo, LPARAM lParam); - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/oemui/precomp.h deleted file mode 100644 index bd1a22de..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/precomp.h +++ /dev/null @@ -1,52 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.H -// -// PURPOSE: Optimize compilation of headers that don't change frequently. -// -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemui/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemui/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/oemui/resource.h deleted file mode 100644 index 71d3d3d6..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemui/resource.h +++ /dev/null @@ -1,24 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by OEMUI.rc -// -#define IDS_SECTION 1 -#define IDS_CALIBRATED 2 -#define IDS_NAME 3 -#define IDS_DEV_SECTION 4 -#define IDS_DEVICE_SECTION 4 -#define IDS_ADV_SECTION 10 -#define IDD_DEVICE_PROPPAGE 106 -#define IDD_DOC_PROPPAGE 107 -#define IDC_CALIBRATE 1001 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1002 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni.ini b/print/OEM Printer Customization Plug-in Samples/C++/oemuni.ini deleted file mode 100644 index 399b2f9b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMDriverFile1=OEMUNI.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.def b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.def deleted file mode 100644 index be2aaf17..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY OEMUNI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.h b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.h deleted file mode 100644 index 6df79055..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.h +++ /dev/null @@ -1,234 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: OEMUNI.H -// -// -// PURPOSE: Define the COemPDEV class which stores the private -// PDEV for the driver. -// - -#pragma once - -class COemPDEV -{ -public: - __stdcall COemPDEV(void) - { - - // Note that since our parent has AddRef'd the UNIDRV interface, - // we don't do so here since our scope is identical to our - // parent. - // - - VERBOSE("In COemPDEV constructor..."); - - _ResetPointers(); - } - - __stdcall ~COemPDEV(void) - { - VERBOSE("In COemPDEV destructor..."); - } - - void __stdcall InitializeDDITable(DRVENABLEDATA* pded) - { - VERBOSE("COemPDEV::InitializeDDITable entry."); - - UINT iDrvFn; - UINT cDrvFn = pded->c; - PDRVFN pDrvFn = pded->pdrvfn; - - for (iDrvFn = 0; iDrvFn < cDrvFn; ++iDrvFn, ++pDrvFn) - { - _SavePFN(pDrvFn->iFunc, pDrvFn->pfn); - } - } - -private: - - void __stdcall _SavePFN(ULONG uFunc, PFN pfn) - { - - // Note: if a "pass-through" driver is being constructed, then - // there is nothing for this method to do. So, to keep the - // compiler from complaining about a switch with no case - // statements, but which has a default statement, we surround - // the entire construct with preprocessor controls. - // - switch(uFunc) - { - // The following are the drawing related DDI hooks. - // - case INDEX_DrvAlphaBlend: - m_pfnDrvAlphaBlend = (PFN_DrvAlphaBlend)pfn; - break; - case INDEX_DrvBitBlt: - m_pfnDrvBitBlt = (PFN_DrvBitBlt)pfn; - break; - case INDEX_DrvCopyBits: - m_pfnDrvCopyBits = (PFN_DrvCopyBits)pfn; - break; - case INDEX_DrvDitherColor: - m_pfnDrvDitherColor = (PFN_DrvDitherColor)pfn; - break; - case INDEX_DrvFillPath: - m_pfnDrvFillPath = (PFN_DrvFillPath)pfn; - break; - case INDEX_DrvFontManagement: - m_pfnDrvFontManagement = (PFN_DrvFontManagement)pfn; - break; - case INDEX_DrvGetGlyphMode: - m_pfnDrvGetGlyphMode = (PFN_DrvGetGlyphMode)pfn; - break; - case INDEX_DrvGradientFill: - m_pfnDrvGradientFill = (PFN_DrvGradientFill)pfn; - break; - case INDEX_DrvLineTo: - m_pfnDrvLineTo = (PFN_DrvLineTo)pfn; - break; - case INDEX_DrvPaint: - m_pfnDrvPaint = (PFN_DrvPaint)pfn; - break; - case INDEX_DrvPlgBlt: - m_pfnDrvPlgBlt = (PFN_DrvPlgBlt)pfn; - break; - case INDEX_DrvQueryAdvanceWidths: - m_pfnDrvQueryAdvanceWidths = (PFN_DrvQueryAdvanceWidths)pfn; - break; - case INDEX_DrvQueryFont: - m_pfnDrvQueryFont = (PFN_DrvQueryFont)pfn; - break; - case INDEX_DrvQueryFontData: - m_pfnDrvQueryFontData = (PFN_DrvQueryFontData)pfn; - break; - case INDEX_DrvQueryFontTree: - m_pfnDrvQueryFontTree = (PFN_DrvQueryFontTree)pfn; - break; - case INDEX_DrvRealizeBrush: - m_pfnDrvRealizeBrush = (PFN_DrvRealizeBrush)pfn; - break; - case INDEX_DrvStretchBlt: - m_pfnDrvStretchBlt = (PFN_DrvStretchBlt)pfn; - break; - case INDEX_DrvStretchBltROP: - m_pfnDrvStretchBltROP = (PFN_DrvStretchBltROP)pfn; - break; - case INDEX_DrvStrokeAndFillPath: - m_pfnDrvStrokeAndFillPath = (PFN_DrvStrokeAndFillPath)pfn; - break; - case INDEX_DrvStrokePath: - m_pfnDrvStrokePath = (PFN_DrvStrokePath)pfn; - break; - case INDEX_DrvTextOut: - m_pfnDrvTextOut = (PFN_DrvTextOut)pfn; - break; - case INDEX_DrvTransparentBlt: - m_pfnDrvTransparentBlt = (PFN_DrvTransparentBlt)pfn; - break; - // The following are the page/band related DDI hooks. - // - case INDEX_DrvStartDoc: - m_pfnDrvStartDoc = (PFN_DrvStartDoc)pfn; - break; - case INDEX_DrvEndDoc: - m_pfnDrvEndDoc = (PFN_DrvEndDoc)pfn; - break; - case INDEX_DrvStartPage: - m_pfnDrvStartPage = (PFN_DrvStartPage)pfn; - break; - case INDEX_DrvSendPage: - m_pfnDrvSendPage = (PFN_DrvSendPage)pfn; - break; - case INDEX_DrvStartBanding: - m_pfnDrvStartBanding = (PFN_DrvStartBanding)pfn; - break; - case INDEX_DrvNextBand: - m_pfnDrvNextBand = (PFN_DrvNextBand)pfn; - break; - case INDEX_DrvEscape: - m_pfnDrvEscape = (PFN_DrvEscape)pfn; - break; - } // switch(uFunc) - } - - void __stdcall _ResetPointers(void) - { - m_pfnDrvAlphaBlend = NULL; - m_pfnDrvBitBlt = NULL; - m_pfnDrvCopyBits = NULL; - m_pfnDrvDitherColor = NULL; - m_pfnDrvEndDoc = NULL; - m_pfnDrvEscape = NULL; - m_pfnDrvFillPath = NULL; - m_pfnDrvFontManagement = NULL; - m_pfnDrvGetGlyphMode = NULL; - m_pfnDrvGradientFill = NULL; - m_pfnDrvLineTo = NULL; - m_pfnDrvNextBand = NULL; - m_pfnDrvPaint = NULL; - m_pfnDrvPlgBlt = NULL; - m_pfnDrvQueryAdvanceWidths = NULL; - m_pfnDrvQueryFont = NULL; - m_pfnDrvQueryFontData = NULL; - m_pfnDrvQueryFontTree = NULL; - m_pfnDrvRealizeBrush = NULL; - m_pfnDrvSendPage = NULL; - m_pfnDrvStartBanding = NULL; - m_pfnDrvStartDoc = NULL; - m_pfnDrvStartPage = NULL; - m_pfnDrvStretchBlt = NULL; - m_pfnDrvStretchBltROP = NULL; - m_pfnDrvStrokeAndFillPath = NULL; - m_pfnDrvStrokePath = NULL; - m_pfnDrvTextOut = NULL; - m_pfnDrvTransparentBlt = NULL; - } - -public: - - // Unidrv function pointers so that we can punt - // back from the DDI hooks - // - PFN_DrvAlphaBlend m_pfnDrvAlphaBlend; - PFN_DrvBitBlt m_pfnDrvBitBlt; - PFN_DrvCopyBits m_pfnDrvCopyBits; - PFN_DrvDitherColor m_pfnDrvDitherColor; - PFN_DrvEndDoc m_pfnDrvEndDoc; - PFN_DrvEscape m_pfnDrvEscape; - PFN_DrvFillPath m_pfnDrvFillPath; - PFN_DrvFontManagement m_pfnDrvFontManagement; - PFN_DrvGetGlyphMode m_pfnDrvGetGlyphMode; - PFN_DrvGradientFill m_pfnDrvGradientFill; - PFN_DrvLineTo m_pfnDrvLineTo; - PFN_DrvNextBand m_pfnDrvNextBand; - PFN_DrvPaint m_pfnDrvPaint; - PFN_DrvPlgBlt m_pfnDrvPlgBlt; - PFN_DrvQueryAdvanceWidths m_pfnDrvQueryAdvanceWidths; - PFN_DrvQueryFont m_pfnDrvQueryFont; - PFN_DrvQueryFontData m_pfnDrvQueryFontData; - PFN_DrvQueryFontTree m_pfnDrvQueryFontTree; - PFN_DrvRealizeBrush m_pfnDrvRealizeBrush; - PFN_DrvSendPage m_pfnDrvSendPage; - PFN_DrvStartBanding m_pfnDrvStartBanding; - PFN_DrvStartDoc m_pfnDrvStartDoc; - PFN_DrvStartPage m_pfnDrvStartPage; - PFN_DrvStretchBlt m_pfnDrvStretchBlt; - PFN_DrvStretchBltROP m_pfnDrvStretchBltROP; - PFN_DrvStrokeAndFillPath m_pfnDrvStrokeAndFillPath; - PFN_DrvStrokePath m_pfnDrvStrokePath; - PFN_DrvTextOut m_pfnDrvTextOut; - PFN_DrvTransparentBlt m_pfnDrvTransparentBlt; - - /*******************************************/ - /* */ - /* Add any custom PDEV members here */ - /* */ - /*******************************************/ - -}; -typedef COemPDEV* POEMPDEV; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.rc b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.rc deleted file mode 100644 index 6a21e8d3..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.rc +++ /dev/null @@ -1,110 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by DDK Support Team\0" - VALUE "CompanyName", "Microsoft Corp.\0" - VALUE "FileDescription", "OEM Customization Sample\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "OEMUNI\0" - VALUE "LegalCopyright", "Copyright © 1998-2003\0" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0" - VALUE "OriginalFilename", "OEMUNI.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Microsoft OEMUNI\0" - VALUE "ProductVersion", "1.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj deleted file mode 100644 index eeeac176..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj +++ /dev/null @@ -1,1090 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {B0F13767-2056-47FC-B37B-41D7E339900B} - $(MSBuildProjectName) - Win10 Debug - Win32 - {96600CA6-8E9E-4691-ACB9-0225A5B57563} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - OEMUNI - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;USERMODE_DRIVER - %(AdditionalIncludeDirectories);.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;winspool.lib;user32.lib;ole32.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - OEMUNI.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj.Filters deleted file mode 100644 index 8287cc90..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/OEMUNI.vcxproj.Filters +++ /dev/null @@ -1,174 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {25BB1250-6D65-4A18-B7D2-D29AB885B616} - - - h;hpp;hxx;hm;inl;inc;xsd - {C1A83E63-7DD3-4CAD-9079-BA272CB24B89} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {6B77C327-966D-4CD1-AC7A-EB5A773904D2} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/ddihook.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/ddihook.cpp deleted file mode 100644 index 48922ae6..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/ddihook.cpp +++ /dev/null @@ -1,1670 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: DDIHook.cpp -// -// PURPOSE: DDI Hook routines for User Mode COM Customization DLL. This module -// implements the following methods defined in printoem.h -// OEMCopyBits -// OEMBitBlt -// OEMStretchBlt -// OEMDitherColor -// OEMStretchBltROP -// OEMPlgBlt -// OEMPaint -// OEMRealizeBrush -// OEMStrokePath -// OEMFillPath -// OEMStrokeAndFillPath -// OEMLineTo -// OEMAlphaBlend -// OEMGradientFill -// OEMTransparentBlt -// OEMTextOut -// OEMQueryFont -// OEMQueryFontTree -// OEMQueryFontData -// OEMFontManagement -// OEMQueryAdvanceWidths -// OEMGetGlyphMode -// OEMStartDoc -// OEMEndDoc -// OEMStartPage -// OEMSendPage -// OEMStartBanding -// OEMNextBand -// OEMEscape -// - -#include "precomp.h" -#include "debug.h" -#include "devmode.h" -#include "oemuni.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -BOOL APIENTRY -OEMCopyBits( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - POINTL *pptlSrc - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvCopyBits. - - DrvCopyBits translates between device-managed - raster surfaces and GDI standard-format bitmaps. - GDI will call DrvCopyBits when it needs to copy from - one surface to another and at least one of the - surfaces is device-managed. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Points to the Dstination surface - psoSrc - Points to the source surface - pxlo - XLATEOBJ provided by the engine - pco - Defines a clipping region on the Dstination surface - pxlo - Defines the translation of color indices - between the source and target surfaces - prclDst - Defines the area to be modified - pptlSrc - Defines the upper-left corner of the source rectangle - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMCopyBits entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvCopyBits)(psoDst, - psoSrc, - pco, - pxlo, - prclDst, - pptlSrc); -} - -BOOL APIENTRY -OEMBitBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - POINTL *pptlSrc, - POINTL *pptlMask, - BRUSHOBJ *pbo, - POINTL *pptlBrush, - ROP4 rop4 - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvBitBlt. - - DrvBitBlt provides general bit-block transfer capabilities - between device-managed surfaces, between GDI-managed - standard-format bitmaps, or between a device-managed - surface and a GDI-managed standard-format bitmap. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Describes the target surface - psoSrc - Describes the source surface - psoMask - Describes the mask for rop4 - pco - Limits the area to be modified - pxlo - Specifies how color indices are translated - between the source and target surfaces - prclDst - Defines the area to be modified - pptlSrc - Defines the upper left corner of the source rectangle - pptlMask - Defines which pixel in the mask corresponds to - the upper left corner of the source rectangle - pbo - Defines the pattern for bitblt - pptlBrush - Defines the origin of the brush in the Dstination surface - rop4 - ROP code that defines how the mask, pattern, source, and - Dstination pixels are combined to write to the Dstination surface - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMBitBlt entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvBitBlt)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - prclDst, - pptlSrc, - pptlMask, - pbo, - pptlBrush, - rop4); -} - -BOOL APIENTRY -OEMStretchBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDst, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStretchBlt. - - DrvStretchBlt provides stretching bit-block transfer - capabilities between any combination of device-managed - and GDI-managed surfaces. DrvStretchBlt enables the - device driver to write to GDI bitmaps, especially when the - driver can do halftoning. This function allows the same - halftoning algorithm to be applied to GDI bitmaps and - device surfaces. This function can be provided to handle - only certain forms of stretching, such as by integer multiples. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Defines the surface on which to draw - psoSrc - Defines the source for blt operation - psoMask - Defines a surface that provides a mask for the source - pco - Limits the area to be modified on the Dstination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - pca - Defines color adjustment values to be applied to the source bitmap - pptlHTOrg - Specifies the origin of the halftone brush - prclDst - Defines the area to be modified on the Dstination surface - prclSrc - Defines the area to be copied from the source surface - pptlMask - Specifies which pixel in the given mask corresponds to - the upper left pixel in the source rectangle - iMode - Specifies how source pixels are combined to get output pixels - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMStretchBlt entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStretchBlt)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDst, - prclSrc, - pptlMask, - iMode); -} - -ULONG APIENTRY -OEMDitherColor( - DHPDEV dhpdev, - ULONG iMode, - ULONG rgbColor, - ULONG *pulDither - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvDitherColor. - - DrvDitherColor requests the device to create a - brush dithered against a device palette. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - DHPDEV passed, it is our pDEV - iMode - Not used - rgbColor - Solid rgb color to be used - pulDither - buffer to put the halftone brush. - -Return Value: - - Returns halftone method. - - DCR_DRIVER if the dither values have been calculated by the driver. - DCR_SOLID if the engine should use the best solid color approximation of the color. - DCR_HALFTONE if the engine should create a halftone approximation for the driver. - ---*/ - -{ - VERBOSE("OEMDitherColor entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvDitherColor)(dhpdev, - iMode, - rgbColor, - pulDither); -} - -BOOL APIENTRY -OEMStretchBltROP( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDst, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode, - BRUSHOBJ *pbo, - ROP4 rop4 - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStretchBltROP. - - DrvStretchBltROP performs a stretching bit-block transfer - using a ROP. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Specifies the target surface - psoSrc - Specifies the source surface - psoMask - Specifies the mask surface - pco - Limits the area to be modified - pxlo - Specifies how color indices are translated - between the source and target surfaces - pca - Defines color adjustment values to be applied to the source bitmap - pptlHTOrg - Specifies the halftone origin - prclDst - Area to be modified on the destination surface - prclSrc - Rectangle area on the source surface - pptlMask - Defines which pixel in the mask corresponds to - the upper left corner of the source rectangle - iMode - Specifies how source pixels are combined to get output pixels - pbo - Defines the pattern for bitblt - rop4 - ROP code that defines how the mask, pattern, source, and - destination pixels are combined on the destination surface - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMStretchBltROP entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStretchBltROP)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDst, - prclSrc, - pptlMask, - iMode, - pbo, - rop4); -} - -BOOL APIENTRY -OEMPlgBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlBrushOrg, - POINTFIX *pptfixDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) -/*++ - -Routine Description: - - Implementation of DDI hook for DrvPlgBlt. - - DrvPlgBlt provides rotate bit-block transfer capabilities between - combinations of device-managed and GDI-managed surfaces. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Defines the surface on which to draw - psoSrc - Defines the source for blt operation - psoMask - Defines a surface that provides a mask for the source - pco - Limits the area to be modified on the Dstination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - pca - Defines color adjustment values to be applied to the source bitmap - pptlBrushOrg - Specifies the origin of the halftone brush - pptfixDest - Defines the area to be modified on the Dstination surface - prclSrc - Defines the area to be copied from the source surface - pptlMask - Specifies which pixel in the given mask corresponds to - the upper left pixel in the source rectangle - iMode - Specifies how source pixels are combined to get output pixels - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMPlgBlt entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvPlgBlt)(psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlBrushOrg, - pptfixDest, - prclSrc, - pptlMask, - iMode); -} - -BOOL APIENTRY -OEMPaint( - SURFOBJ *pso, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - MIX mix - ) -/*++ - -Routine Description: - - Implementation of DDI hook for DrvPaint. - - DrvPaint is an obsolete function. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to draw - pco - Limits the area to be modified on the Dstination - pbo - Points to a BRUSHOBJ which defined the pattern and colors to fill with - pptlBrushOrg - Specifies the origin of the halftone brush - mix - Defines the foreground and background raster operations to use for - the brush - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMPaint entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvPaint)(pso, - pco, - pbo, - pptlBrushOrg, - mix); -} - -BOOL APIENTRY -OEMRealizeBrush( - BRUSHOBJ *pbo, - SURFOBJ *psoTarget, - SURFOBJ *psoPattern, - SURFOBJ *psoMask, - XLATEOBJ *pxlo, - ULONG iHatch - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvRealizeBrush. - - DrvRealizeBrush requests that the driver realize a specified brush - for a specified surface. To realize a brush, the driver converts a - GDI brush into a form that can be used internally. A realized brush - contains device-specific information needed by the device to - accelerate drawing using the brush. The driver's realization of a brush - is written into the buffer allocated by a call to BRUSHOBJ_pvAllocRBrush. - - Please refer to DDK documentation for more details. - -Arguments: - - pbo - BRUSHOBJ to be realized - psoTarget - Defines the surface for which the brush is to be realized - psoPattern - Defines the pattern for the brush - psoMask - Transparency mask for the brush - pxlo - Defines the interpretration of colors in the pattern - iHatch - Specifies whether psoPattern is one of the hatch brushes - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMRealizeBrush entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoTarget->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvRealizeBrush)(pbo, - psoTarget, - psoPattern, - psoMask, - pxlo, - iHatch); -} - -BOOL APIENTRY -OEMStrokePath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - LINEATTRS *plineattrs, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStrokePath. - - DrvStrokePath strokes a path when called by GDI. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Identifies the surface on which to draw - ppo - Defines the path to be stroked - pco - Defines the clipping path - pxo - Specifies the world to device coordinate transformation - pbo - Specifies the brush to be used when drawing the path - pptlBrushOrg - Defines the brush origin - plineattrs - Defines the line attributes - mix - Specifies how to combine the brush with the destination - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE("OEMStrokePath entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStrokePath)(pso, - ppo, - pco, - pxo, - pbo, - pptlBrushOrg, - plineattrs, - mix); -} - -BOOL APIENTRY -OEMFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - MIX mix, - FLONG flOptions - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvFillPath. - - DrvFillPath is an optional entry point to handle the filling of closed paths. - GDI can call DrvFillPath to fill a path on a device-managed surface. - When deciding whether to call this function, GDI compares the fill - requirements with the following flags in the flGraphicsCaps member of - the DEVINFO structure: GCAPS_BEZIERS, GCAPS_ALTERNATEFILL, - and GCAPS_WINDINGFILL. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to draw. - ppo - Defines the path to be filled - pco - Defines the clipping path - pbo - Defines the pattern and colors to fill with - pptlBrushOrg - Defines the brush origin - mix - Defines the foreground and background ROPs to use for the brush - flOptions - Whether to use zero-winding or odd-even rule - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE("OEMFillPath entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvFillPath)(pso, - ppo, - pco, - pbo, - pptlBrushOrg, - mix, - flOptions); -} - -BOOL APIENTRY -OEMStrokeAndFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pboStroke, - LINEATTRS *plineattrs, - BRUSHOBJ *pboFill, - POINTL *pptlBrushOrg, - MIX mixFill, - FLONG flOptions - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStrokeAndFillPath. - - DrvStrokeAndFillPath strokes and fills a path concurrently. - The driver can return FALSE if the path or the clipping is too - complex for the device to handle; in that case, GDI converts - to a simpler call. For example, if the device driver has set the - GCAPS_BEZIERS flag in the flGraphicsCaps member of the - DEVINFO structure and then receives a path with Bezier curves, - it can return FALSE; GDI will then convert the Bezier curves to - lines and call DrvStrokeAndFillPath again. If the device driver - returns FALSE again, GDI will further simplify the call, making - calls to DrvStrokePath and DrvFillPath, or to DrvBitBlt, depending - on the mix and width of the lines making up the path. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Describes the surface on which to draw - ppo - Describes the path to be filled - pco - Defines the clipping path - pxo - Specifies the world to device coordinate transformation - pboStroke - Specifies the brush to use when stroking the path - plineattrs - Specifies the line attributes - pboFill - Specifies the brush to use when filling the path - pptlBrushOrg - Specifies the brush origin for both brushes - mixFill - Specifies the foreground and background ROPs to use - for the fill brush - flOptions - Whether to use zero-winding or odd-even rule - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE("OEMStrokeAndFillPath entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStrokeAndFillPath)(pso, - ppo, - pco, - pxo, - pboStroke, - plineattrs, - pboFill, - pptlBrushOrg, - mixFill, - flOptions); -} - -BOOL APIENTRY -OEMLineTo( - SURFOBJ *pso, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - LONG x1, - LONG y1, - LONG x2, - LONG y2, - RECTL *prclBounds, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvLineTo. - - DrvLineTo draws a single, solid, integer-only cosmetic line. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Describes the surface on which to draw - pco - Defines the clipping path - pbo - Defines the brush used to draw the line - x1,y1 - Specifies the line's starting point - x2,y2 - Specifies the line's ending point - prclBounds - Defines a rectangle that bounds the unclipped line. - mix - Specifies the foreground and background ROP - -Return Value: - - TRUE if successful - FALSE if driver cannot handle the path - DDI_ERROR if there is an error - ---*/ - -{ - VERBOSE("OEMLineTo entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvLineTo)(pso, - pco, - pbo, - x1, - y1, - x2, - y2, - prclBounds, - mix); -} - -BOOL APIENTRY -OEMAlphaBlend( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDest, - RECTL *prclSrc, - BLENDOBJ *pBlendObj - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvAlphaBlend. - - DrvAlphaBlend provides bit-block transfer capabilities with alpha blending. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDest - Defines the surface on which to draw - psoSrc - Defines the source - pco - Limits the area to be modified on the Destination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - prclDest - Defines the area to be modified on the Destination surface - prclSrc - Defines the area to be copied from the source surface - BlendFunction - Specifies the blend function to be used - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMAlphaBlend entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDest->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvAlphaBlend)(psoDest, - psoSrc, - pco, - pxlo, - prclDest, - prclSrc, - pBlendObj); -} - -BOOL APIENTRY -OEMGradientFill( - SURFOBJ *psoDest, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - TRIVERTEX *pVertex, - ULONG nVertex, - PVOID pMesh, - ULONG nMesh, - RECTL *prclExtents, - POINTL *pptlDitherOrg, - ULONG ulMode - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvGradientFill. - - DrvGradientFill shades the specified primitives. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDest - Defines the surface on which to draw - pco - Limits the area to be modified on the Destination - pxlo - Should be ignored by the driver - pVertex - Pointer to an array of TRIVERTEX structures, - with each entry containing position and color information - nVertex - Specifies the number of TRIVERTEX structures in the - array to which pVertex points - pMesh - Pointer to an array of structures that define the connectivity - of the TRIVERTEX elements to which pVertex points - nMesh - Specifies the number of elements in the array to which - pMesh points - prclExtents - Pointer to a RECTL structure that defines the area in - which the gradient drawing is to occur - pptlDitherOrg - Pointer to a POINTL structure that defines the origin - on the surface for dithering - ulMode - Specifies the current drawing mode and how to interpret - the array to which pMesh points - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMGradientFill entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDest->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvGradientFill)(psoDest, - pco, - pxlo, - pVertex, - nVertex, - pMesh, - nMesh, - prclExtents, - pptlDitherOrg, - ulMode); -} - -BOOL APIENTRY -OEMTransparentBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - RECTL *prclSrc, - ULONG iTransColor, - ULONG ulReserved - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvTransparentBlt. - - DrvTransparentBlt provides bit-block transfer capabilities with - transparency. - - Please refer to DDK documentation for more details. - -Arguments: - - psoDst - Defines the surface on which to draw - psoSrc - Defines the source - pco - Limits the area to be modified on the Destination - pxlo - Specifies how color dwIndexes are to be translated - between the source and target surfaces - prclDst - Defines the area to be modified on the Destination surface - prclSrc - Defines the area to be copied from the source surface - iTransColor - Specifies the transparent color - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMTransparentBlt entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)psoDst->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvTransparentBlt)(psoDst, - psoSrc, - pco, - pxlo, - prclDst, - prclSrc, - iTransColor, - ulReserved); -} - -BOOL APIENTRY -OEMTextOut( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvTextOut. - - DrvTextOut is the entry point from GDI that calls for the - driver to render a set of glyphs at specified positions. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to be written. - pstro - Defines the glyphs to be rendered and their positions - pfo - Specifies the font to be used - pco - Defines the clipping path - prclExtra - A NULL-terminated array of rectangles to be filled - prclOpaque - Specifies an opaque rectangle - pboFore - Defines the foreground brush - pboOpaque - Defines the opaque brush - pptlOrg - Pointer to POINT struct , defining th origin - mix - Specifies the foreground and background ROPs for pboFore - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMTextOut entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvTextOut)(pso, - pstro, - pfo, - pco, - prclExtra, - prclOpaque, - pboFore, - pboOpaque, - pptlOrg, - mix); -} - -PIFIMETRICS APIENTRY -OEMQueryFont( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG_PTR *pid - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryFont. - - DrvQueryFont is used by GDI to get the IFIMETRICS structure - for a given font. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - iFile - Identifies the driver font file - iFace - One-based index of the driver font - pid - Points to a LONG variable for returning an identifier - which GDI will pass to DrvFree - -Return Value: - - Pointer to an IFIMETRICS structure for the given font. - NULL if there is an error - ---*/ - -{ - VERBOSE("OEMQueryFont entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryFont)(dhpdev, - iFile, - iFace, - pid); -} - -PVOID APIENTRY -OEMQueryFontTree( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG iMode, - ULONG_PTR *pid - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryFontTree. - - DrvQueryFontTree provides GDI with a pointer to a structure that - defines one of the following: - - A mapping from Unicode to glyph handles, including glyph variants - - A mapping of kerning pairs to kerning handles - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - iFile - Identifies the driver font file - iFace - One-based index of the driver font - iMode - Specifies the type of information to be provided - pid - Points to a LONG variable for returning an identifier - which GDI will pass to DrvFree - -Return Value: - - Pointer to the structure requested based on iMode. - NULL if there is an error - ---*/ - -{ - VERBOSE("OEMQueryFontTree entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryFontTree)(dhpdev, - iFile, - iFace, - iMode, - pid); -} - -LONG APIENTRY -OEMQueryFontData( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - HGLYPH hg, - GLYPHDATA *pgd, - _Out_writes_bytes_(cjSize) PVOID pv, - ULONG cjSize - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryFontData. - - DrvQueryFontData retrieves information about a realized font. - GDI provides a pointer to an array of glyph or kerning handles, - and the driver returns information about the glyphs or kerning - pairs. The driver can assume that all handles in the array are valid. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - pfo - Points to a FONTOBJ structure - iMode - Type of information requested - hg - A glyph handle - pgd - Points to a GLYPHDATA structure - pv - Points to output buffer - cjSize - Size of output buffer - -Return Value: - - Depends on iMode. FD_ERROR if there is an error - ---*/ - -{ - VERBOSE("OEMQueryFontData entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryFontData)(dhpdev, - pfo, - iMode, - hg, - pgd, - pv, - cjSize); -} - -ULONG APIENTRY -OEMFontManagement( - SURFOBJ *pso, - FONTOBJ *pfo, - ULONG iMode, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvFontManagement. - - Is this function valid for Unidrv drivers? - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Points to a SURFOBJ structure - pfo - Points to a FONTOBJ structure - iMode - Escape number - cjIn - Size of input buffer - pvIn - Points to input buffer - cjOut - Size of output buffer - pvOut - Points to output buffer - -Return Value: - - 0x00000001 to 0x7fffffff for success - 0x80000000 to 0xffffffff for failure - 0 if the specified escape number if not supported - ---*/ - -{ - VERBOSE("OEMFontManagement entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvFontManagement)(pso, - pfo, - iMode, - cjIn, - pvIn, - cjOut, - pvOut); -} - -BOOL APIENTRY -OEMQueryAdvanceWidths( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - _In_reads_(cGlyphs) HGLYPH *phg, - _Out_writes_bytes_(cGlyphs*sizeof(USHORT)) PVOID pvWidths, - ULONG cGlyphs - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvQueryAdvanceWidths. - - DrvQueryAdvanceWidths returns character advance widths - for a specified set of glyphs. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - pfo - Points to a FONTOBJ structure - iMode - Type of information to be provided - phg - Points to an array of HGLYPHs for which the driver will - provide character advance widths - pvWidths - Points to a buffer for returning width data - cGlyphs - Number of glyphs in the phg array - -Return Value: - - Depends on iMode - ---*/ - -{ - VERBOSE("OEMQueryAdvanceWidths entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvQueryAdvanceWidths)(dhpdev, - pfo, - iMode, - phg, - pvWidths, - cGlyphs); -} - -ULONG APIENTRY -OEMGetGlyphMode( - DHPDEV dhpdev, - FONTOBJ *pfo - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvGetGlyphMode. - - DrvGetGlyphMode tells GDI how to cache glyph information. - GDI calls a driver's DrvGetGlyphMode routine to determine the - range of font information that should be cached for a particular - font; that is, DrvGetGlyphMode determines what GDI stores in - its font cache. A device that caches fonts on its own should return - FO_HGLYPHS to minimize the storage requirements for the font. - GDI calls DrvGetGlyphMode for each font realization. For example, - a driver might want to download outlines for point sizes larger than - 12 point, but raster images for smaller fonts. However, GDI reserves - the right to refuse this request. - - Please refer to DDK documentation for more details. - -Arguments: - - dhpdev - Driver device handle - pfo - Points to a FONTOBJ structure - -Return Value: - - The glyph mode or FO_GLYPHMODE, which is the default. - ---*/ - -{ - VERBOSE("OEMGetGlyphMode entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvGetGlyphMode)(dhpdev, - pfo); -} - -BOOL APIENTRY -OEMStartDoc( - SURFOBJ *pso, - _In_ PWSTR pwszDocName, - DWORD dwJobId - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStartDoc. - - DrvStartDoc is called by GDI when it is ready to - start sending a document to the driver for rendering. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - pDocName - Specifies a Unicode document name - jobId - Identifies the print job - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMStartDoc entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStartDoc)(pso, - pwszDocName, - dwJobId); -} - -BOOL APIENTRY -OEMEndDoc( - SURFOBJ *pso, - FLONG fl - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvEndDoc. - - DrvEndDoc is called by GDI when it has finished - sending a document to the driver for rendering. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - flags - A set of flag bits - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMEndDoc entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvEndDoc)(pso, - fl); -} - -BOOL APIENTRY -OEMStartPage( - SURFOBJ *pso - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStartPage. - - DrvStartPage is called by GDI when it is ready to - start sending the contents of a physical page to the - driver for rendering. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMStartPage entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStartPage)(pso); -} - -BOOL APIENTRY -OEMSendPage( - SURFOBJ *pso - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvSendPage. - - DrvSendPage is called by GDI when it has finished - drawing a physical page, so the driver can send - the page to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMSendPage entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvSendPage)(pso); -} - -BOOL APIENTRY -OEMStartBanding( - SURFOBJ *pso, - POINTL *pptl - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvStartBanding. - - DrvStartBanding is called by GDI when it is ready to start - sending bands of a physical page to the driver for rendering. - Note: DrvStartBanding is called to prepare the driver - for banding, call only once per page (not at everyband!!) - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - pptl - Pointer to origin of next band (to return to GDI) - -Return Value: - - Fill out pptl to contain the origin of the first band - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMStartBanding entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvStartBanding)(pso, - pptl); -} - -BOOL APIENTRY -OEMNextBand( - SURFOBJ *pso, - POINTL *pptl - ) - -/*++ - -Routine Description: - - Implementation of DDI hook for DrvNextBand. - - DrvNextBand is called by GDI when it has finished - drawing a band for a physical page, so the driver - can send the band to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface object - pptl - Pointer to origin of next band (to return to GDI) - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("OEMNextBand entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvNextBand)(pso, - pptl); -} - -ULONG APIENTRY -OEMEscape( - SURFOBJ *pso, - ULONG iEsc, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) - -/*++ - -Routine Description: - - Implementation of DDI entry point DrvEscape. - - DrvEscape is used for retrieving information from a device - that is not available in a device-independent device driver - interface; the particular query depends on the value of the - iEsc parameter. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Describes the surface the call is directed to - iEsc - Specifies a query - cjIn - Specifies the size in bytes of the buffer pointed to by pvIn - pvIn - Points to input data buffer - cjOut - Specifies the size in bytes of the buffer pointed to by pvOut - pvOut - Points to the output buffer - -Return Value: - - Depends on the query specified by iEsc parameter. - - Zero if the function specified by the query is not supported. - ---*/ - -{ - VERBOSE("OEMEscape entry."); - - PDEVOBJ pDevObj = (PDEVOBJ)pso->dhpdev; - POEMPDEV pOemPDEV = (POEMPDEV)pDevObj->pdevOEM; - - // Punt call back to UNIDRV. - // - return (pOemPDEV->m_pfnDrvEscape)(pso, - iEsc, - cjIn, - pvIn, - cjOut, - pvOut); -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.cpp deleted file mode 100644 index 6196a054..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.cpp +++ /dev/null @@ -1,222 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - -#include "precomp.h" - -#include "resource.h" -#include "devmode.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -HRESULT hrOEMDevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DevMode. - hrOEMDevMode is called by IPrintOemUni::DevMode - which is defined in intrface.cpp. - - The IPrintOemUni::DevMode method, provided by - rendering plug-ins for Unidrv, performs operations - on private DEVMODE members. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - caller-supplied constant. Refer to the docs - for more information. - pOemDMParam - pointer to an OEMDMPARAM structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - ---*/ - -{ - POEMDEV pOEMDevIn; - POEMDEV pOEMDevOut; - - VERBOSE("hrOEMDevMode entry."); - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - )) - { - ERR("DevMode() ERROR_INVALID_PARAMETER.\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devmode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - case OEMDM_DEFAULT: - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - break; - - case OEMDM_CONVERT: - bConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - case OEMDM_MERGE: - bConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - bMakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return S_OK; -} - - -BOOL bConvertOEMDevmode( - PCOEMDEV pOEMDevIn, - POEMDEV pOEMDevOut - ) - -/*++ - -Routine Description: - - Converts private DEVMODE members to the - current version. - -Arguments: - - pOEMDevIn - pointer to OEM private devmode - pOEMDevOut - pointer to OEM private devmode - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - VERBOSE("bConvertOEMDevmode entry."); - - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR("ConvertOEMDevmode() invalid parameters.\r\n"); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE("Converting private OEM Devmode.\r\n"); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->dwDriverData = 0; - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - VERBOSE("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n"); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->dwDriverData = 0; - } - - return TRUE; -} - - -BOOL bMakeOEMDevmodeValid( - POEMDEV pOEMDevmode - ) - -/*++ - -Routine Description: - - Ensures that private OEM devmode members are valid. - -Arguments: - - pOEMDevmode - pointer to OEM private devmode - -Return Value: - - TRUE if successful, FALSE if there is an error - ---*/ - -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // Set driver data. - pOEMDevmode->dwDriverData = 0; - - return TRUE; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.h deleted file mode 100644 index 02af4909..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/devmode.h +++ /dev/null @@ -1,43 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// - -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - BOOL dwDriverData; -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL bConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL bMakeOEMDevmodeValid(POEMDEV pOEMDevmode); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/dllentry.cpp deleted file mode 100644 index 8ed3e0e7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/dllentry.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" - -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// - -// DllMain isn't called/used for kernel mode version. -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - VERBOSE("DllMain entry."); - - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE("Process attach.\r\n"); - break; - - case DLL_THREAD_ATTACH: - VERBOSE("Thread attach.\r\n"); - break; - - case DLL_PROCESS_DETACH: - VERBOSE("Process detach.\r\n"); - break; - - case DLL_THREAD_DETACH: - VERBOSE("Thread detach.\r\n"); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.cpp deleted file mode 100644 index 8d87053f..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.cpp +++ /dev/null @@ -1,1797 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// PURPOSE: Interface for User Mode COM Customization DLL. -// - -#include "precomp.h" -#include "resource.h" -#include "devmode.h" -#include "debug.h" -#include "oemuni.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -// ================================================================== -// Internal Globals -// -static long g_cComponents; // Count of active components -static long g_cServerLocks; // Count of locks -// -// ================================================================== - -// ================================================================== -// The purpose of this array is to inform UNIDRV of the callbacks -// that are implemented in this driver. -// -// Note that there is *NO* order dependency in this array. New -// index values and their corresponding callbacks can be placed -// anywhere within the list as needed. -// -static const DRVFN s_aOemHookFuncs[] = -{ - // The following are declared in printoem.h and defined in ddihook.cpp. - {INDEX_DrvAlphaBlend, (PFN)OEMAlphaBlend}, - {INDEX_DrvBitBlt, (PFN)OEMBitBlt}, - {INDEX_DrvCopyBits, (PFN)OEMCopyBits}, - {INDEX_DrvDitherColor, (PFN)OEMDitherColor}, - {INDEX_DrvFillPath, (PFN)OEMFillPath}, - {INDEX_DrvFontManagement, (PFN)OEMFontManagement}, - {INDEX_DrvGetGlyphMode, (PFN)OEMGetGlyphMode}, - {INDEX_DrvGradientFill, (PFN)OEMGradientFill}, - {INDEX_DrvLineTo, (PFN)OEMLineTo}, - {INDEX_DrvPaint, (PFN)OEMPaint}, - {INDEX_DrvPlgBlt, (PFN)OEMPlgBlt}, - {INDEX_DrvQueryAdvanceWidths, (PFN)OEMQueryAdvanceWidths}, - {INDEX_DrvQueryFont, (PFN)OEMQueryFont}, - {INDEX_DrvQueryFontData, (PFN)OEMQueryFontData}, - {INDEX_DrvQueryFontTree, (PFN)OEMQueryFontTree}, - {INDEX_DrvRealizeBrush, (PFN)OEMRealizeBrush}, - {INDEX_DrvStretchBlt, (PFN)OEMStretchBlt}, - {INDEX_DrvStretchBltROP, (PFN)OEMStretchBltROP}, - {INDEX_DrvStrokeAndFillPath, (PFN)OEMStrokeAndFillPath}, - {INDEX_DrvStrokePath, (PFN)OEMStrokePath}, - {INDEX_DrvTextOut, (PFN)OEMTextOut}, - {INDEX_DrvTransparentBlt, (PFN)OEMTransparentBlt}, - {INDEX_DrvStartDoc, (PFN)OEMStartDoc}, - {INDEX_DrvEndDoc, (PFN)OEMEndDoc}, - {INDEX_DrvStartPage, (PFN)OEMStartPage}, - {INDEX_DrvSendPage, (PFN)OEMSendPage}, - {INDEX_DrvStartBanding, (PFN)OEMStartBanding}, - {INDEX_DrvNextBand, (PFN)OEMNextBand}, - {INDEX_DrvEscape, (PFN)OEMEscape} -}; - -//////////////////////////////////////////////////////////////////////////////// -// -// COemUni2 body -// -COemUni2::COemUni2() -{ - m_cRef = 1; - - // Increment COM component count. - InterlockedIncrement(&g_cComponents); - - m_pOEMHelp = NULL; -} - -COemUni2::~COemUni2() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - -HRESULT __stdcall -COemUni2:: -QueryInterface( - const IID& iid, - void** ppv - ) -{ - VERBOSE("COemUni2::QueryInterface() entry."); - - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE("COemUni2::QueryInterface IUnknown.\r\n"); - } - else if (iid == IID_IPrintOemUni2) - { - VERBOSE("COemUni2::QueryInterface IPrintOemUni2.\r\n"); - - *ppv = static_cast(this); - } - else - { - WARNING("COemUni2::QueryInterface NULL. Returning E_NOINTERFACE.\r\n"); - - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall -COemUni2:: -AddRef( - VOID - ) -{ - VERBOSE("COemUni2::AddRef() entry."); - - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -COemUni2:: -Release( - VOID - ) -{ - VERBOSE("COemUni2::Release() entry."); - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (cRef == 0) - { - delete this; - return 0; - } - return cRef; -} - -HRESULT __stdcall -COemUni2:: -CommandCallback( - PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::CommandCallback - - The IPrintOemUni::CommandCallback method is used - to provide dynamically generated printer commands - for Unidrv-supported printers. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - dwCallbackID - value representing the printer command's - *CallbackID attribute in the printer's generic printer - description (GPD) file. - dwCount - value representing the number of elements - in the array pointed to by pdwParams. Can be 0. - pdwParams - pointer to an array of DWORD-sized parameters - containing values specified by the printer commands - *Params attribute in the printer's GPD file. Can be NULL. - piResult - Receives a method-supplied result value. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::CommandCallback() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pdwParams); - - *piResult = 0; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -Compression( - PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::Compression - - The IPrintOemUni::Compression method can be used - with Unidrv-supported printers to provide a customized - bitmap compression method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pInBuf - pointer to input scan line data. - pOutBuf - pointer to an output buffer to receive - compressed scan line data. - dwInLen - length of the input data. - dwOutLen - length of the output buffer. - piResult - Receives a method-supplied result value. If the - operation succeeds, this value should be the number - of compressed bytes, which must not be larger than - the value received for dwOutLen. If an error occurs, - or if the method cannot compress, the result value - should be -1. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::Compression() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pInBuf); - UNREFERENCED_PARAMETER(pOutBuf); - UNREFERENCED_PARAMETER(dwInLen); - UNREFERENCED_PARAMETER(dwOutLen); - UNREFERENCED_PARAMETER(piResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DevMode - - The IPrintOemUni::DevMode method, provided by - rendering plug-ins for Unidrv, performs operations - on private DEVMODE members. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DevMode method. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - caller-supplied constant. Refer to the docs - for more information. - pOemDMParam - pointer to an OEMDMPARAM structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE("COemUni2:DevMode entry."); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall -COemUni2:: -DisableDriver( - VOID - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DisableDriver - - The IPrintOemUni::DisableDriver method allows a rendering - plug-in for Unidrv to free resources that were allocated by the - plug-in's IPrintOemUni::EnableDriver method. This is the last - IPrintOemUni interface method that is called before the rendering - plug-in is unloaded. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DisableDriver method. - - Please refer to DDK documentation for more details. - -Arguments: - - VOID - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE("COemUni2::DisableDriver() entry."); - - // Release reference to Printer Driver's interface. - // - if (this->m_pOEMHelp) - { - this->m_pOEMHelp->Release(); - this->m_pOEMHelp = NULL; - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -DisablePDEV( - PDEVOBJ pdevobj - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DisablePDEV - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DisablePDEV method. - - The IPrintOemUni::DisablePDEV method performs the same types of - operations as the DrvDisablePDEV function. Its purpose is to allow a - rendering plug-in to delete the private PDEV structure that is pointed - to by the DEVOBJ structure's pdevOEM member. This PDEV structure - is one that was allocated by the plug-in's IPrintOemUni::EnablePDEV method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE("COemUni2::DisablePDEV() entry."); - - POEMPDEV pOemPDEV = (POEMPDEV)pdevobj->pdevOEM; - delete pOemPDEV; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -DownloadCharGlyph( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DownloadCharGlyph - - The IPrintOemUni::DownloadCharGlyph method enables a - rendering plug-in for Unidrv to send a character glyph for - a specified soft font to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - hGlyph - glyph handle. - pdwWidth - pointer to receive the method-supplied width of the character. - pdwResult - Receives a method-supplied value representing the amount - of printer memory, in bytes, required to store the character glyph. - If the operation fails, the returned value should be zero. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::DownloadCharGlyph() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(hGlyph); - UNREFERENCED_PARAMETER(pdwWidth); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DownloadFontHeader( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DownloadFontHeader - - The IPrintOemUni::DownloadFontHeader method allows a - rendering plug-in for Unidrv to send a font's header - information to a printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pdwResult - Receives a method-supplied value representing the amount - of printer memory, in bytes, required to store the font header - information. If the operation fails, the returned value should be zero. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::DownloadFontHeader() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -DriverDMS( - PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::DriverDMS - - The IPrintOemUni::DriverDMS method allows a rendering - plug-in for Unidrv to indicate that it uses a device-managed - drawing surface instead of the default GDI-managed surface. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::DriverDMS method. - - Please refer to DDK documentation for more details. For general info - on device managed surfaces and how to handle them, please refer to - the section titled "Handling Device-Managed Surfaces". - -Arguments: - - pDevObj - pointer to a DEVOBJ structure. - pBuffer - pointer to a buffer to receive method-specified flags. - cbSize - size, in bytes, of the buffer pointed to by pBuffer. - pcbNeeded - pointer to a location to receive the required - minimum pBuffer size. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE("COemUni2::DriverDMS() entry."); - - UNREFERENCED_PARAMETER(pDevObj); - UNREFERENCED_PARAMETER(pBuffer); - UNREFERENCED_PARAMETER(cbSize); - UNREFERENCED_PARAMETER(pcbNeeded); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -EnableDriver( - DWORD dwDriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::EnableDriver - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::EnableDriver method. - - The IPrintOemUni::EnableDriver method allows a rendering - plug-in to perform the same types of operations as the - DrvEnableDriver function. Like the DrvEnableDriver function, - the IPrintOemUni::EnableDriver method is responsible for - providing addresses of internally supported graphics DDI functions, - or DDI hook functions. - - The method should fill the supplied DRVENABLEDATA structure - and allocate an array of DRVFN structures. It should fill the - array with pointers to hooking functions, along with winddi.h-defined - index values that identify the hooked out graphics DDI functions. - - Please refer to DDK documentation for more details. - -Arguments: - - DriverVersion - interface version number. This value is - defined by PRINTER_OEMINTF_VERSION, in printoem.h. - cbSize - size, in bytes, of the structure pointed to by pded. - pded - pointer to a DRVENABLEDATA structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE("COemUni2::EnableDriver() entry."); - - UNREFERENCED_PARAMETER(dwDriverVersion); - UNREFERENCED_PARAMETER(cbSize); - - // We need to return the DDI functions that have been hooked - // in pded. Here we fill out the fields in pded. - // - pded->iDriverVersion = PRINTER_OEMINTF_VERSION; - pded->c = sizeof(s_aOemHookFuncs) / sizeof(DRVFN); - pded->pdrvfn = (DRVFN *) s_aOemHookFuncs; - - // Even if nothing is done, need to return S_OK so - // that DisableDriver() will be called, which releases - // the reference to the Printer Driver's interface. - // - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -EnablePDEV( - PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::EnablePDEV - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::EnablePDEV method. - - The IPrintOemUni::EnablePDEV method performs the same types - of operations as the DrvEnablePDEV function that is exported - by a printer graphics DLL. Its purpose is to allow a rendering - plug-in to create its own PDEV structure. For more information - about PDEV structures, see "Customized PDEV Structures" in the DDK docs. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pPrinterName - pointer to a text string representing the - logical address of the printer. - cPatterns - value representing the number of HSURF-typed - surface handles contained in the buffer pointed to by - phsurfPatterns. - phsurfPatterns - pointer to a buffer that is large enough to - contain cPatterns number of HSURF-typed surface handles. - The handles represent surface fill patterns. - cjGdiInfo - value representing the size of the structure pointed - to by pGdiInfo. - pGdiInfo - pointer to a GDIINFO structure. - cjDevInfo - value representing the size of the structure pointed - to by pDevInfo. - pDevInfo - pointer to a DEVINFO structure. - pded - pointer to a DRVENABLEDATA structure containing the - addresses of the printer driver's graphics DDI hooking functions. - pDevOem - Receives a method-supplied pointer to a private PDEV structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - If the operation fails, the method should call SetLastError to set an error code. - - ---*/ - -{ - VERBOSE("COemUni2::EnablePDEV() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(cPatterns); - UNREFERENCED_PARAMETER(phsurfPatterns); - UNREFERENCED_PARAMETER(cjGdiInfo); - UNREFERENCED_PARAMETER(cjDevInfo); - UNREFERENCED_PARAMETER(pDevInfo); - UNREFERENCED_PARAMETER(pGdiInfo); - - // Allocate an instance of our private PDEV. - // - POEMPDEV pOemPDEV = new COemPDEV(); - - if (NULL == pOemPDEV) - { - return NULL; - } - - pOemPDEV->InitializeDDITable(pded); - - *pDevOem = pOemPDEV; - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -FilterGraphics( - PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::FilterGraphics - - The IPrintOemUni::FilterGraphics method can be used with - Unidrv-supported printers to modify scan line data and send - it to the spooler. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pBuf - pointer to a buffer containing scan line data to be printed. - dwLen - value representing the length, in bytes, of the data - pointed to by pBuf. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - DWORD dwResult; - - VERBOSE("COemUni2::FilterGraphics() entry."); - - m_pOEMHelp->DrvWriteSpoolBuf(pdevobj, pBuf, dwLen, &dwResult); - - if (dwResult == dwLen) - return S_OK; - else - return S_FALSE; -} - -HRESULT __stdcall -COemUni2:: -GetImplementedMethod( - _In_ PSTR pMethodName - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::GetImplementedMethod - - The IPrintOemUni::GetImplementedMethod method is used by - Unidrv to determine which IPrintOemUni interface methods - have been implemented by a rendering plug-in. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::GetImplemented method. - - Please refer to DDK documentation for more details. - -Arguments: - - pMethodName - pointer to a string representing the name of an - IPrintOemUni interface method, such as "ImageProcessing" - for IPrintOemUni::ImageProcessing or "FilterGraphics" for - IPrintOemUni::FilterGraphics. - -Return Value: - - S_OK The operation succeeded (the specified method is implemented). - S_FALSE The operation failed (the specified method is not implemented). - - ---*/ - -{ - HRESULT Result = S_FALSE; - - VERBOSE("COemUni2::GetImplementedMethod() entry."); - - // Unidrv only calls GetImplementedMethod for optional - // methods. The required methods are assumed to be - // supported. - - // Return S_OK for supported function (i.e. implemented), - // and S_FALSE for functions that aren't supported (i.e. not implemented). - switch (*pMethodName) - { - case 'C': - if (!strcmp(NAME_CommandCallback, pMethodName)) - { - Result = S_OK; - } - break; - case 'F': - if (!strcmp(NAME_FilterGraphics, pMethodName)) - { - Result = S_OK; - } - break; - } - - return Result; -} - -HRESULT __stdcall -COemUni2:: -GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::GetInfo - - A rendering plug-in's IPrintOemUni::GetInfo method returns - identification information. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::GetInfo method. - - Please refer to DDK documentation for more details. - -Arguments: - - dwMode - Contains one of the following caller-supplied integer constants. - OEMGI_GETSIGNATURE - The method must return a unique four-byte - identification signature. The plug-in must also place this signature - in OPTITEM structures, as described in the description of the - OEMCUIPPARAM. structure's pOEMOptItems member. - OEMGI_GETVERSION - The method must return the user interface - plug-in's version number as a DWORD. The version format is - developer-defined. - pBuffer - pointer to memory allocated to receive the information specified - by dwInfo. - cbSize - size of the buffer pointed to by pBuffer. - pcbNeeded - pointer to a location to receive the number of bytes written - into the buffer pointed to by pBuffer. - -Return Value: - - S_OK The operation succeeded (the specified method is implemented). - S_FALSE The operation failed (the specified method is not implemented). - - ---*/ - -{ - PWSTR pszTag = L"COemUni2::GetInfo entry."; - switch(dwMode) - { - case OEMGI_GETSIGNATURE: - pszTag = L"COemUni2::GetInfo entry. [OEMGI_GETSIGNATURE]"; - break; - case OEMGI_GETVERSION: - pszTag = L"COemUni2::GetInfo entry. [OEMGI_GETVERSION]"; - break; - - } - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) ) ) - { - WARNING("COemUni2::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER.\r\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - VERBOSE("COemUni2::GetInfo() exit insufficient buffer!\r\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING("COemUni2::GetInfo() exit mode not supported.\r\n"); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -HalftonePattern( - PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::HalftonePattern - - The IPrintOemUni::HalftonePattern method can be used with - Unidrv-supported printers to create or modify a halftone - pattern before it is used in a halftoning operation. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pHTPattern - pointer to a buffer to receive the method-supplied - halftone pattern. Buffer size, in bytes, is: - (((dwHTPatternX * dwHTPatternY) + 3)/4) * 4 * dwHTNumPatterns. - dwHTPatternX - length, in pixels, of the halftone pattern, as specified - by the GPD file's *HTPatternSize attribute. - dwHTPatternY - height, in pixels, of the halftone pattern, as specified - by the GPD file's *HTPatternSize attribute. - dwHTNumPatterns - number of patterns, as specified by the GPD file's - *HTNumPatterns attribute. This can be 1 or 3. - dwCallbackID - value identifying the halftone method, as specified by - the GPD file's *HTCallbackID attribute. - pResource - pointer to a buffer containing a halftone pattern, as - specified by the GPD file's *rcHTPatternID attribute. This can be NULL. - dwResourceSize - size of the halftone pattern contained in the buffer - pointed to by pResource. This is zero if pResource is NULL. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::HalftonePattern() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pHTPattern); - UNREFERENCED_PARAMETER(dwHTPatternX); - UNREFERENCED_PARAMETER(dwHTPatternY); - UNREFERENCED_PARAMETER(dwHTNumPatterns); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(pResource); - UNREFERENCED_PARAMETER(dwResourceSize); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -ImageProcessing( - PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::ImageProcessing - - The IPrintOemUni::ImageProcessing method can be used with - Unidrv-supported printers to modify image bitmap data, in order - to perform color formatting or halftoning. The method can return - the modified bitmap to Unidrv or send it directly to the print spooler. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pSrcBitmap - pointer to an input device-independent bitmap (DIB). - pBitmapInfoHeader - pointer to a BITMAPINFOHEADER structure - that describes the bitmap pointed to by pSrcBitmap. - pColorTable - pointer to a color table. Used only if the output format is - eight bits per pixel. - dwCallbackID - value assigned to the *IPCallbackID attribute of the - currently selected option for the ColorMode feature. - pIPParams - pointer to an IPPARAMS structure. - ppbResult - - If the method returns the converted DIB to Unidrv: - If the conversion succeeds, the method should return a - pointer to a buffer containing the converted DIB. - Otherwise it should return NULL. - If the method sends the converted DIB to the print spooler: - If the operation succeeds, the method should return TRUE. - Otherwise it should return FALSE. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::ImageProcessing() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pSrcBitmap); - UNREFERENCED_PARAMETER(pBitmapInfoHeader); - UNREFERENCED_PARAMETER(pColorTable); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(pIPParams); - UNREFERENCED_PARAMETER(ppbResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -MemoryUsage( - PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::MemoryUsage - - The IPrintOemUni::MemoryUsage method can be used with - Unidrv-supported printers to specify the amount of memory - required for use by a rendering plug-in's IPrintOemUni::ImageProcessing - method. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pMemoryUsage - pointer to an OEMMEMORYUSAGE structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::MemoryUsage() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pMemoryUsage); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -OutputCharStr( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::OutputCharStr - - The IPrintOemUni::OutputCharStr method enables a rendering - plug-in to control the printing of font glyphs. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - dwType - value indicating the type of glyph specifier array - pointed to by pGlyph. Valid values are as follows: - TYPE_GLYPHHANDLE The pGlyph array elements are glyph - handles of type HGLYPH. - TYPE_GLYPHID The pGlyph array elements are glyph - identifiers of type DWORD. - dwCount - value representing the number of glyph specifiers in - the array pointed to by pGlyph. - pGlyph - pointer to an array of glyph specifiers, where the array - element type is indicated by dwType. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::OutputCharStr() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(dwType); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pGlyph); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -PublishDriverInterface( - IUnknown *pIUnknown - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::PublishDriverInterface - - The IPrintOemUni::PublishDriverInterface method allows a - rendering plug-in for Unidrv to obtain the Unidrv driver's - IPrintOemDriverUni interface. - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::PublishDriverInterface method and the method - must return S_OK, or the driver will not call the plug-in's other - IPrintOemUni interface methods. - - Please refer to DDK documentation for more details. - -Arguments: - - pIUnknown - pointer to the IUnknown interface of the driver's - IPrintOemDriverUni COM interface. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE("COemUni2::PublishDriverInterface() entry."); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (this->m_pOEMHelp == NULL) - { - HRESULT hResult; - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUni, (void** ) &(this->m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - this->m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -ResetPDEV( - PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::ResetPDEV - - A rendering plug-in for Unidrv MUST implement the - IPrintOemUni::ResetPDEV method. - - A rendering plug-in's IPrintOemUni::ResetPDEV method performs - the same types of operations as the DrvResetPDEV function. During - the processing of an application's call to the Platform SDK ResetDC - function, the IPrintOemUni::ResetPDEV method is called by Unidrv's - DrvResetPDEV function. For more information about when DrvResetPDEV - is called, see its description in the DDK docs. - - The rendering plug-in's private PDEV structure's address is contained - in the pdevOEM member of the DEVOBJ structure pointed to by pdevobjOld. - The IPrintOemUni::ResetPDEV method should use relevant members of this - old structure to fill in the new structure, which is referenced through pdevobjNew. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobjOld - pointer to a DEVOBJ structure containing current PDEV information. - pdevobjNew - pointer to a DEVOBJ structure into which the method should place - new PDEV information. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - - ---*/ - -{ - VERBOSE("COemUni2::ResetPDEV() entry."); - - UNREFERENCED_PARAMETER(pdevobjOld); - UNREFERENCED_PARAMETER(pdevobjNew); - - return S_OK; -} - -HRESULT __stdcall -COemUni2:: -SendFontCmd( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::SendFontCmd - - The IPrintOemUni::SendFontCmd method enables a rendering - plug-in to modify a printer's font selection command and then - send it to the printer. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pFInv - pointer to an FINVOCATION structure. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::SendFontCmd() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pFInv); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TextOutAsBitmap( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TextOutAsBitmap - - The IPrintOemUni::TextOutAsBitmap method allows a rendering - plug-in to create a bitmap image of a text string, in case a - downloadable font is not available. - - Please refer to DDK documentation for more details. - -Arguments: - - pso - Defines the surface on which to be written. - pstro - Defines the glyphs to be rendered and their positions - pfo - Specifies the font to be used - pco - Defines the clipping path - prclExtra - A NULL-terminated array of rectangles to be filled - prclOpaque - Specifies an opaque rectangle - pboFore - Defines the foreground brush - pboOpaque - Defines the opaque brush - pptlOrg - Pointer to POINT struct , defining th origin - mix - Specifies the foreground and background ROPs for pboFore - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::TextOutAsBitmap() entry."); - - UNREFERENCED_PARAMETER(pso); - UNREFERENCED_PARAMETER(pstro); - UNREFERENCED_PARAMETER(pfo); - UNREFERENCED_PARAMETER(pco); - UNREFERENCED_PARAMETER(prclExtra); - UNREFERENCED_PARAMETER(prclOpaque); - UNREFERENCED_PARAMETER(pboFore); - UNREFERENCED_PARAMETER(pboOpaque); - UNREFERENCED_PARAMETER(pptlOrg); - UNREFERENCED_PARAMETER(mix); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TTDownloadMethod( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TTDownloadMethod - - The IPrintOemUni::TTDownloadMethod method enables a rendering - plug-in to indicate the format that Unidrv should use for a specified - TrueType soft font. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pUFObj - pointer to a UNIFONTOBJ structure. - pdwResult - Receives one of the following method-supplied constant values: - TTDOWNLOAD_BITMAP Unidrv should download the specified font as bitmaps. - TTDOWNLOAD_DONTCARE Unidrv can select the font format. - TTDOWNLOAD_GRAPHICS Unidrv should print TrueType fonts as graphics, - instead of downloading the font. - TTDOWNLOAD_TTOUTLINE Unidrv should download the specified font as outlines. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::TTDownloadMethod() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -TTYGetInfo( - PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni::TTYGetInfo - - The IPrintOemUni::TTYGetInfo method enables a rendering plug-in - to supply Unidrv with information relevant to text-only printers. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - dwInfoIndex - constant identifying the type of information being requested. - The following constant values are defined: - OEMTTY_INFO_CODEPAGE - The pOutputBuf parameter points to a - DWORD in which the method should return the number of the - code page to be used. - OEMTTY_INFO_MARGINS - The pOutputBuf parameter points to a - RECT structure in which the method should return page margin - widths, in tenths of millimeters (for example, 20 represents 2 mm). - If the entire page is printable, all margin values must be 0. - OEMTTY_INFO_NUM_UFMS - The pOutputBuf parameter points to a - DWORD in which the method should return the number of resource - IDs of the UFMs for 10, 12, and 17 CPI fonts. To actually obtain - these resource IDs, perform a query using OEMTTY_INFO_UFM_IDS. - OEMTTY_INFO_UFM_IDS - The pOutputBuf parameter points to an array - of DWORDs of sufficient size to hold the number of resource IDs of - the UFMs for 10, 12, and 17 CPI fonts. (This number is obtained by - using OEMTTY_INFO_NUM_UFMS in a query.) The method should - return the resource IDs of the UFMs for 10,12, and 17 CPI fonts. - pOutputBuf - pointer to a buffer to receive the requested information. - dwSize - size, in bytes, of the buffer pointed to by pOutputBuf. - pcbcNeeded - pointer to a location to receive the number of bytes written into - the buffer pointed to by pOutputBuf. If the number of bytes required is - smaller than the number specified by dwSize, the method should supply - the required size and return E_FAIL. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::TTYGetInfo() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwInfoIndex); - UNREFERENCED_PARAMETER(pOutputBuf); - UNREFERENCED_PARAMETER(dwSize); - UNREFERENCED_PARAMETER(pcbcNeeded); - - return E_NOTIMPL; -} - -HRESULT __stdcall -COemUni2:: -WritePrinter( - PDEVOBJ pdevobj, - PVOID pBuf, - DWORD cbBuffer, - PDWORD pcbWritten - ) - -/*++ - -Routine Description: - - Implementation of IPrintOemUni2::WritePrinter - - The IPrintOemUni2::WritePrinter method, if supported, enables a - rendering plug-in to capture all output data generated by a Unidrv - driver. If this method is not supported, the output data would - otherwise be sent to the spooler in a call to the spooler's WritePrinter API. - - Please refer to DDK documentation for more details. - -Arguments: - - pdevobj - pointer to a DEVOBJ structure. - pBuf - pointer to the first byte of an array of bytes that contains - the output data generated by the Unidrv driver. - cbBuffer - size, in bytes, of the array pointed to by pBuf. - pcbWritten - pointer to a DWORD value that receives the number - of bytes of data that were successfully sent to the plug-in. - -Return Value: - - S_OK The operation succeeded. - E_FAIL The operation failed. - E_NOTIMPL The method is not implemented. - - ---*/ - -{ - VERBOSE("COemUni2::WritePrinter() entry."); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pBuf); - UNREFERENCED_PARAMETER(cbBuffer); - UNREFERENCED_PARAMETER(pcbWritten); - - return E_NOTIMPL; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class COemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - // - - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef)(THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release)(THIS); - - // *** IClassFactory methods *** - // - STDMETHOD(CreateInstance)(THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer)(THIS_ BOOL bLock); - - - // Constructor - // - COemCF(): m_cRef(1) { }; - - // Destructor - // - ~COemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall -COemCF:: -QueryInterface( - const IID& iid, - void** ppv) -{ - VERBOSE("COemCF::QueryInterface entry."); - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - VERBOSE("COemCF::QueryInterface IID not supported.\r\n"); - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall -COemCF:: -AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall -COemCF:: -Release() -{ - assert(0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - } - return cRef; -} - -// IClassFactory implementation -// -HRESULT __stdcall -COemCF:: -CreateInstance( - IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - VERBOSE("Class factory:Create component."); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - // - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - // Create component. - // - COemUni2* pOemCP = new COemUni2; - if (pOemCP == NULL) - { - return E_OUTOFMEMORY; - } - - // Get the requested interface. - // - HRESULT hr = pOemCP->QueryInterface(iid, ppv); - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pOemCP->Release(); - return hr; -} - -// LockServer -// -HRESULT __stdcall -COemCF:: -LockServer( - BOOL bLock - ) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - return S_OK; -} - - -// -// Registration functions -// - -// -// Can DLL unload now? -// -STDAPI DllCanUnloadNow(void) -{ - VERBOSE("DllCanUnloadNow entry."); - - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE("DllGetClassObject:\tCreate class factory."); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - // - if (clsid != CLSID_OEMRENDER) - { - ERR("DllGetClassObject:\tClass not available!\r\n"); - return CLASS_E_CLASSNOTAVAILABLE; - } - - // Create class factory. - // - COemCF* pFontCF = new COemCF; // Reference count set to 1 in constructor - if (pFontCF == NULL) - { - ERR("DllGetClassObject:\tOut of Memory!\r\n"); - return E_OUTOFMEMORY; - } - - // Get requested interface. - // - HRESULT hrResult = pFontCF->QueryInterface(iid, ppv); - pFontCF->Release(); - - return hrResult; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.h deleted file mode 100644 index 771a42c7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/intrface.h +++ /dev/null @@ -1,283 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.H -// -// -// PURPOSE: Define COM interface for User Mode Printer Customization DLL. -// - -#pragma once - -///////////////////////////////////////////////////////// -// String Literals -///////////////////////////////////////////////////////// - -CONST CHAR NAME_CommandCallback[] = "CommandCallback"; -CONST CHAR NAME_FilterGraphics[] = "FilterGraphics"; - -//////////////////////////////////////////////////////////////////////////////// -// -// COemUni2 -// -// Interface for Unidrv OEM sample rendering module -// -class COemUni2 : public IPrintOemUni2 -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Method for getting the implemented methods. - // Returns S_OK if the given method is implemneted. - // Returns S_FALSE if the given method is notimplemneted. - // - - STDMETHOD(GetImplementedMethod)(THIS_ _In_ PSTR pMethodName); - - // - // Method for OEM to specify DDIs that have been hooked - // - - STDMETHOD(EnableDriver) (THIS_ DWORD DriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded); - - // - // Method to notify OEM plugin that it is no longer required - // - - STDMETHOD(DisableDriver) (THIS); - - // - // Method for OEM plugin to contruct its own PDEV - // - - STDMETHOD(EnablePDEV)(THIS_ PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem); - - // - // Method for OEM to free any resource associated with its PDEV - // - - STDMETHOD(DisablePDEV)(THIS_ PDEVOBJ pdevobj); - - // - // Method for OEM to transfer from old PDEV to new PDEV - // - - STDMETHOD(ResetPDEV)(THIS_ PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo)(THIS_ DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDriverDMS - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(DriverDMS)(THIS_ PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode)(THIS_ DWORD dwMode, - POEMDMPARAM pOemDMParam); - - // - // OEMCommandCallback - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(CommandCallback)(THIS_ PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult); - - // - // OEMImageProcessing - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(ImageProcessing)(THIS_ PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult); - - // - // OEMFilterGraphics - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(FilterGraphics)(THIS_ PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen); - // - // OEMCompression - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(Compression)(THIS_ PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult); - - // - // OEMHalftone - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(HalftonePattern)(THIS_ PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize); - - // - // OEMMemoryUsage - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(MemoryUsage)(THIS_ PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage); - - // - // OEMTTYGetInfo - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(TTYGetInfo)(THIS_ PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded); - - // - // OEMDownloadFontheader - UNIDRV only - // - - STDMETHOD(DownloadFontHeader)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMDownloadCharGlyph - UNIDRV only - // - - STDMETHOD(DownloadCharGlyph)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult); - - // - // OEMTTDownloadMethod - UNIDRV only - // - - STDMETHOD(TTDownloadMethod)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMOutputCharStr - UNIDRV only - // - - STDMETHOD(OutputCharStr)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph); - - // - // OEMSendFontCmd - UNIDRV only - // - - - STDMETHOD(SendFontCmd)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv); - - // - // OEMTextOutAsBitmap - UNIDRV only - // - - STDMETHOD(TextOutAsBitmap)(THIS_ SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix); - - // - // IPrintOemUni2 methods - // - - // - // Method for plugin to hook out spooler's WritePrinter API so it - // can get access to output data Universal driver is generating - // - // At DrvEnablePDEV time, Universal driver will call this function with - // pdevobj = NULL, pBuf = NULL, cbBuffer = 0 to detect if the plugin - // implements this function. Plugin should return S_OK to indicate it is - // implementing this function, or return E_NOTIMPL otherwise. - // - // In pcbWritten, plugins should return the number of bytes written to the - // spooler's WritePrinter function. Zero doesn't carry a special meaning, - // errors must be reported through the returned HRESULT. - // - - STDMETHOD(WritePrinter)(THIS_ PDEVOBJ pdevobj, - PVOID pBuf, - DWORD cbBuffer, - PDWORD pcbWritten); - - - COemUni2(); - ~COemUni2(); - -protected: - LONG m_cRef; - IPrintOemDriverUni* m_pOEMHelp; -}; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/precomp.h deleted file mode 100644 index 89396205..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/precomp.h +++ /dev/null @@ -1,36 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Precomp.h -// -// PURPOSE: Header files that should be in the precompiled header. -// - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -// This should always be included last -#include - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/oemuni/resource.h deleted file mode 100644 index 8e941820..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/oemuni/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by OEMUNI.rc -// - - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/psuirep.ini b/print/OEM Printer Customization Plug-in Samples/C++/psuirep.ini deleted file mode 100644 index 74fbd433..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/psuirep.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=PSUIREP.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/syncset.gpd b/print/OEM Printer Customization Plug-in Samples/C++/syncset.gpd deleted file mode 100644 index 39f7a0e2..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/syncset.gpd +++ /dev/null @@ -1,654 +0,0 @@ -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*ModelName: "OEM CUSTOM SAMPLE SYNC DATA IN UI" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 - -*PrintRate: 8 -*PrintRateUnit: PPM -*PrintRatePPM: 8 - -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l0O" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l1O" - } - } -} -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: UPPER - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l1H" - } - } -} -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: Option1 - *Option: Option1 - { - *Name: "300 x 300 " =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "<1B>%%-12345X" -+ "@PJL COMMENT HP Color LaserJet 5/5M " -+ "Version 0.56<0A>" -+ "@PJL SET RESOLUTION=300<0A>" -+ "@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } - *Option: Option2 - { - *Name: "150 x 150 " =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "<1B>%%-12345X" -+ "@PJL COMMENT HP Color LaserJet 5/5M " -+ "Version 0.56<0A>" -+ "@PJL SET RESOLUTION=150<0A>" -+ "@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } -} - -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *%(9600, 12648) -*% *PrintableArea: PAIR(9600, 12648) - *PrintableArea: PAIR(9564, 12600) -*% *PrintableArea: PAIR(5000,5000) - *PrintableOrigin: PAIR(300, 300) -*% *PrintableOrigin: PAIR(300, 500) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9600->9592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (12648->12640) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9592, 12640) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *%5760 -- 7560 - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5760x7604Y" - } - } - *case: LANDSCAPE_CC90 - { - *%(9720, 12648) - *PrintableArea: PAIR(9760, 12688) - *PrintableOrigin: PAIR(200, 272) - *CursorOrigin: PAIR(200, 12960) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7632x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9540, 16248) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9600->9592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (16248->16240) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9592, 16240) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5760x9864Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9760, 16288) - *PrintableOrigin: PAIR(200, 272) - *CursorOrigin: PAIR(200, 16560) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t9792x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 12000) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (8100->8096) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (12000->11992) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(8096, 11992) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8200, 12080) - *PrintableOrigin: PAIR(240, 280) - *CursorOrigin: PAIR(200, 12360) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9324, 13476) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9324->9320) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (13476->13472) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9320, 13472) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9464, 13516) - *PrintableOrigin: PAIR(220, 272) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (9464->9456) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (13516->13512) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(9456, 13512) -*% Warning: the following printable origin X is adjusted (220->224) so it is divisible by the resolution X scale. - *PrintableOrigin: PAIR(224, 272) - } - } - *CursorOrigin: PAIR(200, 13788) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: A3 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(13428, 19308) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (13428->13424) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (19308->19304) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(13424, 19304) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l27a8c1E<1B>*p0x0Y<1B>*c0t8057x11693Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(13588, 19368) - *PrintableOrigin: PAIR(200, 240) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (13588->13584) so it is divisible by the resolution X scale. - *PrintableArea: PAIR(13584, 19368) - } - } - *CursorOrigin: PAIR(200, 19608) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l27a8c1E<1B>*p0x0Y<1B>*c0t11621x8177Y" - } - } - } - } - *Option: TABLOID - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation - { - *case: PORTRAIT - { -*% *PrintableArea: PAIR(12600, 19800) - *PrintableArea: PAIR(12540, 19740) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (12600->12592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (19800->19792) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(12592, 19792) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l6a8c1E<1B>*p0x0Y<1B>*c0t7560x12000Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(12600, 19800) - *PrintableOrigin: PAIR(300, 300) - *switch: Resolution - { - *case: Option2 - { -*% Warning: the following printable width is adjusted (12600->12592) so it is divisible by the resolution X scale. -*% Warning: the following printable length is adjusted (19800->19792) so it is divisible by the resolution Y scale. - *PrintableArea: PAIR(12592, 19792) -*% Warning: the following printable origin X is adjusted (300->304) so it is divisible by the resolution X scale. -*% Warning: the following printable origin Y is adjusted (300->304) so it is divisible by the resolution Y scale. - *PrintableOrigin: PAIR(304, 304) - } - } - *CursorOrigin: PAIR(200, 20100) - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l6a8c1E<1B>*p0x0Y<1B>*c0t11880x7680Y" - } - } - } - } -} -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: STANDARD - *Option: STANDARD - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.14 - *Cmd: "<1B>&l0M" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.14 - *Cmd: "<1B>&l4M" - } - } -} -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *HelpIndex: 12004 - *DefaultOption: 24bpp - *Option: 24bpp - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 - *Command: CmdEnableDRC { *Cmd : "<1B>*b3M" } - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" %d{PaletteIndexToProgram} -+ "I" } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSetSrcBmpWidth { *Cmd : "<1B>*r" %d{RasterDataWidthInBytes / 3}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<0003080808081B>*v0a0b0c7i255a255b255c0I<1B>*" -+ "o3W<060400>" - } - } -} -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *HelpIndex: 12005 - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%------------------------------------------------------------------------- -*% Duplex -*%------------------------------------------------------------------------- -*Feature: Duplex -{ - *rcNameID: =TWO_SIDED_PRINTING_DISPLAY - *DefaultOption: NONE - *Option: NONE - { - *rcNameID: =NONE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l0S" - } - } - *Option: VERTICAL - { - *rcNameID: =FLIP_ON_LONG_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l1S" - - } - } - *Option: HORIZONTAL - { - *rcNameID: =FLIP_ON_SHORT_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.10 - *Cmd: "<1B>&l2S" - } - } -} - -*%------------------------------------------------------------------------- -*% Installable Option - Duplex Unit -*% IMPORTANT NOTE: The OEM extension assumes that this feature's keyname is -*% "DuplexUnit" and the options are "TRUE" and "FALSE" -*%------------------------------------------------------------------------- -*Feature: DuplexUnit -{ - *Name: "Optional Duplex Unit" *% Duplex Unit - *HelpIndex: 12004 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *Name: "Not Installed" - *DisabledFeatures: LIST(Duplex) - } - *Option: TRUE - { - *Name: "Installed" - } -} - - -*%------------------------------------------------------------------------- -*% Installable Option - Envelope Feeder -*% IMPORTANT NOTE: The OEM extension assumes that this feature's keyname is -*% "EnvFeeder" and the options are "TRUE" and "FALSE" -*%------------------------------------------------------------------------- -*Feature: EnvFeeder -{ - *Name: "Envelope Feeder" - *HelpIndex: 12000 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *Name: "Not Installed" - } - *Option: TRUE - { - *Name: "Installed" - } -} - - -*%------------------------------------------------------------------------- -*% Installable Option - PrinterHardDisk -*% IMPORTANT NOTE: The OEM extension assumes that this feature's keyname is -*% "PrinterHardDisk" and the options are "TRUE" and "FALSE" -*%------------------------------------------------------------------------- -*Feature: PrinterHardDisk -{ - *Name: "Printer Hard-Disk" *% Printer Hard-Disk - *HelpIndex: 12002 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *Name: "Not Installed" - *%*Constraints: LIST(JobRetention.Option2, JobRetention.Option4) - } - *Option: TRUE - { - *Name: "Installed" - } -} - - - -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.5 - *Cmd: "<1B>&u300D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX / 4) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel / 4) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel / 4) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY / 4) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d[1,12600]{max_repeat((DestYRel / 4) )}"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d[1,12600]{max_repeat((DestYRel / 4) )}"Y" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" %d{PaletteIndexToProgram} -+ "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*TTFSEnabled?: TRUE -*DeviceFonts: LIST(134,135,136,137,138,139,140,146,147,148,149,150,151,152,153,154, -+ 155,156,157,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) - -*MinFontID: 16534 -*MaxFontID: 32768 -*FontFormat: HPPCL_OUTLINE -*% When the %f format is implemented we can remove the /100 part of -*% CmdSelectFontHeight and CmdSelectFontWidth -*% NOTE: MasterUnits.x is hardcoded here! -*% NOTE: THIS dividing by 200 because I want to /100 and then /2 for now. -*% The number 60000 may look strange, but it's 1200/2 * 100. -*Command: CmdSelectFontHeight { *Cmd : "<1B>(s" %d{FontHeight}"V" } -*Command: CmdSelectFontWidth { *Cmd : "<1B>(s" %f{1200 / FontWidth}"H" } -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize / 4) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize / 4) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/syncset.ini b/print/OEM Printer Customization Plug-in Samples/C++/syncset.ini deleted file mode 100644 index 11e9f7b0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/syncset.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=SYNCSET.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/themeui.ini b/print/OEM Printer Customization Plug-in Samples/C++/themeui.ini deleted file mode 100644 index c3c9d2c9..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/themeui.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=ThemeUISmpl.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uisamples.inf b/print/OEM Printer Customization Plug-in Samples/C++/uisamples.inf deleted file mode 100644 index 6c07b2c7..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/uisamples.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.gpd b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.gpd deleted file mode 100644 index f376bfe7..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.gpd +++ /dev/null @@ -1,559 +0,0 @@ -*GPDFileName: "uniuirep.gpd" -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*ModelName: "OEM Unidrv Full UI Replacement Sample" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 99 -*PrintRate: 16 -*PrintRateUnit: PPM -*PrintRatePPM: 16 - -*%****************************************************************************************** -*% Orientation -*%****************************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.6 - *Cmd: "<1B>&l0O" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *Cmd: "<1B>&l1O" - } - } -} - -*%****************************************************************************************** -*% Input Bin -*%****************************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: AUTO - *Option: AUTO - { - *rcNameID: =AUTO_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l0H" - } - } - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l1H" - } - } -} - -*%****************************************************************************************** -*% Resolution -*%****************************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: 300dpi - *Option: 600dpi - { - *Name: "600 x 600" =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=600<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t600R" - } - } - *Option: 300dpi - { - *Name: "300 x 300" =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } - *Option: 150dpi - { - *Name: "150 x 150" =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(150, 150) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.7 - *Cmd: "@PJL SET RESOLUTION=150<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t150R" - } - } -} - -*%****************************************************************************************** -*% HP-GL/2 Graphics Support -*%****************************************************************************************** -*Ifdef: WINNT_51 -*Personality: =PERSONALITY_HPGL2 -*Feature: GraphicsMode -{ - *rcNameID: =GRAPHICSMODE_DISPLAY - *DefaultOption: HPGL2MODE - *Option: HPGL2MODE - { - *rcNameID: =GRAPHICSMODE_HPGL2_DISPLAY - } - *Option: RASTERMODE - { - *rcNameID: =GRAPHICSMODE_RASTER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.5 - *Cmd: "@PJL SET LIMAGEENHANCE=OFF<0A>" - } - } -} -*Endif: - -*%****************************************************************************************** -*% Paper Size -*%****************************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5260x7704Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7332x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5880x8900Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t8900x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(288, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(204, 13824) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t4970x7040Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t6780x4970Y" - } - } - } - } -} - -*%****************************************************************************************** -*% Outputbin -*%****************************************************************************************** - - -*Feature: OutputBin -{ - *rcNameID: =OUTPUTBIN_DISPLAY - *HelpIndex: 12006 - *DefaultOption: Option1 - *Option: Option1 - { - *% Auto Select - *Name: "default" - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "@PJL SET OUTBIN=OPTIONALOUTBIN2<0A>@PJL SET FINISH=NONE<0A>" - } - } - *Option: Option14 - { - *% Stacker - *Name: "stacker" *% Stacker - *Command: CmdSelect - { - *Order: DOC_SETUP.4 - *Cmd: "@PJL SET OUTBIN=OPTIONALOUTBIN2<0A>@PJL SET FINISH=NONE<0A>" - } - } -} - - -*%****************************************************************************************** -*% Media Type -*%****************************************************************************************** -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: PLAIN - *Option: PLAIN - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n6WdPlain" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n13WdTransparency" - } - } -} - - - -*%****************************************************************************************** -*% HalfTone -*%****************************************************************************************** -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%****************************************************************************************** -*% Memory -*% -*% Note: Unidrv uses the font memory information to estimate when it needs to stop -*% downloading fonts for a page, and thus driver writers should err on the conservative -*% side. Otherwise, printers will generate "out of memory" device errors for pages with -*% a large number of fonts / unique glyphs. -*%****************************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 32768KB - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } -} - -*%****************************************************************************************** -*% Page Protect -*%****************************************************************************************** -*Feature: PageProtect -{ - *rcNameID: =PAGE_PROTECTION_DISPLAY - *DefaultOption: OFF - *Option: ON - { - *rcNameID: =ON_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=LETTER<0A>" - } - } - *Option: OFF - { - *rcNameID: =OFF_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "<1B>%%-12345X@PJL SET PAGEPROTECT=OFF<0A>" - } - } -} - -*%****************************************************************************************** -*% Doc setup commands -*%****************************************************************************************** -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.7 - *Cmd: "<1B>&u1200D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X@PJL<20>LPORTROTATE<0A><1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.13 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} - -*%****************************************************************************************** -*% Cursor, Page and Color Commands -*%****************************************************************************************** -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT, RASTER, VECTOR) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel) }"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel) }"Y" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*%****************************************************************************************** -*% Font Descriptions and Commands -*%****************************************************************************************** -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*DeviceFonts: LIST(136,138,146,147,148,149,150,151,152,153,154,155,156,157, -+ 163,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) -*MinFontID: 16534 -*MaxFontID: 32768 -*switch: Resolution -{ - *case: 600dpi - { - *FontFormat: HPPCL_OUTLINE - } - *case: 300dpi - { - *FontFormat: HPPCL_OUTLINE - } - *case: 150dpi - { - *FontFormat: HPPCL_RES - } -} -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } - - -*%******************************************************************************************** -*%* Vector Commands. -*%******************************************************************************************** -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.inf b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.inf deleted file mode 100644 index 2dba999f..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.ini b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.ini deleted file mode 100644 index 55701ada..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/res/uniuirep.ini +++ /dev/null @@ -1,3 +0,0 @@ -[OEMFiles] -OEMConfigFile1=UNIUIREP.DLL - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.cpp b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.cpp deleted file mode 100644 index f2663bc0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.cpp +++ /dev/null @@ -1,1991 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: Features.cpp -// -// PURPOSE: Implements wrapper classes for managing the features & -// options supported by the driver. -// -//-------------------------------------------------------------------------- - -#include "precomp.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal Defines and Macros -//////////////////////////////////////////////////////// - -// -// TAG the identifies feature OPTITEM data stuct. -// -#define FEATURE_OPTITEM_TAG 'FETR' - - -//////////////////////////////////////////////////////// -// Type Definitions -//////////////////////////////////////////////////////// -// -// Struct used to identify OPTITEM as feature OPTITEM and to map back -// from an OPTITEM to the feature. -// -typedef struct _tagFeatureOptItemData -{ - DWORD dwSize; - DWORD dwTag; - PCSTR pszFeatureKeyword; - CFeature *pFeature; - -} FEATUREOPTITEMDATA, *PFEATUREOPTITEMDATA; - -// -// Mapping of feature names to keywords -// -static CONST KEYWORDMAP gkmFeatureMap[] = -{ - {"RESDLL", NULL, IDS_RESDLL, OEMCUIP_PRNPROP}, - {"InputBin", TEXT("COMPSTUI.DLL"), IDS_CPSUI_SOURCE, OEMCUIP_DOCPROP}, - {"Orientation", TEXT("COMPSTUI.DLL"), IDS_CPSUI_ORIENTATION, OEMCUIP_DOCPROP}, - {"Resolution", TEXT("COMPSTUI.DLL"), IDS_CPSUI_RESOLUTION, OEMCUIP_DOCPROP}, - {"GraphicsMode", NULL, IDS_GRAPHICS_MODE, OEMCUIP_DOCPROP}, - {"PaperSize", TEXT("COMPSTUI.DLL"), IDS_CPSUI_FORMNAME, OEMCUIP_DOCPROP}, - {"MediaType", TEXT("COMPSTUI.DLL"), IDS_CPSUI_MEDIA, OEMCUIP_DOCPROP}, - {"ColorMode", TEXT("COMPSTUI.DLL"), IDS_CPSUI_COLOR_APPERANCE, OEMCUIP_DOCPROP}, - {"Halftone", TEXT("COMPSTUI.DLL"), IDS_CPSUI_HALFTONE, OEMCUIP_DOCPROP}, - {"DuplexUnit", NULL, IDS_DUPLEX_UNIT, OEMCUIP_PRNPROP}, - {"Duplex", TEXT("COMPSTUI.DLL"), IDS_CPSUI_DUPLEX, OEMCUIP_DOCPROP}, - {"Memory", NULL, IDS_INSTALLED_MEMORY, OEMCUIP_PRNPROP}, - {"OutputBin", TEXT("COMPSTUI.DLL"), IDS_CPSUI_OUTPUTBIN, OEMCUIP_DOCPROP}, - {"PageProtect", TEXT("COMPSTUI.DLL"), IDS_CPSUI_PAGEPROTECT, OEMCUIP_PRNPROP}, - {"%PagePerSheet", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP, OEMCUIP_DOCPROP}, - {"%PageOrder", TEXT("COMPSTUI.DLL"), IDS_CPSUI_PAGEORDER, OEMCUIP_DOCPROP}, - {"%PagesPerSheetOrdering", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_DIRECTION, OEMCUIP_DOCPROP}, - {"%PagesPerSheetBorder", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_BORDER, OEMCUIP_DOCPROP}, - {"%TextAsGraphics", NULL, IDS_TEXT_ASGRX, OEMCUIP_DOCPROP}, - {"%MetafileSpooling", NULL, IDS_METAFILE_SPOOLING, OEMCUIP_DOCPROP} -}; - -// -// Number of elements in the feature map table. -// -static const NUM_FEATURE_MAP = (sizeof(gkmFeatureMap)/sizeof(gkmFeatureMap[0])); - -// -// Mapping of option names to resources. A more complete driver would parse -// this mapping from the GDL file, rather than use hard-coded mappings. -// -static CONST KEYWORDMAP gkmOptionMap[] = -{ - {"ON", TEXT("COMPSTUI.DLL"), IDS_CPSUI_ON, 0}, - {"OFF", TEXT("COMPSTUI.DLL"), IDS_CPSUI_OFF, 0}, - {"NONE", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NONE, 0}, - {"None", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NONE, 0}, - {"True", TEXT("COMPSTUI.DLL"), IDS_CPSUI_TRUE, 0}, - {"False", TEXT("COMPSTUI.DLL"), IDS_CPSUI_FALSE, 0,}, - {"PORTRAIT", TEXT("COMPSTUI.DLL"), IDS_CPSUI_PORTRAIT, 0}, - {"LANDSCAPE", TEXT("COMPSTUI.DLL"), IDS_CPSUI_LANDSCAPE, 0}, - {"LANDSCAPE_CC90", TEXT("COMPSTUI.DLL"), IDS_CPSUI_ROT_LAND, 0}, - {"FORMSOURCE", TEXT("COMPSTUI.DLL"), IDS_CPSUI_FORMSOURCE, 0}, - {"UPPER", TEXT("COMPSTUI.DLL"), IDS_CPSUI_UPPER_TRAY, 0}, - {"AUTO", TEXT("COMPSTUI.DLL"), IDS_CPSUI_PRINTFLDSETTING, 0}, - {"Auto", TEXT("COMPSTUI.DLL"), IDS_CPSUI_PRINTFLDSETTING, 0}, - {"PLAIN", TEXT("COMPSTUI.DLL"), IDS_CPSUI_STANDARD, 0}, - {"TRANSPARENCY", TEXT("COMPSTUI.DLL"), IDS_CPSUI_TRANSPARENCY, 0}, - {"HORIZONTAL", TEXT("COMPSTUI.DLL"), IDS_CPSUI_HORIZONTAL, 0}, - {"VERTICAL", TEXT("COMPSTUI.DLL"), IDS_CPSUI_VERTICAL, 0}, - {"FrontToBack", TEXT("COMPSTUI.DLL"), IDS_CPSUI_FRONTTOBACK, 0}, - {"BackToFront", TEXT("COMPSTUI.DLL"), IDS_CPSUI_BACKTOFRONT, 0}, - {"1", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_NORMAL, 0}, - {"2", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_TWOUP, 0}, - {"4", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_FOURUP, 0}, - {"6", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_SIXUP, 0}, - {"9", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_NINEUP, 0}, - {"16", TEXT("COMPSTUI.DLL"), IDS_CPSUI_NUP_SIXTEENUP, 0}, - {"Booklet", TEXT("COMPSTUI.DLL"), IDS_CPSUI_BOOKLET, 0}, - {"RightThenDown", TEXT("COMPSTUI.DLL"), IDS_CPSUI_RIGHT_THEN_DOWN, 0}, - {"DownThenRight", TEXT("COMPSTUI.DLL"), IDS_CPSUI_DOWN_THEN_RIGHT, 0}, - {"LeftThenDown", TEXT("COMPSTUI.DLL"), IDS_CPSUI_LEFT_THEN_DOWN, 0}, - {"DownThenLeft", TEXT("COMPSTUI.DLL"), IDS_CPSUI_DOWN_THEN_LEFT, 0}, - {"UniresDLL", NULL, IDS_UNIRESDLL, 0}, - {"600dpi", NULL, IDS_RESOLUTION_600_DPI, 0}, - {"300dpi", NULL, IDS_RESOLUTION_300_DPI, 0}, - {"150dpi", NULL, IDS_RESOLUTION_150_DPI, 0}, - {"RASTERMODE", NULL, IDS_RASTERMODE, 0}, - {"HPGL2MODE", NULL, IDS_HPGL2MODE, 0}, - {"LETTER", NULL, IDS_PAPERSIZE_LETTER, 0}, - {"LEGAL", NULL, IDS_PAPERSIZE_LEGAL, 0}, - {"EXECUTIVE", NULL, IDS_PAPERSIZE_EXECUTIVE, 0}, - {"A4", NULL, IDS_PAPERSIZE_A4, 0}, - {"B5", NULL, IDS_PAPERSIZE_B5, 0}, - {"Mono", NULL, IDS_COLORMODE_MONO, 0}, - {"Color", TEXT("COMPSTUI.DLL"), IDS_CPSUI_COLOR_APPERANCE, 0}, - {"24bpp", NULL, IDS_COLORMODE_24BPP, 0}, - {"8bpp", NULL, IDS_COLORMODE_8BPP, 0}, - {"HT_PATSIZE_AUTO", NULL, IDS_HALFTONE_AUTO, 0}, - {"HT_PATSIZE_SUPERCELL_M", NULL, IDS_HALFTONE_SUPERCELL_M, 0}, - {"HT_PATSIZE_6x6_M", NULL, IDS_HALFTONE_6x6_M, 0}, - {"HT_PATSIZE_8x8_M", NULL, IDS_HALFTONE_8x8_M, 0}, - {"Option1", NULL, IDS_OUTBIN_DEFAULT, 0}, - {"Option14", NULL, IDS_OUTBIN_STACKER, 0}, - {"EnvTray", NULL, IDS_UIREP_ENVTRAY, 0}, - {"Automatic", NULL, IDS_TTDL_DEFAULT, 0}, - {"Outline", NULL, IDS_TTDL_TYPE1, 0}, - {"Bitmap", NULL, IDS_TTDL_TYPE3, 0}, - {"NativeTrueType", NULL, IDS_TTDL_TYPE42, 0}, - {"16384KB", NULL, IDS_MEMORY_STD, 0}, - {"32768KB", NULL, IDS_MEMORY_UPGRADE, 0} -}; - -// -// Number of elements in the option map table. -// -static const NUM_OPTION_MAP = (sizeof(gkmOptionMap)/sizeof(gkmOptionMap[0])); - -// -// Fall-back mapping for any feature or option that doesn't -// have a pre-defined display name. -// -KEYWORDMAP gDefaultMapping = {"", NULL, IDS_MISSINGNAME, OEMCUIP_DOCPROP}; - - -//+--------------------------------------------------------------------------- -// -// Member: -// COption::Acquire -// -// Synopsis: -// Load the option information as described in the mapping. -// -// -//---------------------------------------------------------------------------- -HRESULT -COption::Acquire( - HANDLE hHeap, - PCKEYWORDMAP pMapping - ) -{ - m_pMapping = pMapping; - m_hHeap = hHeap; - - return GetDisplayNameFromMapping(hHeap, m_pMapping, &m_pszDisplayName); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeaturePairs::ClearPair( -// -// Synopsis: -// Remove a feature-option pair entry from the set of feature / option -// pairs. -// -// -//---------------------------------------------------------------------------- -VOID -CFeaturePairs::ClearPair( - size_t iIndex - // Index of the feature-option pair to be removed. - ) -{ - if (m_pData[iIndex].pszFeature) - { - free((VOID*)m_pData[iIndex].pszFeature); - m_pData[iIndex].pszFeature = NULL; - } - - if (m_pData[iIndex].pszOption) - { - free((VOID*)m_pData[iIndex].pszOption); - m_pData[iIndex].pszOption = NULL; - } -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeaturePairs Constructor -// -// Synopsis: -// Create a feature-pairs object containing cElements entries, and -// initialize them all to NULL. -// -// -//---------------------------------------------------------------------------- -CFeaturePairs::CFeaturePairs( - size_t cElements - // number of elements to remove. - ) -{ - m_pData = NULL; - size_t cbFeatureOptions = 0; - m_cElements = 0; - - if (SUCCEEDED(SizeTMult(cElements, sizeof(PRINT_FEATURE_OPTION), &cbFeatureOptions))) - { - m_pData = new PRINT_FEATURE_OPTION[cElements]; - - if (m_pData) - { - m_cElements = cElements; - memset(m_pData, 0, cbFeatureOptions); - } - } -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeaturePairs destructor -// -// Synopsis: -// Release any memory used by this object -// -// -//---------------------------------------------------------------------------- -CFeaturePairs::~CFeaturePairs() -{ - if (m_pData) - { - for (size_t iPair = 0; iPair < m_cElements; iPair++) - { - ClearPair(iPair); - } - - delete m_pData; - } -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeaturePairs::SetPair -// -// Synopsis: -// Set the pair at the specified index to the specified value. Each -// pair represents a feature and a currently selected option for that -// feature. -// -// Returns: -// S_OK -// E_OUTOFMEMORY -// E_INVALIDARG if the index is out of of bounds. -// -// -//---------------------------------------------------------------------------- -HRESULT -CFeaturePairs::SetPair( - size_t iIndex, - // Index of the entry to set. - PCSTR pcszFeature, - // The name of the feature. This doesn't - // hold a pointer to the string passed in. - PCSTR pcszOption - // The name of the option. This doesn't - // hold a pointer to the string passed in. - ) -{ - - if (iIndex > m_cElements || !pcszFeature || !pcszOption) - { - return E_INVALIDARG; - } - - // - // Deferred error result from failed constructor... - // - if (!m_pData) - { - return E_OUTOFMEMORY; - } - - // - // Configure the data elements - // - m_pData[iIndex].pszFeature = new CHAR[strlen(pcszFeature)+1]; - m_pData[iIndex].pszOption = new CHAR[strlen(pcszOption)+1]; - - if (m_pData[iIndex].pszFeature && m_pData[iIndex].pszOption) - { - memcpy((PSTR)m_pData[iIndex].pszFeature, pcszFeature, (strlen(pcszFeature)+1)); - memcpy((PSTR)m_pData[iIndex].pszOption, pcszOption, (strlen(pcszOption)+1)); - return S_OK; - } - else - { - return E_OUTOFMEMORY; - } -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature::Clear -// -// Synopsis: -// Reset the option collection information to it's state before otions -// were acquired. -// -// -//---------------------------------------------------------------------------- - -VOID -CFeature::Clear() -{ - if (m_pOptions != NULL) - { - delete [] m_pOptions; - m_pOptions = NULL; - } - - if (m_pszDisplayName != NULL && !IS_INTRESOURCE(m_pszDisplayName)) - { - HeapFree(m_hHeap, 0, m_pszDisplayName); - } - - m_dwOptions = 0; - m_Sel = 0; - m_pszFeature = NULL; - m_hHeap = NULL; - m_pOptions = NULL; - m_pMapping = &gDefaultMapping; - m_pszDisplayName = NULL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature (constructor) -// -// Synopsis: -// Initialize the option collection to a default state. Does -// not acquire the options from the GPD / helper. -// -// -//---------------------------------------------------------------------------- -CFeature::CFeature() : - m_dwOptions(0), - m_Sel(0), - m_pszFeature(NULL), - m_hHeap(NULL), - m_pOptions(NULL), - m_pMapping(&gDefaultMapping), - m_pszDisplayName(NULL) -{ -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature (destructor) -// -// Synopsis: -// Clean up any memory we're holding. -// -// -//---------------------------------------------------------------------------- -CFeature::~CFeature() -{ - Clear(); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature::Acquire -// -// Synopsis: -// Populate the options in the collection using the -// supplied helper to acquire options for the specified -// feature. -// -// Returns: -// S_OK on success, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT -CFeature::Acquire( - _In_ HANDLE hHeap, - // The heap to make allocations from - _In_ IPrintCoreHelper* pHelper, - // Pointer to the Unidrv supplied helper object - _In_ PCSTR pszFeature - // The name of the feature to read settings for. - ) -{ - VERBOSE(DLLTEXT("CFeature::Acquire entry.")); - - HRESULT hrResult = S_OK; - PCSTR *ppszOptions = NULL; - - // - // Don't retreive the Options again if we already got them. - // - if ((m_dwOptions > 0) && - (m_pszFeature != NULL) && - !lstrcmpA(m_pszFeature, pszFeature)) - { - WARNING(DLLTEXT("CFeature::Acquire: Already have options for feature %hs. Returning S_OK.\r\n"), m_pszFeature); - return S_OK; - } - - // - // Save the heap handle for use later, such as freeing memory at destruction. - // - m_hHeap = hHeap; - - // - // Store Keyword string. - // - m_pszFeature = pszFeature; - - // - // Get or build a keyword mapping entry that - // maps from keyword to info such as display name & - // whether the feature is a device setting or document - // setting. - // - m_pMapping = GetKeywordMapping(gkmFeatureMap, NUM_FEATURE_MAP, pszFeature); - - // - // Get the display name for this feature - // - hrResult = GetDisplayNameFromMapping(hHeap, m_pMapping, &m_pszDisplayName); - - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("CFeature::Acquire: Failed to get display name for feature %hs with error code 0x%x!\r\n"), - pszFeature, - hrResult); - goto Exit; - } - - // - // Enumerate Options. - // - hrResult = pHelper->EnumOptions(m_pszFeature, - &ppszOptions, - &m_dwOptions - ); - - // - // Make sure we got the option list. - // Can't do anything more with out it. - // - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("CFeature::Acquire: Failed to enumerate options for feature %hs. (hrResult = 0x%x)\r\n"), m_pszFeature, hrResult); - goto Exit; - } - - // - // Build COption - // - m_pOptions = new COption[m_dwOptions]; - - if (m_pOptions == NULL) - { - ERR(ERRORTEXT("COption::Acquire: Failed to allocate memory for option info array!\r\n")); - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // - // For each option, build and/or get useful info like display name etc. - // - for (DWORD dwIndex = 0; dwIndex < m_dwOptions; dwIndex++) - { - PCKEYWORDMAP pMapping = - GetKeywordMapping(gkmOptionMap, NUM_OPTION_MAP, ppszOptions[dwIndex]); - - // - // Get or build a keyword mapping entry that - // maps from keyword to info such as display name, - // icon, option type etc. which we can't get from - // the helper interface - // - hrResult = m_pOptions[dwIndex].Acquire(m_hHeap, - pMapping); - - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("CFeature::Acquire: Failed to load information for option %hs of feature %hs with error code 0x%x!\r\n"), - ppszOptions[dwIndex], - m_pszFeature, - hrResult); - goto Exit; - } - } - - // - // Get current option selection. - // - if(SUCCEEDED(hrResult) && m_dwOptions > 0) - { - hrResult = RefreshSelection(pHelper); - } - -Exit: - - // - // Cleanup if weren't successful - // - if (!SUCCEEDED(hrResult)) - { - Clear(); - } - - return hrResult; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature::GetOption -// -// Synopsis: -// Get a reference to the description of the option at the specified index. -// -// Returns: -// A pointer to the requested option if available, otherwise NULL. -// -// -//---------------------------------------------------------------------------- -CONST COption * -CFeature::GetOption( - DWORD dwIndex - // Index of the option for which the display name is requested. - ) const -{ - VERBOSE(DLLTEXT("CFeature::GetOption entry.")); - - if ((dwIndex >= m_dwOptions) || (m_pOptions == NULL)) - { - ERR(ERRORTEXT("CFeature::GetOption: Invalid parameters!\r\n")); - return NULL; - } - - return &(m_pOptions[dwIndex]); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature::FindOption -// -// Synopsis: -// Find the index of the option with the specified keyword. If no such -// option exists, this routine returns the specified result instead. -// -// -//---------------------------------------------------------------------------- -_Success_(return != FALSE) BOOL -CFeature::FindOption( - _In_ PCSTR pszOption, - // The name of the option to look for - _Out_ DWORD *pdwOption - // The index of the default option to use if the name isn't found - ) const -{ - VERBOSE(DLLTEXT("CFeature::FindOption entry.")); - - BOOL bFound = FALSE; - - // - // Validate parameters - // - if (pszOption == NULL || - pdwOption == NULL) - { - return FALSE; - } - - // - // Walk the option keyword looking for a match. - // - for(DWORD dwIndex = 0; !bFound && (dwIndex < m_dwOptions); dwIndex++) - { - bFound = !lstrcmpA(pszOption, m_pOptions[dwIndex].GetKeyword()); - - if(bFound) - { - *pdwOption = dwIndex; - } - } - - return bFound; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature::InitOptItem -// -// Synopsis: -// Configure the provided OPTITEM with the options in this collection. -// -// Returns: -// -// Notes: -// -// -//---------------------------------------------------------------------------- -HRESULT -CFeature::InitOptItem( - _In_ HANDLE hHeap, - // The heap to allocate memory from. - _Inout_ POPTITEM pOptItem - // The optitem struct being initialized. - ) -{ - VERBOSE(DLLTEXT("CFeature::InitOptItem entry.")); - - HRESULT hrResult = S_OK; - - // - // Add feature OPTITEM data to OPTITEM to facilitate saving - // selection changes - // - PFEATUREOPTITEMDATA pData = - (PFEATUREOPTITEMDATA)HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(FEATUREOPTITEMDATA)); - - if (pData == NULL) - { - ERR(ERRORTEXT("CFeatureCollection::InitOptItem: Failed to allocated memory for feature OPTITEM data.")); - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // - // Configure the callback data structure - // - pData->dwSize = sizeof(FEATUREOPTITEMDATA); - pData->dwTag = FEATURE_OPTITEM_TAG; - pData->pszFeatureKeyword = this->GetKeyword(); - pData->pFeature = this; - - // - // Configure the optitem - // - pOptItem->UserData = (ULONG_PTR)pData; - pOptItem->pName = const_cast(this->GetDisplayName()); - pOptItem->Sel = m_Sel; - - // - // If there's only 1 option, mark the feature as disabled. - // - if (GetCount() > 1) - { - pOptItem->Flags = 0; - } - else - { - pOptItem->Flags |= OPTIF_DISABLED; - } - - // - // Only create options if there are options defined - // for this feature. - // - if (GetCount() > 0) - { - // - // Allocate memory for feature options. - // - pOptItem->pOptType = CreateOptType(hHeap, (WORD)GetCount()); - - if (pOptItem->pOptType == NULL) - { - ERR(ERRORTEXT("CFeature::InitOptItem: Failed to allocate OPTTYPEs for OPTITEM %hs!\r\n"), - this->GetKeyword()); - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // - // Set OPTTYPE type & display string for each OPTPARAM in the ot - // - pOptItem->pOptType->Type = TVOT_COMBOBOX; - - for (DWORD dwIndex = 0; dwIndex < GetCount(); dwIndex++) - { - pOptItem->pOptType->pOptParam[dwIndex].pData = const_cast(this->GetOption(dwIndex)->GetDisplayName()); - } - } - -Exit: - - return hrResult; - -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeature::RefreshSelection -// -// Synopsis: -// Synchronize the currently selected option with the option -// that Unidrvui recognizes as being selected. -// -// Returns: -// S_OK on success, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT -CFeature::RefreshSelection( - _In_ IPrintCoreHelper *pHelper - // Pointer to the Unidrv supplied helper object - ) -{ - VERBOSE(DLLTEXT("CFeature::RefreshSelection entry.")); - - PCSTR pszSel = NULL; - HRESULT hrResult = S_OK; - - // - // Get current option selection. - // - hrResult = pHelper->GetOption(NULL, 0, m_pszFeature, &pszSel); - - if(SUCCEEDED(hrResult)) - { - if (!FindOption(pszSel, &m_Sel)) - { - // - // The option name should always match something in the option - // array. If for some reason that's not the case, default - // back to option 0. - // - WARNING(ERRORTEXT("CFeature::RefreshSelection: Failed to find selected option!\r\n")); - m_Sel = 0; - } - } - else if(hrResult == E_FAIL) - { - // - // GetOption fails with E_FAIL when trying to read document- - // sticky options if the printer preferences is being shown. - // Hide the error & default the selection. The feature won't - // be shown in the UI. - // - m_Sel = 0; - hrResult = S_OK; - } - - return hrResult; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeatureCollection::Clear -// -// Synopsis: -// Release any memory associated with this feature collection and reset -// values to defaults. -// -// -//---------------------------------------------------------------------------- -VOID -CFeatureCollection::Clear() -{ - // - // feature info array allocated with new so - // that each of the constructors for CFeature - // will be called. - // - if (m_pFeatures) - { - delete [] m_pFeatures; - } - - // - // Re-initialize - // - m_dwFeatures = 0; - m_dwDocFeatures = 0; - m_dwPrintFeatures = 0; - m_hHeap = NULL; - m_pFeatures = NULL; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeatureCollection::GetModelessIndex -// -// Synopsis: -// Get the absolute index of the feature, assuming the index provided is -// for the specified mode. This if there are three features, -// -// DocFeature1 -// DocFeature2 -// PrinterFeature1 -// -// If this routine is called with index 0, and mode OEMCUIP_PRNPROP, -// it will return the absolute index of the first printer-sticky feature, -// which in this case would be 2 (remember, the first index is 0). -// -// -//---------------------------------------------------------------------------- -DWORD -CFeatureCollection::GetModelessIndex( - DWORD dwIndex, - // The index relative to the specified mode. - DWORD dwMode - // The mode for which the index applies. See synopsis above for - // a more detailed explanation of mode. - ) const -{ - DWORD dwCount = 0; - - switch(dwMode) - { - // - // Number of features, all modes - // - case 0: - dwCount = dwIndex; - break; - - case OEMCUIP_DOCPROP: - case OEMCUIP_PRNPROP: - // - // Walk the feature list looking for the nth feature - // with matching mode - // - for (dwCount = 0; dwCount < m_dwFeatures; dwCount++) - { - // - // Count down to the feature we want - // Only countdown for matching modes - // - if (dwMode == m_pFeatures[dwCount].GetMode()) - { - if (dwIndex == 0) - { - break; - } - else - { - --dwIndex; - } - } - } - break; - } - - return dwCount; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeatureCollection (constructor) -// -// Synopsis: -// -// -//---------------------------------------------------------------------------- -CFeatureCollection::CFeatureCollection() : - m_dwFeatures(0), - m_dwDocFeatures(0), - m_dwPrintFeatures(0), - m_hHeap(NULL), - m_pFeatures(NULL) -{ -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeatureCollection (destructor) -// -// Synopsis: -// Release all resources held by this object -// -// -//---------------------------------------------------------------------------- -CFeatureCollection::~CFeatureCollection() -{ - // - // Clean up class. - // - Clear(); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeatureCollection::Acquire -// -// Synopsis: -// Load all of the features supported by unidrv as well as those specified -// in the GPD using the provided helper object -// -// Returns: -// S_OK on success else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT -CFeatureCollection::Acquire( - HANDLE hHeap, - // The heap from which any allocations should be made - IPrintCoreHelper *pHelper - // The helper object that provides access to the core driver features. - ) -{ - VERBOSE(DLLTEXT("CFeatureCollection::Acquire entry.")); - - HRESULT hrResult = S_OK; - - PCSTR *ppszKeywords = NULL; - // String list that points to each feature keyword - - // - // Don't retreive the Features again if we already got them. - // - if (m_dwFeatures > 0) - { - WARNING(DLLTEXT("CFeatureCollection::Acquire: Features have already been enumerated. Returning S_OK.\r\n")); - return S_OK; - } - - // Save the heap handle for use later, such as freeing memory at destruction. - m_hHeap = hHeap; - - // Enumerate features. - hrResult = pHelper->EnumFeatures(&ppszKeywords, &m_dwFeatures); - - if (FAILED(hrResult)) - { - ERR(ERRORTEXT("CFeatureCollection::Acquire() failed to enumerate features. (hrResult = 0x%x)\r\n"), hrResult); - } - else - { - // - // Build Feature information - // - m_pFeatures = new CFeature[m_dwFeatures]; - - if (m_pFeatures == NULL) - { - ERR(ERRORTEXT("CFeatureCollection::Acquire: Failed to allocate feature info array!\r\n")); - hrResult = E_OUTOFMEMORY; - } - - // - // For each feature, build/get feature info - // - for (DWORD dwIndex = 0; SUCCEEDED(hrResult) && dwIndex < m_dwFeatures ; dwIndex++) - { - // - // Get options for each feature - // Note: Some features don't have options, the HRESULT will be E_NOTIMPL for these - // - hrResult = m_pFeatures[dwIndex].Acquire(hHeap, - pHelper, - ppszKeywords[dwIndex]); - - if (!SUCCEEDED(hrResult) && (hrResult != E_NOTIMPL)) - { - ERR(ERRORTEXT("CFeatureCollection::Acquire: Failed to get options for feature %hs with error code 0x%x!\r\n"), - ppszKeywords[dwIndex], - hrResult); - } - - // - // Keep track of mode counts - // - if (SUCCEEDED(hrResult)) - { - switch(m_pFeatures[dwIndex].GetMode()) - { - case OEMCUIP_DOCPROP: - ++m_dwDocFeatures; - break; - - case OEMCUIP_PRNPROP: - ++m_dwPrintFeatures; - break; - - default: - ERR(ERRORTEXT("CFeatureCollection::Acquire: Unknown stickiness for feature %hs!\r\n"), - ppszKeywords[dwIndex]); - break; - } - } - } - } - - // - // Clean up if we weren't successful - // - if (FAILED(hrResult)) - { - Clear(); - } - - return hrResult; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeatureCollection::GetCount -// -// Synopsis: -// Get the number of features in the collection. -// -// -//---------------------------------------------------------------------------- -DWORD -CFeatureCollection::GetCount( - DWORD dwMode - // Should this routine count the doc-sticky features, printer sticky - // features, or both? - ) CONST -{ - DWORD dwCount = 0; - - switch(dwMode) - { - case 0: - dwCount = m_dwFeatures; - break; - - case OEMCUIP_DOCPROP: - dwCount = m_dwDocFeatures; - break; - - case OEMCUIP_PRNPROP: - dwCount = m_dwPrintFeatures; - break; - } - - return dwCount; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// CFeatureCollection::GetFeature -// -// Synopsis: -// Get the options for the feature at the specified index. -// -// -//---------------------------------------------------------------------------- -CFeature* -CFeatureCollection::GetFeature( - DWORD dwIndex, - // The index of the feature to look up. - DWORD dwMode - // The mode associated with the feature index. - ) const -{ - // - // Validate parameters - // - if ((dwIndex >= GetCount(dwMode)) || (m_pFeatures == NULL)) - { - return NULL; - } - - // - // Get internal index - // - dwIndex = GetModelessIndex(dwIndex, dwMode); - - // - // Return options pointer - // - return &(m_pFeatures[dwIndex]); -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::GetDisplayNameFromMapping -// -// Synopsis: -// Load the string resource associated with the specified mapping entry. -// -// Returns: -// S_OK on success, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT -GetDisplayNameFromMapping( - _In_ HANDLE hHeap, - // The heap to perform allocations from - _In_ PCKEYWORDMAP pMapping, - // The mapping element for the element. Could be a feature or option. - _Out_ PWSTR *ppszDisplayName - // The location where this routine supplies the display name to the - // caller. - ) -{ - HMODULE hModule = NULL; - HRESULT hrResult = S_OK; - - VERBOSE(DLLTEXT("GetDisplayNameFromMapping entry.")); - - if ((hHeap == NULL) || (pMapping == NULL) || (ppszDisplayName == NULL)) - { - return E_INVALIDARG; - } - - // - // Check for simple case of returning INT resource - // - if (pMapping->pwszModule == NULL) - { - // - // Just need to do MAKEINTRESOURCE on the resource ID and return - // - *ppszDisplayName = MAKEINTRESOURCE(pMapping->uDisplayNameID); - } - else - { - // - // We need to get the module name if we aren't loading the - // resource from this module (pwszModule != NULL). As an - // optimization, we assume that the module has already been loaded, - // since the only cases currently are this module, driver ui and compstui.dll. - // - hModule = GetModuleHandle(pMapping->pwszModule); - - if (hModule == NULL) - { - DWORD dwError = GetLastError(); - - ERR(ERRORTEXT("GetDisplayNameFromMapping: Failed to load module %s with error code %d!\r\n"), - pMapping->pwszModule, - dwError); - - hrResult = HRESULT_FROM_WIN32(dwError); - - // - // In case last error wasn't set correctly, force it to an error value. - // - if (SUCCEEDED(hrResult)) - { - hrResult = E_FAIL; - } - } - - // - // Get the string resource - // - if (SUCCEEDED(hrResult)) - { - hrResult = GetStringResource(hHeap, hModule, pMapping->uDisplayNameID, ppszDisplayName); - if (FAILED(hrResult)) - { - ERR(ERRORTEXT("GetDisplayNameFromMapping: Failed to load string with error code 0x%x!\r\n"), hrResult); - } - } - } - - return hrResult; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// ::GetKeywordMapping -// -// Synopsis: -// Find the mapping in the provided table associated with the specified -// keyword. This routine can be used to look up both feature & option -// mappings. -// -// Returns: -// The requested mapping on success, otherwise NULL. -// -// -//---------------------------------------------------------------------------- -PCKEYWORDMAP -GetKeywordMapping( - _In_reads_(dwMapSize) PCKEYWORDMAP pKeywordMap, - // The mapping table to search in - DWORD dwMapSize, - // Number of elements in the mapping table. - PCSTR pszKeyword - // Keyword to look for in the table. - ) -{ - BOOL bFound = FALSE; - PCKEYWORDMAP pMapping = &gDefaultMapping; - - if ((pKeywordMap != NULL) && (pszKeyword != NULL)) - { - // - // Walk mapping array for matching keyword - // - for (DWORD dwIndex = 0; !bFound && (dwIndex < dwMapSize); dwIndex++) - { - bFound = !lstrcmpA(pszKeyword, pKeywordMap[dwIndex].pszKeyword); - - if (bFound) - { - pMapping = pKeywordMap + dwIndex; - } - } - } - - return pMapping; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// ::IsFeatureOptItem -// -// Synopsis: -// Test if an OPTITEM is an OPTITEM for a feature. -// -// Returns: -// TRUE if the OPTITEM represents a feature, else FALSE. -// -// -//---------------------------------------------------------------------------- -BOOL -IsFeatureOptItem( - POPTITEM pOptItem - // The otitem to check - ) -{ - BOOL bRet = FALSE; - PFEATUREOPTITEMDATA pData = NULL; - - - // Make sure pointers are NULL. - if( (NULL == pOptItem) - || - (NULL == pOptItem->UserData) - ) - { - // - // INVARIANT: can't be feature OPTITEM, since one of - // the necessary pointer are NULL. - // - - return FALSE; - } - - // For convienience, assign to pointer to feature OPTITEM data. - pData = (PFEATUREOPTITEMDATA)(pOptItem->UserData); - - // Check size and tag. - bRet = (sizeof(FEATUREOPTITEMDATA) == pData->dwSize) - && - (FEATURE_OPTITEM_TAG == pData->dwTag); - - return bRet; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::SaveFeatureOptItems -// -// Synopsis: -// Walks array of OPTITEMs saving each feature OPTITEM -// that has changed. -// -// Returns: -// S_OK on success, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT -SaveFeatureOptItems( - HANDLE hHeap, - // The heap to perform allocations from - IPrintCoreHelper* pHelper, - // Pointer to the Unidrv supplied helper object - HWND hWnd, - // The current window object. Used as the parent of any model dialogs / - // message boxes displayed from this routine. - _In_reads_(dwItems) POPTITEM pOptItem, - // The option items to save - DWORD dwItems - // The number of optitems in the array - ) -{ - VERBOSE(DLLTEXT("SaveFeatureOptItems entry.")); - - DWORD dwPairsWritten = 0; - DWORD dwResult = 0; - HRESULT hrResult = S_OK; - CFeaturePairs *pPairs = NULL; - - // - // Validate parameters - // - if (!(hHeap && pHelper && pOptItem)) - { - ERR(ERRORTEXT("SaveFeatureOptItems: Invalid arguments!\r\n")); - return E_INVALIDARG; - } - - // - // Get feature option pairs to save - // - hrResult = GetChangedFeatureOptions(pOptItem, dwItems, &pPairs); - - if(FAILED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems: Failed to get changed feature option pairs! (error code 0x%x)\r\n"), - hrResult); - } - - // - // Only update options if something changed. - // - if (SUCCEEDED(hrResult) && - pPairs && - pPairs->GetElementCount() > 0) - { - - // - // Set the change feature options. - // For the first SetOptions() call, don't have the - // core driver UI resolve conflicts, so we can - // prompt user for automatic resolution or let - // them do the conflict resolving. - // - hrResult = pHelper->SetOptions(NULL, - 0, - FALSE, - pPairs->GetData(), - (DWORD)pPairs->GetElementCount(), - &dwPairsWritten, - &dwResult); - - if(FAILED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems: SetOptions failed with dwResult = %d! (hrResult = 0x%x)\r\n"), - dwResult, - hrResult); - } - else if(SETOPTIONS_RESULT_CONFLICT_REMAINED == dwResult) - { - // - // SetOptions succeeded, but there was a conflict in the selected - // options that was not resolved. Ask the user if they'd like the - // plug-in to resolve the conflict for them. - // - int nRet; - CONST PRINT_FEATURE_OPTION *pConflicts; - DWORD dwConflicts; - PWSTR pszMessage = NULL; - - hrResult = GetStringResource(hHeap, ghInstance, IDS_CONSTRAINT_CONFLICT, &pszMessage); - if(FAILED(hrResult)) - { - ERR(ERRORTEXT("SaveFeatureOptItems: Failed to load conflict resource string (error code 0x%x)\r\n"), - hrResult); - } - - // - // INVARIANT: constraint conflict, options weren't saved. - // - // Get list of all features that have conflict. - // - if (SUCCEEDED(hrResult)) - { - hrResult = GetFirstConflictingFeature(pHelper, - pOptItem, - dwItems, - &pConflicts, - &dwConflicts); - - if (SUCCEEDED(hrResult) && dwConflicts == 0) - { - hrResult = E_FAIL; - ERR(ERRORTEXT("SaveFeatureOptItems: Driver indicated conflict, but didn't provide conflicting options!\r\n")); - } - - if(FAILED(hrResult)) - { - ERR(ERRORTEXT("GetFirstConflictingFeature failed!")); - } - } - - if (SUCCEEDED(hrResult)) - { - // - // Display simple message box with prompt - // - nRet = MessageBox(hWnd, - pszMessage, - L"UI Replacement Test", - MB_YESNO | MB_ICONWARNING); - - // - // Check to see how user wants to resolve conflict - // - if(nRet == IDYES) - { - // - // Let core driver resolve conflict resolution - // - hrResult = pHelper->SetOptions(NULL, - 0, - TRUE, - pPairs->GetData(), - (DWORD)pPairs->GetElementCount(), - &dwPairsWritten, - &dwResult); - - // - // Conflict resolution requires refreshing current option - // selection for each feature, since selection may have - // changed because of conflict resolution. - // - if (SUCCEEDED(hrResult)) - { - RefreshOptItemSelection(pHelper, pOptItem, dwItems); - } - } - - // - // Return failure if there are still conflicts - // - if(dwResult == SETOPTIONS_RESULT_CONFLICT_REMAINED) - { - ERR(ERRORTEXT("SaveFeatureOptItems: Conflicts still exist even after calling core driver to resolve them!")); - hrResult = E_FAIL; - } - } - - if(pszMessage != NULL) - { - HeapFree(hHeap, 0, pszMessage); - } - } - } - - // - // Clean up - // - - if (pPairs) - { - delete pPairs; - } - - return hrResult; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// GetChangedFeatureOptions -// -// Synopsis: -// Creates a collection of all of the features that have changed in the -// provided collection of OPTITEMs -// -// Returns: -// S_OK on success, else E_*. -// -// Notes: -// if no settings have been changed, the routine may return S_OK -// and *ppPairs == NULL. -// -// -//---------------------------------------------------------------------------- -HRESULT -GetChangedFeatureOptions( - _In_reads_(dwItems) POPTITEM pOptItem, - // The array of optitems to search through - DWORD dwItems, - // The number of optitems in the provided array - _Outptr_result_maybenull_ CFeaturePairs **ppPairs - // feature / option keyword pairs describing the options that - // have changed. - ) -{ - VERBOSE(DLLTEXT("GetChangedFeatureOptions entry.")); - - DWORD dwCount = 0; - DWORD dwChanged = 0; - HRESULT hrResult = S_OK; - CFeaturePairs *pPairs; - - *ppPairs = NULL; - - // - // Walk OPTITEM array looking or changed options, - // and calculating size needed for multi-sz buffer. - // - for (dwCount = 0; dwCount < dwItems; dwCount++) - { - // - // Just go to next item if this OPTITEM hasn't - // changed or isn't a feature OPTITEM - // - if ((OPTIF_CHANGEONCE & pOptItem[dwCount].Flags) && - IsFeatureOptItem(&(pOptItem[dwCount])) - ) - { - ++dwChanged; - } - } - - // - // Don't need to do anything more if no feature options changed. - // - if(dwChanged != 0) - { - pPairs = new CFeaturePairs(dwChanged); - - if (pPairs == NULL || - pPairs->GetElementCount() == 0 - ) - { - ERR(ERRORTEXT("GetChangedFeatureOptions: Failed to allocate feature-option array!\r\n")); - hrResult = E_OUTOFMEMORY; - - if ( pPairs ) - { - delete pPairs; - pPairs = NULL; - } - - } - - // - // Build array of feature option pairs that changed - // - for (dwCount = 0; - SUCCEEDED(hrResult) && (dwCount < dwItems) && dwChanged; - dwCount++) - { - // - // Just go to next item if this OPTITEM hasn't - // changed or isn't a feature OPTITEM - // - if((OPTIF_CHANGEONCE & pOptItem[dwCount].Flags) && - IsFeatureOptItem(&(pOptItem[dwCount])) - ) - { - // - // For convienience, assign to pointer to feature OPTITEM data - // - PFEATUREOPTITEMDATA pData = (PFEATUREOPTITEMDATA)(pOptItem[dwCount].UserData); - - // - // Add feature option pair - // - PCSTR pszOption = GetOptionKeywordFromOptItem(&pOptItem[dwCount]); - - if (pszOption != NULL) - { - --dwChanged; - hrResult = pPairs->SetPair(dwChanged, pData->pszFeatureKeyword, pszOption); - } - } - } - - if(SUCCEEDED(hrResult)) - { - *ppPairs = pPairs; - } - else if (pPairs) - { - delete pPairs; - } - } - - return hrResult; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::GetOptionKeywordFromOptItem -// -// Synopsis: -// Returns pointer to option keyword for a feature OPTITEM -// -// Returns: -// The requested string on success, otherwise NULL -// -// -//---------------------------------------------------------------------------- -PCSTR -GetOptionKeywordFromOptItem( - POPTITEM pOptItem - // The opt item from which the keyword shoudl be read - ) -{ - VERBOSE(DLLTEXT("GetOptionKeywordFromOptItem entry.")); - - PCSTR pszOption = NULL; - - // - // Validate parameters - // - if(!IsFeatureOptItem(pOptItem)) - { - ERR(ERRORTEXT("GetOptionKeywordFromOptItem: Invalid parameter!\r\n")); - } - else if(pOptItem->pOptType->Type != TVOT_COMBOBOX) - { - ERR(ERRORTEXT("GetOptionKeywordFromOptItem: OPTTYPE type %d number of OPTPARAMS not handled!\r\n"), - pOptItem->pOptType->Type); - } - else - { - // - // Option selection is based on type of OPTTYPE - // - PFEATUREOPTITEMDATA pData = ((PFEATUREOPTITEMDATA)(pOptItem->UserData)); - CONST COption *pOption = pData->pFeature->GetOption((DWORD)pOptItem->Sel); - - if (pOption) - { - pszOption = pOption->GetKeyword(); - } - else - { - ERR(ERRORTEXT("GetOptionKeywordFromOptItem: Invalid option index %d!\r\n"), (DWORD)pOptItem->Sel); - } - } - - return pszOption; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::RefreshOptItemSelection -// -// Synopsis: -// For each feature update the currently selected option with the value -// that the core driver has selected. This is useful for updating the -// UI after resolving constraints. -// -// Returns: -// S_OK on success, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT -RefreshOptItemSelection( - IPrintCoreHelper *pHelper, - // Pointer to the Unidrv supplied helper object - _In_reads_(dwItems) POPTITEM pOptItems, - // An array of options to update - DWORD dwItems - // The number of options in the provided array - ) -{ - HRESULT hrResult = S_OK; - PFEATUREOPTITEMDATA pData = NULL; - - // - // Walk OPTITEM array refreshing feature OPTITEMs - // - for (DWORD dwCount = 0; dwCount < dwItems; dwCount++) - { - // - // Just go to next item if this OPTITEM isn't a feature OPTITEM - // - if (!IsFeatureOptItem(pOptItems + dwCount)) - { - continue; - } - - // - // For convienience, assign to pointer to feature OPTITEM data - // - pData = (PFEATUREOPTITEMDATA)(pOptItems[dwCount].UserData); - - // - // Refresh COption selection - // - pData->pFeature->RefreshSelection(pHelper); - - // - // Assign COption selection to OPTITEM selection - // - pOptItems[dwCount].Sel = pData->pFeature->GetSelection(); - } - - return hrResult; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// ::GetFirstConflictingFeature -// -// Synopsis: -// Finds the first features that it finds to be in conflict with one -// another and supplies those features in the ppConstraints parameter -// -// Returns: -// S_OK on success, else E_*. Note that this routine can succeed even -// if no features are in conflict. In that case, *ppConstraints will -// be NULL. -// -// -//---------------------------------------------------------------------------- -HRESULT -GetFirstConflictingFeature( - IPrintCoreHelper *pHelper, - // Pointer to the Unidrv supplied helper object - _In_reads_(dwItems) POPTITEM pOptItem, - // The array of options to look for a conflict in - DWORD dwItems, - // The number of options in the array - CONST PRINT_FEATURE_OPTION **ppConstraints, - // If any constraints are found, supplies pairs of - // feature / option keywords to the caller indicating - // which options cannot be used together. - DWORD *pdwConstraints - // The number of constrained options - ) -{ - VERBOSE(DLLTEXT("GetFirstConflictingFeature entry.")); - - DWORD dwCount = 0; - HRESULT hrResult = S_OK; - PCSTR pszOptionKeyword = NULL; - - *ppConstraints = NULL; - - // - // Walk OPTITEM array looking for changed options that are in conflict - // - for (dwCount = 0; dwCount < dwItems; dwCount++) - { - // - // Just go to next item if this OPTITEM hasn't - // changed or isn't a feature OPTITEM - // - if(!(OPTIF_CHANGEONCE & pOptItem[dwCount].Flags) || - !IsFeatureOptItem(&(pOptItem[dwCount])) - ) - { - continue; - } - - PFEATUREOPTITEMDATA pData = (PFEATUREOPTITEMDATA)(pOptItem[dwCount].UserData); - - // - // Init conflict record if this feature is in conflict - // - pszOptionKeyword = GetOptionKeywordFromOptItem(&pOptItem[dwCount]); - - if (pszOptionKeyword != NULL) - { - // - // Get reason for conflict - // - hrResult = pHelper->WhyConstrained(NULL, - 0, - pData->pszFeatureKeyword, - pszOptionKeyword, - ppConstraints, - pdwConstraints); - - if (FAILED(hrResult)) - { - ERR(ERRORTEXT("GetConflictingFeatures: Failed to get reason for feature %hs option %hs constraint! (hrResult = 0x%x)\r\n"), - pData->pszFeatureKeyword, - pszOptionKeyword, - hrResult); - break; - } - - if (*pdwConstraints > 0) - { - break; - } - } - } - - return hrResult; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// CreateOptType -// -// Synopsis: -// Allocates and initializes OptType for OptItem & OPTPARAMs for the -// options under that struct. -// -// Returns: -// A newly allocated POPTYPE from the specified heap on success, else -// NULL. -// -// -//---------------------------------------------------------------------------- -POPTTYPE -CreateOptType( - HANDLE hHeap, - // heap to allocate the type from. - WORD wOptParams - // The number of options available for this feature. - ) -{ - VERBOSE(DLLTEXT("CreateOptType entry.")); - - POPTTYPE pOptType = NULL; - // out parameter containing the allocated type struct & array of options. - - // - // Allocate memory from the heap for the OPTTYPE; the driver will take - // care of clean up. - // - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - - if(NULL != pOptType) - { - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, - HEAP_ZERO_MEMORY, - wOptParams * sizeof(OPTPARAM)); - - if(NULL != pOptType->pOptParam) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - // Free allocated memory and return NULL. - ERR(ERRORTEXT("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n")); - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR(ERRORTEXT("CreateOptType() failed to allocated memory for OPTTYPE!\r\n")); - } - - return pOptType; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::GetStringResource -// -// Synopsis: -// Load a string from the resource section of hte specied module. -// -// Returns: -// S_OK on failure, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT -GetStringResource( - _In_ HANDLE hHeap, - // Heap to allocate space for the resource from. - _In_ HMODULE hModule, - // Module to load the resource from - UINT uResource, - // resource ID - _Out_ PWSTR *ppszString - // out pointer to string resource loaded. - ) -{ - VERBOSE(DLLTEXT("GetStringResource entry.")); - - HRESULT hr = S_OK; - - // - // Allocate buffer for string resource from heap; - // let the driver clean it up. - // - *ppszString = NULL; - *ppszString = (PTSTR) HeapAlloc(hHeap, - HEAP_ZERO_MEMORY, - MAX_PATH * sizeof(TCHAR)); - - if(NULL != *ppszString) - { - // - // Load string resource; resize after loading so - // as not to waste memory. - // - INT nResult = LoadString(hModule, - uResource, - *ppszString, - MAX_PATH); - - if( nResult > 0) - { - PWSTR pszTemp = (PWSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, *ppszString, (nResult + 1) * sizeof(WCHAR)); - - if (NULL != pszTemp) - { - *ppszString = pszTemp; - } - else - { - // - // a realloc failure doesn't free the original string, so - // re-alloc failing in this case is not critical. - // - VERBOSE(ERRORTEXT("GetStringResource() HeapReAlloc() of string retrieved failed! (Last Error was %d)\r\n"), GetLastError()); - } - } - else - { - ERR(ERRORTEXT("LoadString() returned %d! (Last Error was %d)\r\n"), nResult, GetLastError()); - ERR(ERRORTEXT("GetStringResource() failed to load string resource %d!\r\n"), uResource); - HeapFree(hHeap, 0, *ppszString); - *ppszString = NULL; - hr = E_FAIL; - } - } - else - { - ERR(ERRORTEXT("GetStringResource() failed to allocate string buffer!\r\n")); - hr = E_OUTOFMEMORY; - } - - return hr; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.h b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.h deleted file mode 100644 index adab6eec..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/Features.h +++ /dev/null @@ -1,388 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: Features.h -// -// PURPOSE: Defines wrapper class for WinXP PS Features and Options. -// -//-------------------------------------------------------------------------- - -#pragma once - -//////////////////////////////////////////////////////// -// Type Definitions -//////////////////////////////////////////////////////// - -// -// Struct used to map keyword to information -// such as display name and stickiness. -// -typedef struct _tagKeywordMap -{ - PCSTR pszKeyword; - PCWSTR pwszModule; - UINT uDisplayNameID; - DWORD dwMode; - -} KEYWORDMAP, *PKEYWORDMAP; - -typedef CONST KEYWORDMAP *PCKEYWORDMAP; - - -//////////////////////////////////////////////////////// -// Class Definitions -//////////////////////////////////////////////////////// - - -// -// Option Infomation -// -class COption -{ -private: - PCKEYWORDMAP m_pMapping; - PWSTR m_pszDisplayName; - HANDLE m_hHeap; - -public: - COption() - : - m_pMapping(NULL), - m_pszDisplayName(NULL), - m_hHeap(NULL) - { - } - - virtual ~COption() - { - if (m_hHeap && m_pszDisplayName && !IS_INTRESOURCE(m_pszDisplayName)) - { - HeapFree(m_hHeap, 0, m_pszDisplayName); - } - } - - HRESULT - Acquire( - HANDLE hHeap, - PCKEYWORDMAP pMapping - ); - - CONST PCWSTR - GetDisplayName() CONST - { - return m_pszDisplayName; - } - - CONST PCSTR - GetKeyword() CONST - { - if (m_pMapping) - { - return m_pMapping->pszKeyword; - } - else - { - return NULL; - } - } -}; - - -// -// Class wrapper and container for Core Driver Feature -// Options. -// -class CFeature -{ -private: - - PCKEYWORDMAP m_pMapping; - - PWSTR m_pszDisplayName; - - DWORD m_dwOptions; - // Count of the number of options contained for an instance of the class. - - PCSTR m_pszFeature; - // Pointer to the feature for which the enumerated options belong. - - HANDLE m_hHeap; - // Heap to do allocations from. - - COption *m_pOptions; - // Array of info about each option for a feature - - DWORD m_Sel; - // An optitem selection is indicated either with a pointer or an - // index. Since combo-boxes use indices, and this custom UI only - // generates combo boxes, this class always uses an index to - // indicate the current selection. - -public: - - CFeature(); - - virtual ~CFeature(); - - // - // Populate Options list for specified keyword. - // - HRESULT - Acquire( - _In_ HANDLE hHeap, - _In_ IPrintCoreHelper* pHelper, - _In_ PCSTR pszFeature - ); - - // - // Returns number of feature options contained in class instance. - // - DWORD - GetCount() const {return m_dwOptions;} - - // - // Return nth option. - // - CONST COption * - GetOption( - DWORD dwIndex - ) const; - - - // - // Get the currently selected option index. - // - LONG - GetSelection() - { - return m_Sel; - } - - // - // Find option with matching keyword string. - // - _Success_(return != FALSE) BOOL - FindOption( - _In_ PCSTR pszOption, - _Out_ DWORD *pdwOption - ) const; - - // - // Initializes options portion of OPTITEM. - // - HRESULT - InitOptItem( - _In_ HANDLE hHeap, - _Inout_ POPTITEM pOptItem - ); - - // - // Refresh option selection. - // - HRESULT - RefreshSelection( - _In_ IPrintCoreHelper* pHelper - ); - - CONST PCWSTR - GetDisplayName() - { - return m_pszDisplayName; - } - - CONST PCSTR - GetKeyword() - { - return m_pszFeature; - } - - DWORD - GetMode() - { - return m_pMapping->dwMode; - } - -private: - - VOID - Clear(); -}; - - -// -// Class wrapper and container for Core Driver Features. -// -class CFeatureCollection -{ -private: - - DWORD m_dwFeatures; - // Count of the number of features. - - DWORD m_dwDocFeatures; - // Count of the number of document sticky features - - DWORD m_dwPrintFeatures; - // Count of the number of printer sticky features. - - HANDLE m_hHeap; - // Heap to do allocations from. - - CFeature *m_pFeatures; - // Array of feature information about each of the enumerate features. - -public: - - CFeatureCollection(); - virtual ~CFeatureCollection(); - - // - // Populates the Feature list - // - HRESULT Acquire( - HANDLE hHeap, - IPrintCoreHelper* pHelper - ); - - // - // Returns number of features contained in class instance. - // - DWORD GetCount( - DWORD dwMode = 0 - ) const; - - // Returns pointer to option class for nth feature. - // - CFeature* GetFeature( - DWORD wIndex, - DWORD dwMode = 0 - ) const; - -private: - - VOID Clear(); - - DWORD GetModelessIndex( - DWORD dwIndex, - DWORD dwMode - ) const; -}; - - -class CFeaturePairs -{ -private: - - PRINT_FEATURE_OPTION * m_pData; - size_t m_cElements; - - VOID - ClearPair( - size_t iIndex - ); - -public: - - CFeaturePairs(size_t cElements); - - ~CFeaturePairs(); - - HRESULT - SetPair( - size_t iIndex, - PCSTR pcszFeature, - PCSTR pcszOption - ); - - PRINT_FEATURE_OPTION * - GetData() - { - return m_pData; - } - - size_t - GetElementCount() - { - return m_cElements; - } -}; - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT -GetDisplayNameFromMapping( - _In_ HANDLE hHeap, - _In_ PCKEYWORDMAP pMapping, - _Out_ PWSTR *ppszDisplayName - ); - -PCKEYWORDMAP -GetKeywordMapping( - _In_reads_(dwMapSize) PCKEYWORDMAP pKeywordMap, - DWORD dwMapSize, - PCSTR pszKeyword - ); - -BOOL -IsFeatureOptItem( - POPTITEM pOptItem - ); - -HRESULT -SaveFeatureOptItems( - HANDLE hHeap, - IPrintCoreHelper* pHelper, - HWND hWnd, - _In_reads_(dwItems) POPTITEM pOptItem, - DWORD dwItems - ); - -HRESULT -GetChangedFeatureOptions( - _In_reads_(dwItems) POPTITEM pOptItem, - DWORD dwItems, - _Outptr_result_maybenull_ CFeaturePairs **ppPairs - ); - -PCSTR -GetOptionKeywordFromOptItem( - POPTITEM pOptItem - ); - -HRESULT -RefreshOptItemSelection( - IPrintCoreHelper* pHelper, - _In_reads_(dwItems) POPTITEM pOptItems, - DWORD dwItems - ); - -HRESULT -GetFirstConflictingFeature( - IPrintCoreHelper *pHelper, - _In_reads_(dwItems) POPTITEM pOptItem, - DWORD dwItems, - CONST PRINT_FEATURE_OPTION **pConstraints, - DWORD *pdwConstraints - ); - -POPTTYPE -CreateOptType( - HANDLE hHeap, - WORD wOptParams - ); - -HRESULT -GetStringResource( - _In_ HANDLE hHeap, - _In_ HMODULE hModule, - UINT uResource, - _Out_ PWSTR *ppszString - ); diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj deleted file mode 100644 index e7dfa837..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj +++ /dev/null @@ -1,1066 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {7C66BD86-A7CA-4F53-A5B2-9361A6B80E16} - $(MSBuildProjectName) - Win10 Debug - Win32 - {B571A415-8077-4F31-891E-02760FE89ED2} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - UNIUIREP - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - - - %(AdditionalDependencies);gdi32.lib;kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;uuid.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - UNIUIREP.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj.Filters deleted file mode 100644 index 359932e0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/UNIUIREP.vcxproj.Filters +++ /dev/null @@ -1,223 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {7212E25C-3AC4-4F4D-A600-63E91A451AD6} - - - h;hpp;hxx;hm;inl;inc;xsd - {72D49995-C0D7-4527-9A60-C2A300B80E2B} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {B53D0C7F-CD45-4EC5-893D-05FBEE34246B} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - Header Files - - - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.cpp b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.cpp deleted file mode 100644 index f7a3d842..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.cpp +++ /dev/null @@ -1,405 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.cpp -// -// PURPOSE: Debug functions. -// -// - -#include "precomp.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL DEFINES -//////////////////////////////////////////////////////// - -#define DEBUG_BUFFER_SIZE 1024 -#define PATH_SEPARATOR '\\' -#define MAX_LOOP 10 - -// Determine what level of debugging messages to eject. -#ifdef VERBOSE_MSG - #define DEBUG_LEVEL DBG_VERBOSE -#elif TERSE_MSG - #define DEBUG_LEVEL DBG_TERSE -#elif WARNING_MSG - #define DEBUG_LEVEL DBG_WARNING -#elif ERROR_MSG - #define DEBUG_LEVEL DBG_ERROR -#elif RIP_MSG - #define DEBUG_LEVEL DBG_RIP -#elif NO_DBG_MSG - #define DEBUG_LEVEL DBG_NONE -#else - #define DEBUG_LEVEL DBG_WARNING -#endif - - - -//////////////////////////////////////////////////////// -// EXTERNAL GLOBALS -//////////////////////////////////////////////////////// - -INT giDebugLevel = DEBUG_LEVEL; - - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -static BOOL DebugMessageV(LPCSTR lpszMessage, va_list arglist); -static BOOL DebugMessageV(DWORD dwSize, LPCWSTR lpszMessage, va_list arglist); - - - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessageV -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// dwSize Size of temp buffer to hold formated string. -// -// lpszMessage Format string. -// -// arglist Variable argument list.. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -static BOOL DebugMessageV(LPCSTR lpszMessage, va_list arglist) -{ - DWORD dwSize = DEBUG_BUFFER_SIZE; - DWORD dwLoop = 0; - LPSTR lpszMsgBuf = NULL; - HRESULT hr; - - - // Parameter checking. - if( (NULL == lpszMessage) - || - (0 == dwSize) - ) - { - return FALSE; - } - - do - { - // Allocate memory for message buffer. - if(NULL != lpszMsgBuf) - { - delete[] lpszMsgBuf; - dwSize *= 2; - } - lpszMsgBuf = new CHAR[dwSize + 1]; - if(NULL == lpszMsgBuf) - { - return FALSE; - } - - hr = StringCbVPrintfA(lpszMsgBuf, (dwSize + 1) * sizeof(CHAR), lpszMessage, arglist); - - // Pass the variable parameters to wvsprintf to be formated. - } while (FAILED(hr) && (STRSAFE_E_INSUFFICIENT_BUFFER == hr) && (++dwLoop < MAX_LOOP) ); - - // Dump string to Debug output. - OutputDebugStringA(lpszMsgBuf); - - // Cleanup. - delete[] lpszMsgBuf; - - return SUCCEEDED(hr); -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessageV -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// dwSize Size of temp buffer to hold formated string. -// -// lpszMessage Format string. -// -// arglist Variable argument list.. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -static BOOL DebugMessageV(DWORD dwSize, LPCWSTR lpszMessage, va_list arglist) -{ - LPWSTR lpszMsgBuf; - HRESULT hResult; - - - // Parameter checking. - if( (NULL == lpszMessage) - || - (0 == dwSize) - ) - { - return FALSE; - } - - // Allocate memory for message buffer. - lpszMsgBuf = new WCHAR[dwSize + 1]; - if(NULL == lpszMsgBuf) - return FALSE; - - // Pass the variable parameters to wvsprintf to be formated. - hResult = StringCbVPrintfW(lpszMsgBuf, (dwSize + 1) * sizeof(WCHAR), lpszMessage, arglist); - - // Dump string to debug output. - OutputDebugStringW(lpszMsgBuf); - - // Clean up. - delete[] lpszMsgBuf; - - return SUCCEEDED(hResult); -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessage -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// lpszMessage Format string. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCSTR lpszMessage, ...) -{ - BOOL bResult; - va_list VAList; - - - // Pass the variable parameters to DebugMessageV for processing. - va_start(VAList, lpszMessage); - bResult = DebugMessageV(lpszMessage, VAList); - va_end(VAList); - - return bResult; -} - - -////////////////////////////////////////////////////////////////////////// -// Function: DebugMessage -// -// Description: Outputs variable argument debug string. -// -// -// Parameters: -// -// lpszMessage Format string. -// -// -// Returns: -// -// -// Comments: -// -// -////////////////////////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCWSTR lpszMessage, ...) -{ - BOOL bResult; - va_list VAList; - - - // Pass the variable parameters to DebugMessageV to be processed. - va_start(VAList, lpszMessage); - bResult = DebugMessageV(MAX_PATH, lpszMessage, VAList); - va_end(VAList); - - return bResult; -} - -void Dump(PPUBLISHERINFO pPublisherInfo) -{ - VERBOSE(TEXT("pPublisherInfo:\r\n")); - if(NULL == pPublisherInfo) - { - VERBOSE(TEXT("\tpPublisherInfo is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tdwMode = %#x\r\n"), pPublisherInfo->dwMode); - VERBOSE(TEXT("\twMinoutlinePPEM = %d\r\n"), pPublisherInfo->wMinoutlinePPEM); - VERBOSE(TEXT("\twMaxbitmapPPEM = %d\r\n"), pPublisherInfo->wMaxbitmapPPEM); -} - -void Dump(POEMDMPARAM pOemDMParam) -{ - VERBOSE(TEXT("pOemDMParam:\r\n")); - if(NULL == pOemDMParam) - { - VERBOSE(TEXT("\tpOemDMParam is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pOemDMParam->cbSize); - VERBOSE(TEXT("\tpdriverobj = %#x\r\n"), pOemDMParam->pdriverobj); - VERBOSE(TEXT("\thPrinter = %#x\r\n"), pOemDMParam->hPrinter); - VERBOSE(TEXT("\thModule = %#x\r\n"), pOemDMParam->hModule); - VERBOSE(TEXT("\tpPublicDMIn = %#x\r\n"), pOemDMParam->pPublicDMIn); - VERBOSE(TEXT("\tpPublicDMOut = %#x\r\n"), pOemDMParam->pPublicDMOut); - VERBOSE(TEXT("\tpOEMDMIn = %#x\r\n"), pOemDMParam->pOEMDMIn); - VERBOSE(TEXT("\tpOEMDMOut = %#x\r\n"), pOemDMParam->pOEMDMOut); - VERBOSE(TEXT("\tcbBufSize = %d\r\n"), pOemDMParam->cbBufSize); -} - -void Dump(PPROPSHEETUI_INFO pPSUIInfo) -{ - VERBOSE(TEXT("pPSUIInfo:\r\n")); - if(NULL == pPSUIInfo) - { - VERBOSE(TEXT("\tpPSUIInfo is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pPSUIInfo->cbSize); - VERBOSE(TEXT("\tVersion = %#x\r\n"), pPSUIInfo->Version); - VERBOSE(TEXT("\tFlags = %#x\r\n"), pPSUIInfo->Flags); - VERBOSE(TEXT("\tReason = %d\r\n"), pPSUIInfo->Reason); - VERBOSE(TEXT("\thComPropSheet = %#x\r\n"), pPSUIInfo->hComPropSheet); - VERBOSE(TEXT("\tpfnComPropSheet = %#x\r\n"), pPSUIInfo->pfnComPropSheet); - VERBOSE(TEXT("\tlParamInit = %#x\r\n"), pPSUIInfo->lParamInit); - VERBOSE(TEXT("\tUserData = %#x\r\n"), pPSUIInfo->UserData); - VERBOSE(TEXT("\tResult = %#x\r\n"), pPSUIInfo->Result); -} - -void Dump(POPTITEM pOptItem) -{ - VERBOSE(TEXT("pOptItem:\r\n")); - if(NULL == pOptItem) - { - VERBOSE(TEXT("\tpOptItem is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\tcbSize = %d\r\n"), pOptItem->cbSize); - VERBOSE(TEXT("\tLevel = %d\r\n"), pOptItem->Level); - VERBOSE(TEXT("\tDlgPageIdx = %d\r\n"), pOptItem->DlgPageIdx); - VERBOSE(TEXT("\tFlags = 0x%x\r\n"), pOptItem->Flags); - VERBOSE(TEXT("\tUserData = 0x%p\r\n"), pOptItem->UserData); - VERBOSE(TEXT("\tpName = %s\r\n"), pOptItem->pName ? pOptItem->pName : TEXT("")); - VERBOSE(TEXT("\tpSel = 0x%p\r\n"), pOptItem->pSel); - VERBOSE(TEXT("\tpExtChkBox = 0x%p\r\n"), pOptItem->pExtChkBox); - VERBOSE(TEXT("\tpExtChkBox = 0x%p\r\n"), pOptItem->pExtChkBox); - VERBOSE(TEXT("\tHelpIndex = 0x%x\r\n"), pOptItem->HelpIndex); - VERBOSE(TEXT("\tDMPubID = 0x%x\r\n"), pOptItem->DMPubID); - VERBOSE(TEXT("\tUserItemID = 0x%x\r\n"), pOptItem->UserItemID); - VERBOSE(TEXT("\twReserved = 0x%x\r\n"), pOptItem->wReserved); - VERBOSE(TEXT("\tpOIExt = 0x%p\r\n"), pOptItem->pOIExt); - - Dump(pOptItem->pOptType); -} - -void Dump(POPTTYPE pOptType) -{ - VERBOSE(TEXT("\tpOptType:\r\n")); - if(NULL == pOptType) - { - VERBOSE(TEXT("\t\tpOptType is NULL!\r\n")); - return; - } - VERBOSE(TEXT("\t\tcbSize = %d\r\n"), pOptType->cbSize); - VERBOSE(TEXT("\t\tType = 0x%x\r\n"), pOptType->Type); - VERBOSE(TEXT("\t\tFlags = 0x%x\r\n"), pOptType->Flags); - VERBOSE(TEXT("\t\tCount = %d\r\n"), pOptType->Count); - VERBOSE(TEXT("\t\tCount = 0x%x\r\n"), pOptType->BegCtrlID); - VERBOSE(TEXT("\t\tStyle = 0x%x\r\n"), pOptType->Style); - - Dump(pOptType->pOptParam, pOptType->Count); -} - -void Dump(POPTPARAM pOptParam, WORD wCount) -{ - if(NULL == pOptParam) - { - VERBOSE(TEXT("\t\tpOptParam is NULL!\r\n")); - return; - } - - for(WORD wIndex = 0; wIndex < wCount; ++wIndex) - { - VERBOSE(TEXT("\t\tpOptParam[wIndex]:\r\n")); - VERBOSE(TEXT("\t\t\tcbSize = %d\r\n"), pOptParam[wIndex].cbSize); - VERBOSE(TEXT("\t\t\tFlags = 0x%x\r\n"), pOptParam[wIndex].Flags); - VERBOSE(TEXT("\t\t\tStyle = 0x%x\r\n"), pOptParam[wIndex].Style); - VERBOSE(TEXT("\t\t\tpData = 0x%p\r\n"), pOptParam[wIndex].pData); - VERBOSE(TEXT("\t\t\tIconID = 0x%p\r\n"), pOptParam[wIndex].IconID); - VERBOSE(TEXT("\t\t\tlParam = 0x%p\r\n"), pOptParam[wIndex].lParam); - } -} - - -PCSTR -StripDirPrefixA( - IN PCSTR pstrFilename - ) - -/*++ - -Routine Description: - - Strip the directory prefix off a filename (ANSI version) - -Arguments: - - pstrFilename - Pointer to filename string - -Return Value: - - Pointer to the last component of a filename (without directory prefix) - ---*/ - -{ - PCSTR pstr; - - pstr = strrchr(pstrFilename, PATH_SEPARATOR); - if (pstr) - return pstr + 1; - - return pstrFilename; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.h deleted file mode 100644 index b4d57b0b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/debug.h +++ /dev/null @@ -1,166 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. -// -// - -#pragma once - -// VC and Build use different debug defines. -// The following makes it so either will -// cause the inclusion of debugging code. -#if !defined(_DEBUG) && defined(DBG) - #define _DEBUG DBG -#elif defined(_DEBUG) && !defined(DBG) - #define DBG _DEBUG -#endif - - - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// - -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// VERBOSE(msg) -// Display a message if the current debug level is <= DBG_VERBOSE. -// -// TERSE(msg) -// Display a message if the current debug level is <= DBG_TERSE. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// ASSERTMSG(cond, msg) -// Verify a condition is true. If not, display a message and -// force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// These macros require extra parantheses for the msg argument -// example, ASSERTMSG(x > 0, ("x is less than 0\n")); -// WARNING(("App passed NULL pointer, ignoring...\n")); -// - -#define DBG_VERBOSE 1 -#define DBG_TERSE 2 -#define DBG_WARNING 3 -#define DBG_ERROR 4 -#define DBG_RIP 5 -#define DBG_NONE 6 - -#if DBG - - #define DebugMsg DebugMessage - - // - // Strip the directory prefix from a filename (ANSI version) - // - - PCSTR - StripDirPrefixA( - IN PCSTR pstrFilename - ); - - extern INT giDebugLevel; - - - #define DBGMSG(level, prefix, msg) { \ - if (giDebugLevel <= (level)) { \ - DebugMsg("%s %s (%d): ", prefix, StripDirPrefixA(__FILE__), __LINE__); \ - DebugMsg(msg); \ - } \ - } - - #define DBGPRINT(level, msg) { \ - if (giDebugLevel <= (level)) { \ - DebugMsg(msg); \ - } \ - } - - #define VERBOSE if(giDebugLevel <= DBG_VERBOSE) DebugMsg - #define TERSE if(giDebugLevel <= DBG_TERSE) DebugMsg - #define WARNING if(giDebugLevel <= DBG_WARNING) DebugMsg - #define ERR if(giDebugLevel <= DBG_ERROR) DebugMsg - - #define ASSERT(cond) { \ - if (! (cond)) { \ - RIP(("\n")); \ - } \ - } - - #define ASSERTMSG(cond, msg) { \ - if (! (cond)) { \ - RIP(msg); \ - } \ - } - - #define RIP(msg) { \ - DBGMSG(DBG_RIP, "RIP", msg); \ - DebugBreak(); \ - } - - -#else // !DBG - - #define DebugMsg NOP_FUNCTION - - #define VERBOSE NOP_FUNCTION - #define TERSE NOP_FUNCTION - #define WARNING NOP_FUNCTION - #define ERR NOP_FUNCTION - - #define ASSERT(cond) - - #define ASSERTMSG(cond, msg) - #define RIP(msg) - #define DBGMSG(level, prefix, msg) - #define DBGPRINT(level, msg) - -#endif - - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -BOOL DebugMessage(LPCSTR, ...); -BOOL DebugMessage(LPCWSTR, ...); -void Dump(PPUBLISHERINFO pPublisherInfo); -void Dump(POEMDMPARAM pOemDMParam); -void Dump(PPROPSHEETUI_INFO pPSUIInfo); -void Dump(POPTITEM pOptItem); -void Dump(POPTTYPE pOptType); -void Dump(POPTPARAM pOptParam, WORD wCount); - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.cpp deleted file mode 100644 index 1f872cde..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.cpp +++ /dev/null @@ -1,255 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: devmode.cpp -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// -//-------------------------------------------------------------------------- - -#include "precomp.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -BOOL -ConvertOEMDevmode( - _In_ PCOEMDEV pOEMDevIn, - _Inout_ POEMDEV pOEMDevOut - ); - -BOOL -MakeOEMDevmodeValid( - _Out_ POEMDEV pOEMDevmode - ); - -//+--------------------------------------------------------------------------- -// -// Member: -// ::hrOEMDevMode -// -// Synopsis: -// Performs operation on UI Plugins Private DevMode Members. -// Called via IOemUI::DevMode -// -// Returns: -// S_OK or E_FAIL. For more detailed failure info, -// check GetLastError -// -// Last error: -// ERROR_INVALID_PARAMETER -// -// -//---------------------------------------------------------------------------- -HRESULT -hrOEMDevMode( - DWORD dwMode, - // Indicates which operation should be performed - _Inout_ POEMDMPARAM pOemDMParam - // contains various data structures needed by this - // routine. The usage of this struct is determined by - // the dwMode flag. - ) -{ - VERBOSE(DLLTEXT("hrOEMDevMode entry.")); - - HRESULT hr = S_OK; - // Return value. - - // - // Verify parameters. - // - if ((NULL == pOemDMParam) || - ((OEMDM_SIZE != dwMode) && - (OEMDM_DEFAULT != dwMode) && - (OEMDM_CONVERT != dwMode) && - (OEMDM_MERGE != dwMode))) - { - ERR(ERRORTEXT("DevMode() ERROR_INVALID_PARAMETER.\r\n")); - ERR(DLLTEXT("\tdwMode = %d, pOemDMParam = %#lx.\r\n"), dwMode, pOemDMParam); - - SetLastError(ERROR_INVALID_PARAMETER); - hr = E_FAIL; - } - else - { - POEMDEV pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn;; - // Pointer to the supplied OEM devmode data, if applicable - // based on dwMode. - - POEMDEV pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut;; - // Pointer to the DEVMODE data that this routine is - // expected to configure, if applicable based on dwMode. - - switch (dwMode) - { - // - // The Method should return the size of the memory allocation - // needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - // - //Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - // - //OEM_DMEXTRAHEADER Members - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - break; - - // - // The method should convert private DEVMODE members to - // the current version, if necessary. - // - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - // - // The method should validate the information contained in private - // DEVMODE members and merge validated values into a private - // DEVMODE structure containing default values - // - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - } - - return hr; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::ConvertOEMDevmode -// -// Synopsis: -// confirm that the private DEVMODE being passed in is data that -// this driver recognizes, read the settings from the input -// OEM DEVMODE data, and write them to pOEMDevOut. -// -// Returns: -// True unless the routine was called with null pointers -// -// -//---------------------------------------------------------------------------- -BOOL -ConvertOEMDevmode( - _In_ PCOEMDEV pOEMDevIn, - // Caller supplied DEVMODE that we are attempting to read - _Inout_ POEMDEV pOEMDevOut - // OEM private DEVMODE configured by this routine based on the settings - // in pOEMDevIn - ) -{ - VERBOSE(DLLTEXT("ConvertOEMDevmode entry.")); - - if ((NULL == pOEMDevIn) || - (NULL == pOEMDevOut)) - { - ERR(ERRORTEXT("ConvertOEMDevmode() invalid parameters.\r\n")); - return FALSE; - } - - // - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - // - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE(DLLTEXT("Converting private OEM Devmode.\r\n")); - - // - // Copy the old structure in to the new using which ever size is the - // smaller. Devmode maybe from newer Devmode (not likely since there - // is only one), or Devmode maybe a newer Devmode, in which case it - // maybe larger, but the first part of the structure should be the same. - // - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get - // added to the end. - // - memcpy(pOEMDevOut, - pOEMDevIn, - __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - - // - // If the plug-in is capable of recognizing multiple versions of it's - // private DEVMODE data add custom handling here to support it. - // - } - else - { - WARNING(DLLTEXT("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n")); - - // - // The private DEVMODE data is not something that this plug-in understands, - // so use defaults. - // - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - - return TRUE; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::MakeOEMDevmodeValid -// -// Synopsis: -// Force the OEM devmode settings to valid values. -// -// Returns: -// True if the OEMDEV was configured, else FALSE. Only return false if -// the parameter is NULL. -// -// -//---------------------------------------------------------------------------- -BOOL -MakeOEMDevmodeValid( - _Out_ POEMDEV pOEMDevmode - // OEM DEVMODE data to modify - ) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // - // Assumption: pOEMDevmode is large enough to contain OEMDEV structure. - // - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - return TRUE; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.h deleted file mode 100644 index 342ce190..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/devmode.h +++ /dev/null @@ -1,48 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: devmode.h -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -//-------------------------------------------------------------------------- - -#pragma once - -// -// OEM private DEVMODE data structure. This gets included in the DEVMODE -// used by Unidrv. -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - // This structure MUST be prefixed by OEM_DMEXTRAHEADER - - // - // Add private DevMode members here, after the standard header - // information. - // - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - -// -// ProtoTypes -// - -HRESULT -hrOEMDevMode( - DWORD dwMode, - _Inout_ POEMDMPARAM pOemDMParam - ); - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/dllentry.cpp deleted file mode 100644 index 3160dfb4..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/dllentry.cpp +++ /dev/null @@ -1,82 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// PURPOSE: Source module for DLL entry function(s). -// -//-------------------------------------------------------------------------- - -#include "precomp.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::DllMain -// -// Synopsis: -// Dll's main routine, called when new -// threads or processes reference the module -// -// Returns: -// TRUE. Currently has no failure paths. Return false if the module -// cannot be properly initialized. -// -// Notes: -// The caller of this routine holds a process-wide lock preventing more -// than one module from being initialized at a time. In general, -// plug-ins should do as little as possible in this routine to avoid -// stalling other threads that may need to load modules. Also, calling -// any function that would, in-turn, cause another module to be loaded -// could result in a deadlock. -// -// -//---------------------------------------------------------------------------- -BOOL -WINAPI DllMain( - HINSTANCE hInst, - WORD wReason, - LPVOID lpReserved - ) -{ - VERBOSE(DLLTEXT("DllMain entry.")); - - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.cpp deleted file mode 100644 index 5513741e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.cpp +++ /dev/null @@ -1,1151 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// PURPOSE: Implementation of interface for PScript5, Unidrv5 UI plug-ins. -// -//-------------------------------------------------------------------------- - -#include "precomp.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//-------------------------------------------------------------------------- -// Globals -//-------------------------------------------------------------------------- - -HINSTANCE ghInstance = NULL; - // Module's Instance handle from DLLEntry of process. - - -//-------------------------------------------------------------------------- -// Internal Globals -//-------------------------------------------------------------------------- - -static long g_cComponents = 0; - // Count of active components - -static long g_cServerLocks = 0; - // Count of locks - - -//-------------------------------------------------------------------------- -// Class factory for the Plug-In object -//-------------------------------------------------------------------------- -class COemCF : public IClassFactory -{ -public: - - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ - REFIID riid, - _COM_Outptr_ LPVOID FAR* ppvObj - ); - - STDMETHOD_(ULONG,AddRef) (THIS); - STDMETHOD_(ULONG,Release) (THIS); - - // IClassFactory methods - STDMETHOD(CreateInstance) (THIS_ - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _COM_Outptr_ LPVOID FAR* ppvObject - ); - - STDMETHOD(LockServer) (THIS_ - BOOL bLock - ); - - // Class-specific methods. - COemCF(): m_cRef(1) { }; - - ~COemCF() { }; - -protected: - LONG m_cRef; - -}; - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::DllCanUnloadNow -// -// Synopsis: -// Can the DLL be unloaded from memory? Answers no if any objects are -// still allocated, or if the server has been locked. -// -// To avoid leaving OEM DLL still in memory when Unidrv or Pscript -// drivers are unloaded, Unidrv and Pscript driver ignore the return -// value of DllCanUnloadNow of the OEM DLL, and always call FreeLibrary -// on the OEMDLL. -// -// If the plug-in spins off a working thread that also uses this DLL, -// the thread needs to call LoadLibrary and FreeLibraryAndExitThread, -// otherwise it may crash after Unidrv or Pscript calls FreeLibrary. -// -// Returns: -// S_OK if the DLL can be unloaded safely, otherwise S_FALSE -// -// -//---------------------------------------------------------------------------- -STDAPI DllCanUnloadNow() -{ - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::DllGetClassObject -// -// Synopsis: -// Retrieve the class factory object for the indicated class. -// -// Returns: -// CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, or S_OK. -// -// Notes: -// -// -//---------------------------------------------------------------------------- -STDAPI -DllGetClassObject( - _In_ CONST CLSID& clsid, - // GUID of the class object that the caller wants a class factory - // for - _In_ CONST IID& iid, - // Interface ID to provide in ppv - _Outptr_ VOID** ppv - // out pointer to the interface requested. - ) -{ - VERBOSE(DLLTEXT("DllGetClassObject:Create class factory.")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // - // Can we create this component? - // - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE; - } - - // - // Create class factory. - // Reference count set to 1 in Constructor - // - COemCF* pUIReplacementCF = new COemCF; - if (pUIReplacementCF == NULL) - { - return E_OUTOFMEMORY; - } - - // - // Get requested interface. - // - HRESULT hr = pUIReplacementCF->QueryInterface(iid, ppv); - pUIReplacementCF->Release(); - - return hr; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::QueryInterface -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemCF::QueryInterface( - CONST IID& iid, - _COM_Outptr_ VOID** ppv - ) -{ - VERBOSE(DLLTEXT("COemCF::QueryInterface entry.")); - - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::AddRef -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -ULONG __stdcall -COemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::Release -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -ULONG __stdcall -COemCF::Release() -{ - assert(0 != m_cRef); - - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - } - return cRef; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::CreateInstance -// -// Synopsis: -// Attempt to create an object that implements the specified interface. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemCF::CreateInstance( - _In_opt_ IUnknown* pUnknownOuter, - _In_ CONST IID& iid, - _COM_Outptr_ VOID** ppv - ) -{ - VERBOSE(DLLTEXT("COemCF::CreateInstance entry.")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // - // Cannot aggregate. - // - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - HRESULT hr = S_OK; - - if (iid == IID_IUnknown || - iid == IID_IPrintOemUI2) - { - VERBOSE(DLLTEXT("COemCF::IID_IUnknown\r\n")); - - // - // Create component. - // - COemUI2* pOemCB = new COemUI2; - if (pOemCB == NULL) - { - hr = E_OUTOFMEMORY; - } - else - { - // - // Get the requested interface. - // - hr = pOemCB->QueryInterface(iid, ppv); - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pOemCB->Release(); - } - } - else - { - hr = E_NOINTERFACE; - } - - return hr; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemCF::LockServer -// -// Synopsis: -// Locking the server holds the objects server in memory, so that new -// instances of objects can be created more quickly. -// -// Returns: -// S_OK -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemCF::LockServer( - BOOL bLock - // If true, increment the lock count, otherwise decrement the lock - // count. - ) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - - return S_OK; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2 (destructor) -// -// Synopsis: -// Release the helper interface, as well as any other resources that -// the plug-in is holding onto. -// -// Returns: -// -// Notes: -// -// -//---------------------------------------------------------------------------- -COemUI2::~COemUI2() -{ - // - // Make sure that helper interface is released. - // - if(NULL != m_pCoreHelper) - { - m_pCoreHelper->Release(); - m_pCoreHelper = NULL; - } - - // - // If this instance of the object is being deleted, then the reference - // count should be zero. - // - assert(0 == m_cRef); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::QueryInterface -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::QueryInterface( - CONST IID& iid, - _COM_Outptr_ VOID** ppv - ) -{ - VERBOSE(DLLTEXT("COemUI2::QueryInterface entry.")); - - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("COemUI2::QueryInterface - Return pointer to IUnknown.\r\n")); - } - else if (iid == IID_IPrintOemUI2) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("COemUI2::QueryInterface - Return pointer to IPrintOemUI.\r\n")); - } - else - { -#if DBG - TCHAR szOutput[80] = {0}; - StringFromGUID2(iid, szOutput, _countof(szOutput)); // can not fail! - VERBOSE(DLLTEXT("COemUI2::QueryInterface %s not supported.\r\n"), szOutput); -#endif - - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::AddRef -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -ULONG __stdcall -COemUI2::AddRef() -{ - VERBOSE(DLLTEXT("COemUI2::AddRef entry.")); - - return InterlockedIncrement(&m_cRef); -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::Release -// -// Synopsis: -// Standard COM IUnknown implementation. -// -// -//---------------------------------------------------------------------------- -ULONG __stdcall -COemUI2::Release() -{ - VERBOSE(DLLTEXT("COemUI2::Release entry.")); - - assert(0 != m_cRef); - - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (0 == cRef) - { - delete this; - return 0; - - } - - return cRef; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::PublishDriverInterface -// -// Synopsis: -// This routine is called by the core driver to supply objects to the -// plug-in which the plug-in can use to implement various features. -// -// This implementation requires an object that IPrintCoreHelper interface -// from the core driver to implement full UI replacement. If the object -// passed in is the one desired, this routine will return S_OK, otherwise -// it will return E_FAIL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::PublishDriverInterface( - IUnknown *pIUnknown - ) -{ - VERBOSE(DLLTEXT("COemUI2::PublishDriverInterface entry.")); - - HRESULT hrResult = S_OK; - - // - // Determine whether the published object is the helper interface - // introduced in Vista to support full UI replacement. - // - if (m_pCoreHelper == NULL) - { - hrResult = pIUnknown->QueryInterface(IID_IPrintCoreHelper, (VOID**) &(m_pCoreHelper)); - - if (!SUCCEEDED(hrResult)) - { - m_pCoreHelper = NULL; - hrResult = E_FAIL; - } - } - - return hrResult; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::GetInfo -// -// Synopsis: -// Most of this routine is a standard implementation common to most -// plug-ins. Of particular note in this sample is that to get a handle -// the IPrintCoreHelper plug-in in the PublishDriverInterface callback, -// this routine must return OEMPUBLISH_IPRINTCOREHELPER in the out -// parameter when the mode is OEMGI_GETREQUESTEDHELPERINTERFACES. -// -// Returns: -// S_OK for supported modes, E_FAIL for everything else. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::GetInfo( - _In_ DWORD dwMode, - // The mode indicates what information is being requested by the - // core driver. - _Out_writes_bytes_to_(cbSize, *pcbNeeded) PVOID pBuffer, - // The output buffer is the location into which the requested info - // should be written - _In_ DWORD cbSize, - // The size of the output buffer. - _Out_ PDWORD pcbNeeded - // If the size of the buffer is insufficient, use this parameter - // to indicate to the core driver how much space is required. - ) -{ - HRESULT hrResult = S_OK; - -#if DBG - PWSTR pszTag; - - switch(dwMode) - { - case OEMGI_GETSIGNATURE: pszTag = L"COemUI2::GetInfo entry. [OEMGI_GETSIGNATURE]"; break; - case OEMGI_GETVERSION: pszTag = L"COemUI2::GetInfo entry. [OEMGI_GETVERSION]"; break; - case OEMGI_GETREQUESTEDHELPERINTERFACES: pszTag = L"COemUI2::GetInfo entry. [OEMGI_GETREQUESTEDHELPERINTERFACES]"; break; - default: pszTag = L"COemUI2::GetInfo entry."; break; - } - - VERBOSE(pszTag); -#endif - - // - // Validate parameters. OEMGI_GETPUBLISHERINFO is excluded from this - // list because that GetInfo mode applies only to PScript rendering plug-ins. - // - if ((NULL == pcbNeeded) || - ((OEMGI_GETSIGNATURE != dwMode) && - (OEMGI_GETVERSION != dwMode) && - (OEMGI_GETREQUESTEDHELPERINTERFACES != dwMode))) - { - WARNING(DLLTEXT("COemUI2::GetInfo() exit pcbNeeded is NULL or mode is not supported\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // - // Set expected buffer size and number of bytes written. - // - *pcbNeeded = sizeof(DWORD); - - // - // Check buffer size is sufficient. - // - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("COemUI2::GetInfo() exit insufficient buffer!\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - hrResult = E_FAIL; - } - else - { - switch(dwMode) - { - // - // OEM DLL Signature - // - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // - // OEM DLL version - // - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // - // New core helper interface support - // - case OEMGI_GETREQUESTEDHELPERINTERFACES: - *(PDWORD)pBuffer = 0; - *(PDWORD)pBuffer |= OEMPUBLISH_IPRINTCOREHELPER; - break; - - // - // dwMode not supported. - // - default: - // Set written bytes to zero since nothing was written. - // - WARNING(DLLTEXT("COemUI2::GetInfo() exit mode not supported.\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - hrResult = E_FAIL; - } - } - - return hrResult; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DevMode -// -// Synopsis: -// This routine operates in various modes to manage the private DEVMODE. -// This sample does not provide much by way of illustration of how to -// handle OEM settings in the private DEVMODE. See the sample OEMUI for -// a more in-depth look at this routine. The function hrOEMDevMode in -// devmode.cpp also provides more information on how to handle the various -// modes. -// -// Returns: -// S_OK on success, else E_* -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DevMode( - DWORD dwMode, - // The operation that should be performed - POEMDMPARAM pOemDMParam - // The input & output DEVMODEs, including pointers to the public & - // private DEVMODE data. - ) -{ - VERBOSE(DLLTEXT("COemUI2::Devmode entry.")); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::HideStandardUI -// -// Synopsis: -// This routine is critical to supporting full UI replacement. This -// routine allows the plug-in to disable Unidrv's (or PScript's) standard -// UI panels. If this returns E_NOTIMPL, the panel isn't hidden. If -// this routine returns S_OK, Unidrv will not display any UI for the -// specified mode. If this returns E_NOTIMPL, Unidrv will display it's -// standard UI. -// -// Returns: -// S_OK to hide the indicated UI if desired, otherwise E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::HideStandardUI( - DWORD dwMode - // document property sheets, printer property sheets, or possibly - // something not yet defined. - ) -{ - VERBOSE(DLLTEXT("COemUI2::HideStandardUI entry.")); - - HRESULT hrResult = E_NOTIMPL; - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - case OEMCUIP_PRNPROP: - hrResult = S_OK; - break; - default: - // If we don't recognize the mode, assume that we don't want to hide - // the UI provided by Unidrv. - hrResult = E_NOTIMPL; - } - - return hrResult; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DocumentPropertySheets -// -// Synopsis: -// See function hrOEMDocumentPropertySheets in uniuirep.cpp. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ) -{ - VERBOSE(DLLTEXT("COemUI2::DocumentPropertySheets entry.")); - - return hrCommonPropSheetMethod(pPSUIInfo, lParam, m_pCoreHelper, &m_Features, OEMCUIP_DOCPROP); -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DevicePropertySheets -// -// Synopsis: -// See function hrOEMDevicePropertySheets in uniuirep.cpp -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ) -{ - VERBOSE(DLLTEXT("COemUI2::DevicePropertySheets entry.")); - - return hrCommonPropSheetMethod(pPSUIInfo, lParam, m_pCoreHelper, &m_Features, OEMCUIP_PRNPROP); -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::CommonUIProp -// -// Synopsis: -// This routine is used to interact with the Unidrv-supplied -// property sheet pages. Since this plug-in implements full-UI -// replacement, those property sheet pages are disabled, and this -// routine does not need to do anything. -// -// Returns: -// S_OK -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ) -{ - VERBOSE(DLLTEXT("COemUI2::CommonUIProp entry.")); - - UNREFERENCED_PARAMETER(dwMode); - UNREFERENCED_PARAMETER(pOemCUIPParam); - - return S_OK; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DeviceCapabilities -// -// Synopsis: -// This routine can be used to replace the Unidrvs device capabilities -// handling. In this implementation, no custom capabilities handling is -// provided. -// -// Returns: -// E_FAIL -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DeviceCapabilities( - _Inout_ POEMUIOBJ poemuiobj, - // OEM settings & information - _In_ HANDLE hPrinter, - // Handle to the printer that the capabilities are being requested for - _In_ PWSTR pDeviceName, - // Name of the device / driver - _In_ WORD wCapability, - // The DC_ ID indicating which capability was requested. - _Out_writes_(_Inexpressible_("varies with wCapability")) PVOID pOutput, - // Buffer to write requested information to. - _In_ PDEVMODE pPublicDM, - // Pointer to the public DEVMODE representing the settings to get - // capabilities with respect to. - _In_ PVOID pOEMDM, - // OEM private DEVMODE settings. - _In_ DWORD dwOld, - // Result from previous plug-in call to this routine. - _Out_ DWORD *dwResult - // Result of this call. If there are multiple UI plug-ins, this - // result is passed to the next one as dwOld - ) -{ - VERBOSE(DLLTEXT("COemUI2::DeviceCapabilities entry.")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - // - // Do nothing. Let Unidrv handle the device capabilities processing. - // - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DevQueryPrintEx -// -// Synopsis: -// This routine is used to determine print job compatibility with the -// current driver. The plug-in can supplement Unidrv's handling of this -// routine. If Unidrv determines that a job can be printed on the current -// printer it will call this routine to ask the plug-in whether it can -// also handle the current job. If Unidrv determines that the job cannot -// be printed, it will not call the plug-in. Additionally, XPS drivers -// built on the Unidrv and PScript UI modules may not recieve this call- -// back. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ) -{ - VERBOSE(DLLTEXT("COemUI2::DevQueryPrintEx entry.")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::UpgradePrinter -// -// Synopsis: -// Use this callback to upgrade any settings from previous versions -// that are stored in the registry by the plug-in Not applicabe to -// this sample. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::UpgradePrinter( - _In_ DWORD dwLevel, - _At_((PDRIVER_UPGRADE_INFO_1)pDriverUpgradeInfo, _In_) PBYTE pDriverUpgradeInfo - ) -{ - VERBOSE(DLLTEXT("COemUI2::UpgradePrinter entry.")); - - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::PrinterEvent -// -// Synopsis: -// Perform any special processing needed when various events occur to the -// print queue. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::PrinterEvent( - _In_ PWSTR pPrinterName, - _In_ INT iDriverEvent, - _In_ DWORD dwFlags, - _In_ LPARAM lParam - ) -{ - VERBOSE(DLLTEXT("COemUI2::PrinterEvent entry.")); - - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DriverEvent -// -// Synopsis: -// Notifies the plug-in of changes or events relevant to the driver, -// such as installing and upgrading. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DriverEvent( - _In_ DWORD dwDriverEvent, - _In_ DWORD dwLevel, - _In_reads_(_Inexpressible_("varies")) LPBYTE pDriverInfo, - _In_ LPARAM lParam - ) -{ - VERBOSE(DLLTEXT("COemUI2::DriverEvent entry.")); - - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::QueryColorProfile -// -// Synopsis: -// This routine can be implemented to provide a color profile from the -// driver. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData - ) -{ - VERBOSE(DLLTEXT("COemUI2::QueryColorProfile entry.")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(ulQueryMode); - UNREFERENCED_PARAMETER(pvProfileData); - UNREFERENCED_PARAMETER(pcbProfileData); - UNREFERENCED_PARAMETER(pflProfileData); - - return E_NOTIMPL; -}; - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::FontInstallerDlgProc -// -// Synopsis: -// Plug-ins can use this method to replace Unidrv's provided soft-font -// installer dialog. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ) -{ - VERBOSE(DLLTEXT("COemUI2::FontInstallerDlgProc entry.")); - - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::UpdateExternalFonts -// -// Synopsis: -// This routine is used to notify the UI of any changes to installed -// font cartridges, primarily for supporting soft-font UI replacement. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::UpdateExternalFonts( - _In_ HANDLE hPrinter, - _In_ HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ) -{ - VERBOSE(DLLTEXT("COemUI2::UpdateExternalFonts entry.")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//+--------------------------------------------------------------------------- -// -// Member: -// -// Synopsis: -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::QueryJobAttributes( - _In_ HANDLE hPrinter, - _In_ PDEVMODE pDevmode, - _In_range_(1, 4) DWORD dwLevel, - _In_reads_(_Inexpressible_("varies")) LPBYTE lpAttributeInfo - ) -{ - VERBOSE(DLLTEXT("COemUI2::QueryJobAttributes entry.")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDevmode); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(lpAttributeInfo); - - return E_NOTIMPL; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// COemUI2::DocumentEvent -// -// Synopsis: -// Perform any special processing needed at various points in time while -// a job is printing. -// -// Implementation of this routine is optional. To indicate that the -// plug-in does not support this call, return E_NOTIMPL. -// -// -//---------------------------------------------------------------------------- -HRESULT __stdcall -COemUI2::DocumentEvent( - HANDLE hPrinter, - HDC hdc, - INT iEsc, - ULONG cbIn, - PVOID pbIn, - ULONG cbOut, - PVOID pbOut, - PINT piResult - ) -{ - VERBOSE(DLLTEXT("COemUI2::DocumentEvent entry.")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hdc); - UNREFERENCED_PARAMETER(iEsc); - UNREFERENCED_PARAMETER(cbIn); - UNREFERENCED_PARAMETER(pbIn); - UNREFERENCED_PARAMETER(cbOut); - UNREFERENCED_PARAMETER(pbOut); - UNREFERENCED_PARAMETER(piResult); - - return E_NOTIMPL; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.h deleted file mode 100644 index 09a61f4a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/intrface.h +++ /dev/null @@ -1,222 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.h -// -// PURPOSE: Define COM interface for User Mode Printer Customization DLL. -// -//-------------------------------------------------------------------------- - -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -extern HINSTANCE ghInstance; - // Module's Instance handle from DLLEntry of process. - -class COemUI2: public IPrintOemUI2 -{ -public: - // - // *** IUnknown methods *** - // - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, _COM_Outptr_ LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - STDMETHOD(GetInfo) (THIS_ - _In_ DWORD dwMode, - _Out_writes_bytes_to_(cbSize, *pcbNeeded) PVOID pBuffer, - _In_ DWORD cbSize, - _Out_ PDWORD pcbNeeded); - - // - // OEMDevMode - // - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam); - - // - // OEMCommonUIProp - // - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - STDMETHOD(DeviceCapabilities) (THIS_ - _Inout_ POEMUIOBJ poemuiobj, - _In_ HANDLE hPrinter, - _In_ PWSTR pDeviceName, - _In_ WORD wCapability, - _Out_writes_(_Inexpressible_("varies with wCapability")) PVOID pOutput, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM, - _In_ DWORD dwOld, - _Out_ DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - STDMETHOD(UpgradePrinter) (THIS_ - _In_ DWORD dwLevel, - _At_((PDRIVER_UPGRADE_INFO_1)pDriverUpgradeInfo, _In_) PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - _In_ INT iDriverEvent, - _In_ DWORD dwFlags, - _In_ LPARAM lParam - ); - - // - // OEMDriverEvent - // - STDMETHOD(DriverEvent)(THIS_ - _In_ DWORD dwDriverEvent, - _In_ DWORD dwLevel, - _In_reads_(_Inexpressible_("varies")) LPBYTE pDriverInfo, - _In_ LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - STDMETHOD( QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - STDMETHOD(UpdateExternalFonts) (THIS_ - _In_ HANDLE hPrinter, - _In_ HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - // - // IPrintOemUI2 methods - // - - // - // QueryJobAttributes - // - STDMETHOD(QueryJobAttributes) (THIS_ - _In_ HANDLE hPrinter, - _In_ PDEVMODE pDevmode, - _In_range_(1, 4) DWORD dwLevel, - _In_reads_(_Inexpressible_("varies")) LPBYTE lpAttributeInfo - ); - - // - // Hide Standard UI - // - STDMETHOD(HideStandardUI) (THIS_ - DWORD dwMode - ); - - // - // DocumentEvent - // - STDMETHOD(DocumentEvent) (THIS_ - HANDLE hPrinter, - HDC hdc, - INT iEsc, - ULONG cbIn, - PVOID pbIn, - ULONG cbOut, - PVOID pbOut, - PINT piResult - ); - - COemUI2() - { - m_cRef = 1; - m_pCoreHelper = NULL; - }; - - virtual ~COemUI2(); - -protected: - - LONG m_cRef; - // reference count of this object - - IPrintCoreHelper* m_pCoreHelper; - // Pointer to the helper interface introduced in Windows Vista. - - CFeatureCollection m_Features; - // Collection of features advertised as supported by the helper - // interface. -}; - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precomp.h deleted file mode 100644 index cf24303c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precomp.h +++ /dev/null @@ -1,68 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.h -// -// PURPOSE: Header files that should be in the precompiled header. -// -//-------------------------------------------------------------------------- - -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "resource.h" -#include "devmode.h" -#include "Features.h" -#include "uniuirep.h" -#include "debug.h" -#include "intrface.h" - -#include - -// Include this file after any other standard include files -// to disallow unsafe string handling functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/resource.h deleted file mode 100644 index d7eda884..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/resource.h +++ /dev/null @@ -1,57 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// Used by uirepplug.rc. Keep this in sync with the definitions in that file. -// -//-------------------------------------------------------------------------- - -// -//{{NO_DEPENDENCIES}} -// -#define IDS_SECTION 1 -#define IDS_NAME 3 -#define IDS_DEVICE_SETTINGS_NAME 4 -#define IDS_CONSTRAINT_CONFLICT 5 -#define IDD_DOC_PROPPAGE 107 -#define IDS_METAFILE_SPOOLING 419 -#define IDS_TEXT_ASGRX 431 -#define IDS_TTDL_DEFAULT 460 -#define IDS_TTDL_TYPE1 461 -#define IDS_TTDL_TYPE3 462 -#define IDS_TTDL_TYPE42 463 -#define IDS_MISSINGNAME 464 -#define IDS_RESDLL 700 -#define IDS_GRAPHICS_MODE 701 -#define IDS_DUPLEX_UNIT 702 -#define IDS_UNIRESDLL 707 -#define IDS_RESOLUTION_600_DPI 708 -#define IDS_RESOLUTION_300_DPI 709 -#define IDS_RESOLUTION_150_DPI 710 -#define IDS_RASTERMODE 711 -#define IDS_HPGL2MODE 712 -#define IDS_PAPERSIZE_LETTER 713 -#define IDS_PAPERSIZE_LEGAL 714 -#define IDS_PAPERSIZE_EXECUTIVE 715 -#define IDS_PAPERSIZE_A4 716 -#define IDS_PAPERSIZE_B5 717 -#define IDS_COLORMODE_MONO 718 -#define IDS_COLORMODE_24BPP 719 -#define IDS_COLORMODE_8BPP 720 -#define IDS_HALFTONE_AUTO 721 -#define IDS_HALFTONE_SUPERCELL_M 722 -#define IDS_HALFTONE_6x6_M 723 -#define IDS_HALFTONE_8x8_M 724 -#define IDS_UIREP_ENVTRAY 728 -#define IDS_OUTBIN_STACKER 735 -#define IDS_OUTBIN_DEFAULT 736 -#define IDS_MEMORY_STD 737 -#define IDS_MEMORY_UPGRADE 738 -#define IDS_INSTALLED_MEMORY 739 - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.cpp b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.cpp deleted file mode 100644 index d75e3215..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.cpp +++ /dev/null @@ -1,492 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: uniuirep.cpp -// -// PURPOSE: This module handles COMPSTUI initialization and -// callback behavior. -// -//-------------------------------------------------------------------------- - - -#include "precomp.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - -typedef struct _tagCBUserData -{ - HANDLE hComPropSheet; - HANDLE hPropPage; - POEMUIPSPARAM pOEMUIParam; - PFNCOMPROPSHEET pfnComPropSheet; - IPrintCoreHelper* pHelper; - BOOL bPermission; - -} CBUSERDATA, *PCBUSERDATA; - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -LONG APIENTRY -OEMCommonUICallBack( - _In_ PCPSUICBPARAM pCallbackParam - ); - -POPTITEM -CreateOptItems( - HANDLE hHeap, - DWORD dwOptItems - ); - - -//+--------------------------------------------------------------------------- -// -// Member: -// ::hrCommonPropSheetMethod -// -// Synopsis: -// Adds property page to printer property sheet. -// -// Returns: -// S_OK on success, E_FAIL on failure. Sets LastError. -// -// -//---------------------------------------------------------------------------- -HRESULT -hrCommonPropSheetMethod( - PPROPSHEETUI_INFO pPSUIInfo, - // Property sheet information, including - // the reason for calling this function. - LPARAM lParam, - // Optional parameter. Value is determined - // by the reason member of pPSUIInfo. - IPrintCoreHelper* pHelper, - // Pointer to the helper interface used to control - // settings described in the GPD - CFeatureCollection* pFeatures, - // Collection of all features that we're supporting - // in our custom UI. - DWORD dwMode - // Should our sheet show device or document features? - ) -{ - LONG_PTR lResult = TRUE; - // result supplied to COMPSTUI via pPSUIInfo - - HRESULT hrResult = S_OK; - // Result returned to the immediate caller. - - VERBOSE(DLLTEXT("hrCommonPropSheetMethod entry.")); - - // - // Validate parameters. - // - if ((NULL == pPSUIInfo) || - (PROPSHEETUI_INFO_VERSION != pPSUIInfo->Version)) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod() ERROR_INVALID_PARAMETER.\r\n")); - - // - // Return invalid parameter error. - // - SetLastError(ERROR_INVALID_PARAMETER); - hrResult = E_FAIL; - goto Exit; - } - - Dump(pPSUIInfo); - - // - // Do action. - // - switch(pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - WORD wFeatures = 0; - DWORD dwSheets = 0; - PCBUSERDATA pUserData = NULL; - POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM)pPSUIInfo->lParamInit; - BOOL bPermission = 0; - HANDLE hHeap = pOEMUIParam->hOEMHeap; - COMPROPSHEETUI Sheet; - - // - // If the user doesn't have permission to change settings, - // make a note of it so we can disable controls later. - // - if (dwMode == OEMCUIP_PRNPROP) - { - bPermission = ((pOEMUIParam->dwFlags & DPS_NOPERMISSION)==0); - } - else - { - bPermission = ((pOEMUIParam->dwFlags & DM_NOPERMISSION)==0); - } - - // - // Make sure that we have the core driver features - // - hrResult = pFeatures->Acquire(hHeap, pHelper); - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Failed to load core driver features! (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - - // - // Wait until after the call to Acquire to read the number of features. - // - wFeatures = (WORD)pFeatures->GetCount(dwMode); - - // - // Init device settings replacement page - // - memset(&Sheet, 0, sizeof(COMPROPSHEETUI)); - Sheet.cbSize = sizeof(COMPROPSHEETUI); - Sheet.Flags = bPermission ? CPSUIF_UPDATE_PERMISSION : 0; - Sheet.hInstCaller = ghInstance; - Sheet.pHelpFile = NULL; - Sheet.pfnCallBack = OEMCommonUICallBack; - Sheet.cOptItem = wFeatures; - Sheet.IconID = IDI_CPSUI_PRINTER; - Sheet.CallerVersion = 0x100; - Sheet.OptItemVersion = 0x100; - - // - // Initialize mode-specific fields - // - if (dwMode == OEMCUIP_PRNPROP) - { - // - // Use a DlgPage structure to set the text in the tab - // in the printer propertues view. - // - DLGPAGE DlgPage; - memset(&DlgPage, 0, sizeof(DLGPAGE)); - DlgPage.cbSize = sizeof(DLGPAGE); - DlgPage.DlgTemplateID = DP_STD_TREEVIEWPAGE; - - // - // Get device settings display name - // - hrResult = GetStringResource(hHeap, ghInstance, IDS_DEVICE_SETTINGS_NAME, &DlgPage.pTabName); - - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Failed to get tab name! (hrResult = 0x%x)\r\n"), - hrResult); - goto Exit; - } - Sheet.pDlgPage = &DlgPage; - Sheet.cDlgPage = 1; - } - else - { - // - // printing preferences settings - // - Sheet.pDlgPage = CPSUI_PDLGPAGE_TREEVIEWONLY; - } - - // - // Get caller name - // - hrResult = GetStringResource(hHeap, ghInstance, IDS_NAME, &Sheet.pCallerName); - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Failed to get caller name! (hrResult = 0x%x)\r\n"), hrResult); - goto Exit; - } - - // - // Get section name - // - hrResult = GetStringResource(hHeap, ghInstance, IDS_SECTION, &Sheet.pOptItemName); - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Failed to get section name! (hrResult = 0x%x)\r\n"), hrResult); - goto Exit; - } - - // - // Init user data. - // - pUserData = (PCBUSERDATA)HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(CBUSERDATA)); - - if (pUserData == NULL) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Failed to allocate user data!\r\n")); - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - pUserData->hComPropSheet = pPSUIInfo->hComPropSheet; - pUserData->pfnComPropSheet = pPSUIInfo->pfnComPropSheet; - pUserData->pOEMUIParam = pOEMUIParam; - pUserData->pHelper = pHelper; - pUserData->bPermission = bPermission; - Sheet.UserData = (ULONG_PTR)pUserData; - - // - // Create OptItems for page. - // - Sheet.pOptItem = CreateOptItems(hHeap, Sheet.cOptItem); - - if (Sheet.pOptItem == NULL) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Failed to allocate OPTITEMS!\r\n")); - hrResult = E_OUTOFMEMORY; - goto Exit; - } - - // - // Add core driver features - // - for (DWORD wIndex = 0; wIndex < wFeatures; wIndex++) - { - // - // Initialize level and basic state for feature - // - Sheet.pOptItem[wIndex].Level = 1; - Sheet.pOptItem[wIndex].Flags = OPTIF_COLLAPSE; - CFeature *pFeature = pFeatures->GetFeature(wIndex, dwMode); - - if (pFeature == NULL) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Feature not found or features not initialized!\r\n")); - hrResult = E_UNEXPECTED; - goto Exit; - } - - // - // Get OPTITEM for this feature - // - hrResult = pFeature->InitOptItem(hHeap, Sheet.pOptItem + wIndex); - - if (!SUCCEEDED(hrResult)) - { - ERR(ERRORTEXT("hrCommonPropSheetMethod: Failed to get OPTITEM for feature %s\r\n"), pFeature->GetKeyword()); - goto Exit; - } - - } - - // - // Add property sheets. - // - lResult = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, - CPSFUNC_ADD_PCOMPROPSHEETUI, - (LPARAM)&Sheet, - (LPARAM)&dwSheets); - - - if (!lResult) - { - ERR(DLLTEXT("hrCommonPropSheetMethod() pfnComPropSheet returned %d.\r\n"), lResult); - ERR(ERRORTEXT("ComPropSheet failed! Failed to add device settings tab!\n")); - } - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - // - // Set header title - // - PPROPSHEETUI_INFO_HEADER pHeader = (PPROPSHEETUI_INFO_HEADER)lParam; - pHeader->pTitle = (LPTSTR)PROP_TITLE; - lResult = TRUE; - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - // - // No icon - // - lResult = 0; - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - PSETRESULT_INFO pInfo = (PSETRESULT_INFO)lParam; - lResult = pInfo->Result; - } - break; - - case PROPSHEETUI_REASON_DESTROY: - lResult = TRUE; - break; - } - - pPSUIInfo->Result = lResult; - -Exit: - - return hrResult; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// OEMCommonUICallBack -// -// Synopsis: -// Callback function to handle changes to the feature list panel -// added by this plug-in to the document properties UI. -// -// Returns: -// CPSUICB_ACTION_NONE if nothing further needs done. -// CPSUICB_ACTION_NO_APPLY_EXIT if settings changes were aborted -// -// -//---------------------------------------------------------------------------- -LONG APIENTRY -OEMCommonUICallBack( - _In_ PCPSUICBPARAM pCallbackParam - // struct containing all of the relevant callback parameters, - // including the reason that the callback is being made. - ) -{ - VERBOSE(DLLTEXT("OEMCommonUICallBack entry.")); - - WORD wItems = pCallbackParam->cOptItem; - LONG lReturn = CPSUICB_ACTION_NONE; - POPTITEM pOptItem = pCallbackParam->pOptItem; - PCBUSERDATA pUserData = (PCBUSERDATA) pCallbackParam->UserData; - HANDLE hHeap = pUserData->pOEMUIParam->hOEMHeap; - HRESULT hrResult = S_OK; - - VERBOSE(DLLTEXT("Reason = %d"), pCallbackParam->Reason); - - // - // If user has no permission to change anything, then simply - // return without any action - // - if (!pUserData->bPermission && - (pCallbackParam->Reason != CPSUICB_REASON_ABOUT)) - { - WARNING(DLLTEXT("OEMCommonUICallBack: User does not have appropriate permission!\r\n")); - lReturn = CPSUICB_ACTION_NONE; - } - else - { - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - if (wItems > 0) - { - // - // Save features if hiding std UI - // - hrResult = SaveFeatureOptItems(hHeap, - pUserData->pHelper, - pCallbackParam->hDlg, - pOptItem, - wItems); - - if (!SUCCEEDED(hrResult)) - { - // - // Return that we didn't save changes. - // NOTE: It is upto SaveFeatureOptItems() to display any - // UI for failure - // - lReturn = CPSUICB_ACTION_NO_APPLY_EXIT; - } - else - { - pUserData->pfnComPropSheet(pUserData->hComPropSheet, - CPSFUNC_SET_RESULT, - (LPARAM)pUserData->hPropPage, - (LPARAM)CPSUI_OK); - } - } - break; - - case CPSUICB_REASON_KILLACTIVE: - // - // This active property sheet page is changing, and this page is - // going inactive. - // - break; - - case CPSUICB_REASON_SETACTIVE: - // - // This property sheet page is about to become the active page. - // - default: - break; - } - } - - return lReturn; -} - - -//+--------------------------------------------------------------------------- -// -// Member: -// -// Synopsis: -// Creates and Initializes OptItems. -// -// Returns: -// Pointer to an array of optitems on success, else -// NULL on failure. -// -// -//---------------------------------------------------------------------------- -POPTITEM -CreateOptItems( - HANDLE hHeap, - // Heap to allocate data from - DWORD dwOptItems - // Number of opt items to allocate. - ) -{ - VERBOSE(DLLTEXT("CreateOptItems entry.")); - - POPTITEM pOptItems = NULL; - // OPTITEMs to be returned to caller. - - ULONG cbOptItems = 0; - // Number of bytes needed for optitems. - - // Allocate memory for OptItems. - if (SUCCEEDED(ULongMult( sizeof(OPTITEM), dwOptItems, &cbOptItems)) && - (pOptItems = (POPTITEM)HeapAlloc(hHeap, HEAP_ZERO_MEMORY, cbOptItems)) != NULL) - { - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for (DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } - } - else - { - ERR(ERRORTEXT("CreateOptItems() failed to allocate memory for OPTITEMs!\r\n")); - } - - return pOptItems; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.def b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.def deleted file mode 100644 index bf87f4c2..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.def +++ /dev/null @@ -1,18 +0,0 @@ -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -; -; Abstract: -; -; This file contains a listing of all of the methods to be exported -; from the DLL, as well as rules for how to name the exports. -; - -LIBRARY UIREPPLUG - -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.h b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.h deleted file mode 100644 index 52980245..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.h +++ /dev/null @@ -1,55 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: UNIUIREP.H -// -// PURPOSE: Define common data types, and external function prototypes -// for UI replacement sample. -// -//-------------------------------------------------------------------------- - -#pragma once - -#define DLLTEXT(s) TEXT("[UIREPPLUG] ") TEXT(s) -#define FUNCTEXT(s) _T(__FUNCTION__) TEXT(s) -#define ERRORTEXT(s) TEXT("ERROR ") DLLTEXT(s) - -// -// OEM Signature is used to identify the -// private DEVMODE portion to mitigate against -// data corruption. Replace this with a unique string -// for your organization. -// -#define OEM_SIGNATURE 'UIRP' -#define OEM_VERSION 0x00000001L - -// -// OEM Signature and version. -// -#define PROP_TITLE L"UIRepPlug Page" - -// -// Printer registry keys where OEM data is stored. -// -#define UIREPPLUG_VALUE TEXT("UIREPPLUG_VALUE") -#define UIREPPLUG_DEVICE_VALUE TEXT("UIREPPLUG_DEVICE_VALUE") - -// -// Method prototypes -// - -HRESULT -hrCommonPropSheetMethod( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam, - IPrintCoreHelper* pHelper, - CFeatureCollection* pFeatures, - DWORD dwMode - ); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.rc b/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.rc deleted file mode 100644 index 67cad8ae..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/uniuirep/src/uniuirep.rc +++ /dev/null @@ -1,192 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2005 Microsoft Corporation. All Rights Reserved. -// -// FILE: uniuirep.rc -// -// PURPOSE: Resource script containing all localizable strings for this -// module -// -//-------------------------------------------------------------------------- - -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "UI Replacement PrintTicket Plugin." - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "UIREPPLUG" - VALUE "LegalCopyright", "Copyright © 1998 - 2005 Microsoft Corp." - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "UIREPPLUG.dll" - VALUE "ProductName", "Microsoft UIREPPLUG" - VALUE "ProductVersion", "1.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_SECTION "UIRepPlug Added Item" - IDS_NAME "UI Replacement PrintTicket Plugin" - IDS_DEVICE_SETTINGS_NAME "Device Settings" - IDS_CONSTRAINT_CONFLICT "There are one or more conflicting settings.\r\nDo you want driver to automatically resolve conflicts?" -END - -STRINGTABLE -BEGIN - IDS_RESDLL "Resource DLL" - IDS_GRAPHICS_MODE "Graphics Mode" - IDS_DUPLEX_UNIT "Duplex Unit" -END - -STRINGTABLE -BEGIN - IDS_UNIRESDLL "unires.dll" - IDS_RESOLUTION_600_DPI "600 x 600 dots per inch" - IDS_RESOLUTION_300_DPI "300 x 300 dots per inch" - IDS_RESOLUTION_150_DPI "150 x 150 dots per inch" - IDS_RASTERMODE "Raster mode" - IDS_HPGL2MODE "HPGL2 mode" - IDS_PAPERSIZE_LETTER "Letter" - IDS_PAPERSIZE_LEGAL "Legal" - IDS_PAPERSIZE_EXECUTIVE "Executive" - IDS_PAPERSIZE_A4 "A4" - IDS_PAPERSIZE_B5 "B5" - IDS_COLORMODE_MONO "Monochrome" - IDS_COLORMODE_24BPP "24 bits per pixel" - IDS_MISSINGNAME "" -END - -STRINGTABLE -BEGIN - IDS_COLORMODE_8BPP "8 bits per pixel" - IDS_HALFTONE_AUTO "Auto Select" - IDS_HALFTONE_SUPERCELL_M "Super Cell" - IDS_HALFTONE_6x6_M "Dither 6x6" - IDS_HALFTONE_8x8_M "Dither 8x8" - IDS_UIREP_ENVTRAY "Envelope Feeder Tray" - IDS_INSTALLED_MEMORY "Device Memory" - IDS_MEMORY_STD "Standard Memory" - IDS_MEMORY_UPGRADE "16MB Upgrade" - -END - -STRINGTABLE -BEGIN - IDS_OUTBIN_STACKER "Stacker" - IDS_OUTBIN_DEFAULT "Default" -END - -STRINGTABLE -BEGIN - IDS_METAFILE_SPOOLING "Advanced Printing Features" - IDS_TEXT_ASGRX "Print Optimizations" -END - -STRINGTABLE -BEGIN - IDS_TTDL_DEFAULT "Automatic" - IDS_TTDL_TYPE1 "Outline" - IDS_TTDL_TYPE3 "Bitmap" - IDS_TTDL_TYPE42 "Native TrueType" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.cpp deleted file mode 100644 index 71ffc11d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - -// This file is wrapped in fdevmode.cpp in other parts of the watermark sample. -// The appropriate precompiled header should be included there. -// #include "precomp.h - -#include "debug.h" -#include "devmode.h" - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - HRESULT hResult = S_OK; - POEMDEV pOEMDevIn = NULL; - POEMDEV pOEMDevOut = NULL; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR(DLLTEXT("DevMode() ERROR_INVALID_PARAMETER.\r\n")); - - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - case OEMDM_DEFAULT: - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->bEnabled = WATER_MARK_DEFAULT_ENABLED; - pOEMDevOut->dfRotate = WATER_MARK_DEFAULT_ROTATION; - pOEMDevOut->dwFontSize = WATER_MARK_DEFAULT_FONTSIZE; - pOEMDevOut->crTextColor = WATER_MARK_DEFAULT_COLOR; - hResult = StringCbCopyW(pOEMDevOut->szWaterMark, sizeof(pOEMDevOut->szWaterMark), WATER_MARK_DEFAULT_TEXT); - break; - - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return hResult; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut) -{ - HRESULT hCopy = S_OK; - - - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR(DLLTEXT("ConvertOEMDevmode() invalid parameters.\r\n")); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE(DLLTEXT("Converting private OEM Devmode.\r\n")); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->bEnabled = WATER_MARK_DEFAULT_ENABLED; - pOEMDevOut->dfRotate = WATER_MARK_DEFAULT_ROTATION; - pOEMDevOut->dwFontSize = WATER_MARK_DEFAULT_FONTSIZE; - pOEMDevOut->crTextColor = WATER_MARK_DEFAULT_COLOR; - hCopy = StringCbCopyW(pOEMDevOut->szWaterMark, sizeof(pOEMDevOut->szWaterMark), WATER_MARK_DEFAULT_TEXT); - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING(DLLTEXT("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n")); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->bEnabled = WATER_MARK_DEFAULT_ENABLED; - pOEMDevOut->dfRotate = WATER_MARK_DEFAULT_ROTATION; - pOEMDevOut->dwFontSize = WATER_MARK_DEFAULT_FONTSIZE; - pOEMDevOut->crTextColor = WATER_MARK_DEFAULT_COLOR; - hCopy = StringCbCopyW(pOEMDevOut->szWaterMark, sizeof(pOEMDevOut->szWaterMark), WATER_MARK_DEFAULT_TEXT); - } - - return SUCCEEDED(hCopy); -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // bEnable should be either TRUE or FALSE. - if( (TRUE != pOEMDevmode->bEnabled) - && - (FALSE != pOEMDevmode->bEnabled) - ) - { - pOEMDevmode->bEnabled = WATER_MARK_DEFAULT_ENABLED; - } - - // dfRotate should be between 0 and 360 inclusive. - if( (0 > pOEMDevmode->dfRotate) - || - (360 < pOEMDevmode->dfRotate) - ) - { - pOEMDevmode->dfRotate = WATER_MARK_DEFAULT_ROTATION; - } - - // dwFontSize should be 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, or 72. - if(!IsValidFontSize(pOEMDevmode->dwFontSize)) - { - pOEMDevmode->dwFontSize = WATER_MARK_DEFAULT_FONTSIZE; - } - - // The high byte of the hi word should be zero. - if(0 != HIBYTE(HIWORD(pOEMDevmode->crTextColor))) - { - pOEMDevmode->crTextColor = WATER_MARK_DEFAULT_COLOR; - } - - // Make sure that water mark string is terminated. - pOEMDevmode->szWaterMark[WATER_MARK_TEXT_SIZE - 1] = L'\0'; - - return TRUE; -} - - -BOOL IsValidFontSize(DWORD dwFontSize) -{ - BOOL bValid = FALSE; - - - switch(dwFontSize) - { - case 8: - case 9: - case 10: - case 11: - case 12: - case 14: - case 16: - case 18: - case 20: - case 22: - case 24: - case 26: - case 28: - case 36: - case 48: - case 72: - bValid = TRUE; - break; - - default: - ERR(DLLTEXT("IsValidFontSize() found invalid font size\r\n")); - break; - } - - return bValid; -} - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.h deleted file mode 100644 index f9df1f26..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/devmode.h +++ /dev/null @@ -1,56 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - -#define WATER_MARK_TEXT_SIZE 128 -#define WATER_MARK_DEFAULT_ENABLED TRUE -#define WATER_MARK_DEFAULT_ROTATION 30 -#define WATER_MARK_DEFAULT_FONTSIZE 28 -#define WATER_MARK_DEFAULT_COLOR RGB(230, 230, 230) -#define WATER_MARK_DEFAULT_TEXT L"WaterMark" - - - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - BOOL bEnabled; - DOUBLE dfRotate; - DWORD dwFontSize; - COLORREF crTextColor; - WCHAR szWaterMark[WATER_MARK_TEXT_SIZE]; - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); -BOOL IsValidFontSize(DWORD dwFontSize); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/oem.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/oem.h deleted file mode 100644 index f9615579..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/common/oem.h +++ /dev/null @@ -1,24 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997- 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: oem.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debug.cpp. -// - -#pragma once - - -//////////////////////////////////////////////////////// -// OEM Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj deleted file mode 100644 index 47a5db53..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj +++ /dev/null @@ -1,1090 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {4B90E6E4-34B2-460F-9BF7-D75B5334F2E5} - $(MSBuildProjectName) - Win10 Debug - Win32 - {37DC3583-1F5D-4DB4-A930-535E9C096174} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - WMARKPS - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - WMARKPS.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj.Filters deleted file mode 100644 index 7e7da8cc..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMARKPS.vcxproj.Filters +++ /dev/null @@ -1,137 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {7E7CEB8F-7E3D-4FBB-AEBE-D62B0C9D9B2E} - - - h;hpp;hxx;hm;inl;inc;xsd - {88C3214E-2B6E-4482-A2B8-16CD0E6A9A3A} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {3A0703EF-8A1F-4955-8F7E-0765109DEBF0} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.def b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.def deleted file mode 100644 index fcfcd598..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY WMARKPS -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.rc b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.rc deleted file mode 100644 index 9653478a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/WMarkPS.rc +++ /dev/null @@ -1,130 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Neutral resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// PSCRIPT -// - -IDR_WATERMARK_DRAW RC_PSCRIPT drawmark.ps -IDR_WATERMARK_PROLOGUE RC_PSCRIPT wmark.ps - -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team\0" - VALUE "CompanyName", "Microsoft Corp.\0" - VALUE "FileDescription", "OEM Customization Water Mark Sample\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "WMarkPS\0" - VALUE "LegalCopyright", "Copyright © 1998-2003\0" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0" - VALUE "OriginalFilename", "WMarkPS.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Microsoft WaterMark\0" - VALUE "ProductVersion", "1.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.cpp deleted file mode 100644 index e4758d1c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.cpp +++ /dev/null @@ -1,410 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: command.cpp -// -// PURPOSE: Source module for OEM customized Command(s). -// - -#include "precomp.h" -#include "wmarkps.h" -#include "debug.h" -#include "command.h" -#include "resource.h" - - - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -///////////////////////////////////////////////////////// -// Internal Macros & Defines -///////////////////////////////////////////////////////// - -// Macros to convert from Windows RGB to PostScript RGB -#define GetPS2Color(dw) ((dw) / 255.0) -#define GetPS2RValue(cr) (GetPS2Color(GetRValue(cr))) -#define GetPS2GValue(cr) (GetPS2Color(GetGValue(cr))) -#define GetPS2BValue(cr) (GetPS2Color(GetBValue(cr))) - - -// Initial buffer size -#define INITIAL_BUFFER_SIZE 16 - - -// String format defines characters -#define FORMAT_DELIM '!' -#define FORMAT_STRING_ANSI 's' -#define FORMAT_STRING_UNICODE 'S' -#define FORMAT_CHAR '%' - - -// Loop limiter. -#define MAX_LOOP 10 - - -///////////////////////////////////////////////////////// -// Internal ProtoTypes -///////////////////////////////////////////////////////// - -static PSTR GetPostScriptResource(HMODULE hModule, LPCTSTR pszResource, PDWORD pdwSize); -static PSTR CreateWaterMarkProlog(HMODULE hModule, PDWORD pdwSize, _In_ LPWSTR pszWaterMark, - DWORD dwFontSize, _In_ LPSTR pszColor, _In_ LPSTR pszAngle); -static PSTR DoWaterMarkProlog(HMODULE hModule, POEMDEV pOemDevmode, PDWORD pdwSize); -static DWORD FormatResource(_In_ LPSTR pszResource, _Out_ LPSTR *ppszProlog, ...); - - -//////////////////////////////////////////////////////////////////////////////////// -// The PSCRIPT driver calls this OEM function at specific points during output -// generation. This gives the OEM DLL an opportunity to insert code fragments -// at specific injection points in the driver's code. It should use -// DrvWriteSpoolBuf for generating any output it requires. - -HRESULT PSCommand(PDEVOBJ pdevobj, DWORD dwIndex, PVOID pData, DWORD cbSize, - IPrintOemDriverPS* pOEMHelp, PDWORD pdwReturn) -{ - BOOL bFreeProcedure = FALSE; - PSTR pProcedure = NULL; - DWORD dwLen = 0; - DWORD dwSize = 0; - HRESULT hResult = E_FAIL; - - VERBOSE(DLLTEXT("Entering OEMCommand...\r\n")); - - UNREFERENCED_PARAMETER(pData); - UNREFERENCED_PARAMETER(cbSize); - - switch (dwIndex) - { - case PSINJECT_BEGINPROLOG: - { - POEMDEV pOemDevmode = (POEMDEV) pdevobj->pOEMDM; - - - VERBOSE(DLLTEXT("OEMCommand PSINJECT_BEGINPROLOG\r\n")); - - // Only do Water Mark PS prolog injection if Water Mark is enabled. - if(pOemDevmode->bEnabled) - { - pProcedure = DoWaterMarkProlog((HMODULE) pdevobj->hOEM, pOemDevmode, &dwSize); - bFreeProcedure = (NULL != pProcedure); - } - } - break; - - case PSINJECT_BEGINPAGESETUP: - { - POEMDEV pOemDevmode = (POEMDEV) pdevobj->pOEMDM; - - - VERBOSE(DLLTEXT("OEMCommand PSINJECT_BEGINPAGESETUP\r\n")); - - // Only do Water Mark PS page injection if Water Mark is enabled. - if(pOemDevmode->bEnabled) - { - pProcedure = GetPostScriptResource((HMODULE) pdevobj->hOEM, MAKEINTRESOURCE(IDR_WATERMARK_DRAW), &dwSize); - } - } - break; - - default: - VERBOSE(DLLTEXT("PSCommand Default...\r\n")); - *pdwReturn = ERROR_NOT_SUPPORTED; - return E_NOTIMPL; - } - - if(NULL != pProcedure) - { - // Write PostScript to spool file. - dwLen = (DWORD)strlen(pProcedure); - if (dwLen > 0) - { - hResult = pOEMHelp->DrvWriteSpoolBuf(pdevobj, pProcedure, dwLen, &dwSize); - } - - // Set return values. - if(SUCCEEDED(hResult) && (dwLen == dwSize)) - { - *pdwReturn = ERROR_SUCCESS; - } - else - { - // Try to return meaningful - // error value. - *pdwReturn = GetLastError(); - if(ERROR_SUCCESS == *pdwReturn) - { - *pdwReturn = ERROR_WRITE_FAULT; - } - - // Make sure we return failure - // if the write didn't succeded. - if(SUCCEEDED(hResult)) - { - hResult = HRESULT_FROM_WIN32(*pdwReturn); - } - } - - if(bFreeProcedure) - { - // INVARIANT: pProcedure was created with 'new' and needs to be freed. - delete[] pProcedure; - } - } - else - { - // pProcedure will be NULL if water mark isn't enabled. - *pdwReturn = ERROR_NOT_SUPPORTED; - hResult = E_NOTIMPL; - } - - // dwLen should always equal dwSize. - ASSERT(dwLen == dwSize); - - return hResult; -} - - -//////////////////////////////////////////////////////////////////////////////////// -// -// Retrieves pointer to a PostScript resource. -// -static PSTR GetPostScriptResource(HMODULE hModule, LPCTSTR pszResource, PDWORD pdwSize) -{ - PSTR pszPostScript = NULL; - HRSRC hFind = NULL; - HGLOBAL hResource = NULL; - - - VERBOSE(DLLTEXT("GetPostScriptResource() entered.\r\n")); - - // pszResource and pdwSize Parameters should not be NULL. - assert(NULL != pszResource); - assert(NULL != pdwSize); - - // Load PostScript resource. - hFind = FindResource(hModule, pszResource, MAKEINTRESOURCE(RC_PSCRIPT)); - //hFind = FindResource(hModule, pszResource, TEXT("PSCRIPT")); - if(NULL != hFind) - { - hResource = LoadResource(hModule, hFind); - if(NULL != hResource) - { - pszPostScript = (PSTR) LockResource(hResource); - *pdwSize = SizeofResource(hModule, hFind); - } - else - { - ERR(DLLTEXT("ERROR: Failed to load PSCRIPT resource!\r\n")); - } - } - else - { - ERR(DLLTEXT("ERROR: Failed to find PSCRIPT resource!\r\n")); - } - - // Should have found the PScript resource. - ASSERT(NULL != pszPostScript); - - return pszPostScript; -} - - -//////////////////////////////////////////////////////////////////////////////////// -// -// Formats Water Mark prolog with parameter. -// -static PSTR CreateWaterMarkProlog(HMODULE hModule, PDWORD pdwSize, _In_ LPWSTR pszWaterMark, - DWORD dwFontSize, _In_ LPSTR pszColor, _In_ LPSTR pszAngle) -{ - PSTR pszProlog = NULL; - PSTR pszResource = NULL; - - // Parameters that are pointers should not be NULL! - if (NULL == pdwSize || - NULL == pszWaterMark || - NULL == pszColor || - NULL == pszAngle) - { - ERR(DLLTEXT("CreateWaterMarkProlog: Invalid argument\r\n")); - return NULL; - } - - // Get Water Mark prolog resource. - pszResource = GetPostScriptResource(hModule, MAKEINTRESOURCE(IDR_WATERMARK_PROLOGUE), pdwSize); - - // Allocate and format the Water Mark Prolog with the correct values. - if(NULL != pszResource) - { - *pdwSize = FormatResource(pszResource, &pszProlog, pszWaterMark, dwFontSize, pszColor, pszAngle); - } - else - { - ERR(DLLTEXT("CreateWaterMarkProlog: Failed to get resource\r\n")); - } - - return pszProlog; -} - - -//////////////////////////////////////////////////////////////////////////////////// -// -// Does the pre-formating of parameters before calling the routine -// that creates the prolog. -// -static PSTR DoWaterMarkProlog(HMODULE hModule, POEMDEV pOemDevmode, PDWORD pdwSize) -{ - PSTR pszProlog = NULL; - - // Parameters should not be NULL. - if (NULL == hModule || - NULL == pOemDevmode || - NULL == pdwSize) - { - ERR(DLLTEXT("CreateWaterMarkProlog: Invalid argument\r\n")); - return NULL; - } - - // Only do prolog if Water Mark is enabled. - if(pOemDevmode->bEnabled) - { - CHAR szColor[INITIAL_BUFFER_SIZE] = "\0"; - DWORD dwAngleSize = INITIAL_BUFFER_SIZE; - LPSTR pszAngle = NULL; - - // Format angle as a string. - do - { - if(NULL != pszAngle) - { - delete[] pszAngle; - dwAngleSize *= 2; - } - pszAngle = new CHAR[dwAngleSize]; - - } while( (NULL != pszAngle) - && - (dwAngleSize < 1024) - && - (FAILED(StringCbPrintfA(pszAngle, dwAngleSize, "%.1f", pOemDevmode->dfRotate)) ) - ); - - if(NULL != pszAngle) - { - // Format text color as string. - if(FAILED(StringCbPrintfA(szColor, sizeof(szColor), - "%1.2f %1.2f %1.2f", - GetPS2RValue(pOemDevmode->crTextColor), - GetPS2GValue(pOemDevmode->crTextColor), - GetPS2BValue(pOemDevmode->crTextColor)))) - { - ERR(DLLTEXT("DoWaterMarkProlog() failed to create PostScript color string for water mark.")); - } - - // Create Water Mark prolog. - pszProlog = CreateWaterMarkProlog(hModule, pdwSize, pOemDevmode->szWaterMark, - pOemDevmode->dwFontSize, szColor, pszAngle); - - // Angle string is no longer needed. - delete[] pszAngle; - } - } - - return pszProlog; -} - - -//////////////////////////////////////////////////////////////////////////////////// -// -// Formats Resource. -// -static DWORD FormatResource(_In_ LPSTR pszResource, _Out_ LPSTR *ppszBuffer, ...) -{ - DWORD dwSize = (DWORD)strlen(pszResource) + MAX_PATH; - DWORD dwLoop = 0; - va_list vaList; - HRESULT hResult = E_FAIL; - - - va_start(vaList, ppszBuffer); - - // *ppszBuffer should be NULL when passed in. - *ppszBuffer = NULL; - - // Allocate and format the string. - do { - - if(NULL != *ppszBuffer) - { - delete[] *ppszBuffer; - } - *ppszBuffer = new CHAR[dwSize]; - if(NULL == *ppszBuffer) - { - goto Cleanup; - } - - hResult = StringCbVPrintfA(*ppszBuffer, dwSize, pszResource, vaList); - - if(STRSAFE_E_INSUFFICIENT_BUFFER == hResult) - { - dwSize *= 2; - } - - } while ( FAILED(hResult) && (dwLoop++ < MAX_LOOP)); - -Cleanup: - - // Check to see if we hit error. - if(FAILED(hResult)) - { - if(NULL != *ppszBuffer) - { - delete[] *ppszBuffer; - *ppszBuffer = NULL; - } - } - - va_end(vaList); - - if(*ppszBuffer) - { - DWORD dwToReturn = 0; - - if(SUCCEEDED(SIZETToDWord(strlen(*ppszBuffer), &dwToReturn))) - { - return dwToReturn; - } - } - return 0; -} - - -DWORD CharSize(DWORD dwValue, DWORD dwBase) -{ - DWORD dwSize = 1; - - - // Make sure taht base is more than 2. - if(dwBase < 2) - { - return dwSize; - } - - // Loop until dwValue is less than dwBase, - // dividing by dwBase each time. - while(dwValue >= dwBase) - { - dwValue /= dwBase; - ++dwSize; - } - - return dwSize; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.h deleted file mode 100644 index 4b74bd77..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/command.h +++ /dev/null @@ -1,22 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Command.h -// -// -// PURPOSE: Define common data types, and external function prototypes -// for OEM Command function(s). -// -#pragma once - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT PSCommand(PDEVOBJ, DWORD, PVOID, DWORD, IPrintOemDriverPS*, PDWORD pdwReturn); - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/dllentry.cpp deleted file mode 100644 index 3aa73908..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/dllentry.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// -// PURPOSE: Source module for DLL entry function(s). -// -// - -#include "precomp.h" -#include "wmarkps.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// - -// DllMain isn't called/used for kernel mode version. -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/drawmark.ps b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/drawmark.ps deleted file mode 100644 index 4e0fa74e..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/drawmark.ps and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/fdevmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/fdevmode.cpp deleted file mode 100644 index e7e2d472..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/fdevmode.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: fDevmode.cpp -// -// -// PURPOSE: Place holder file for devmode functions. -// - -#include "precomp.h" -#include "wmarkps.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -#include diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.cpp deleted file mode 100644 index 5e892275..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.cpp +++ /dev/null @@ -1,491 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Interface for User Mode COM Customization DLL. -// -// -#pragma once - -#include "precomp.h" - -#include "wmarkps.h" -#include "debug.h" -#include "command.h" -#include "intrface.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0; // Count of active components -static long g_cServerLocks = 0; // Count of locks - - -//////////////////////////////////////////////////////////////////////////////// -// -// IWaterMarkPS body -// -IWaterMarkPS::~IWaterMarkPS() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - - -HRESULT __stdcall IWaterMarkPS::QueryInterface(const IID& iid, void** ppv) -{ - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IWaterMarkPS::QueryInterface IUnknown.\r\n")); - } - else if (iid == IID_IPrintOemPS) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IWaterMarkPS::QueryInterface IPrintOemPs.\r\n")); - } - else - { -#if DBG && defined(USERMODE_DRIVER) - TCHAR szOutput[80] = {0}; - StringFromGUID2(iid, szOutput, _countof(szOutput)); // can not fail! - VERBOSE(DLLTEXT("IWaterMarkPS::QueryInterface interface not supported.\r\n")); -#endif - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall IWaterMarkPS::AddRef() -{ - VERBOSE(DLLTEXT("IWaterMarkPS::AddRef() entry.\r\n")); - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IWaterMarkPS::Release() -{ - VERBOSE(DLLTEXT("IWaterMarkPS::Release() entry.\r\n")); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - - -HRESULT __stdcall IWaterMarkPS::GetInfo ( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IWaterMarkPS::GetInfo entry.\r\n")); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - VERBOSE(DLLTEXT("IWaterMarkPS::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size. - if(OEMGI_GETPUBLISHERINFO != dwMode) - { - *pcbNeeded = sizeof(DWORD); - } - else - { - *pcbNeeded = sizeof(PUBLISHERINFO); - return E_FAIL; - } - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("IWaterMarkPS::GetInfo() exit insufficient buffer!\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - case OEMGI_GETPUBLISHERINFO: - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IWaterMarkPS::GetInfo() exit mode not supported.\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - return S_OK; -} - -HRESULT __stdcall IWaterMarkPS::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE(DLLTEXT("IWaterMarkPS::PublishDriverInterface() entry.\r\n")); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (this->m_pOEMHelp == NULL) - { - HRESULT hResult; - - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverPS, (void** ) &(this->m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - this->m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - - -HRESULT __stdcall IWaterMarkPS::EnableDriver(DWORD dwDriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded) -{ - VERBOSE(DLLTEXT("IWaterMarkPS::EnableDriver() entry.\r\n")); - - UNREFERENCED_PARAMETER(dwDriverVersion); - UNREFERENCED_PARAMETER(cbSize); - UNREFERENCED_PARAMETER(pded); - - // Need to return S_OK so that DisableDriver() will be called, which Releases - // the reference to the Printer Driver's interface. - // If error occurs, return E_FAIL. - return S_OK; -} - -HRESULT __stdcall IWaterMarkPS::DisableDriver(VOID) -{ - VERBOSE(DLLTEXT("IWaterMarkPS::DisaleDriver() entry.\r\n")); - - // Release reference to Printer Driver's interface. - if (this->m_pOEMHelp) - { - this->m_pOEMHelp->Release(); - this->m_pOEMHelp = NULL; - } - - return S_OK; -} - -HRESULT __stdcall IWaterMarkPS::DisablePDEV( - PDEVOBJ pdevobj) -{ - VERBOSE(DLLTEXT("IWaterMarkPS::DisablePDEV() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IWaterMarkPS::EnablePDEV( - PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem) -{ - VERBOSE(DLLTEXT("IWaterMarkPS::EnablePDEV() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(cPatterns); - UNREFERENCED_PARAMETER(phsurfPatterns); - UNREFERENCED_PARAMETER(cjGdiInfo); - UNREFERENCED_PARAMETER(pGdiInfo); - UNREFERENCED_PARAMETER(cjDevInfo); - UNREFERENCED_PARAMETER(pDevInfo); - UNREFERENCED_PARAMETER(pded); - UNREFERENCED_PARAMETER(pDevOem); - - return E_NOTIMPL; -} - - -HRESULT __stdcall IWaterMarkPS::ResetPDEV( - PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew) -{ - VERBOSE(DLLTEXT("IWaterMarkPS::ResetPDEV() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobjOld); - UNREFERENCED_PARAMETER(pdevobjNew); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkPS::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE(DLLTEXT("IWaterMarkPS:DevMode entry.\n")); - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IWaterMarkPS::Command( - PDEVOBJ pdevobj, - DWORD dwIndex, - PVOID pData, - DWORD cbSize, - OUT DWORD *pdwResult) -{ - HRESULT hResult = E_NOTIMPL; - - - VERBOSE(DLLTEXT("IWaterMarkPS::Command() entry.\r\n")); - hResult = PSCommand(pdevobj, dwIndex, pData, cbSize, m_pOEMHelp, pdwResult); - - return hResult; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - VERBOSE(DLLTEXT("IOemCF::QueryInterface interface not supported.\r\n")); - *ppv = NULL; - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - //VERBOSE(DLLTEXT("Class factory:\t\tCreate component.")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - // Create component. - IWaterMarkPS* pOemCP = new IWaterMarkPS; - if (pOemCP == NULL) - { - return E_OUTOFMEMORY; - } - - // Get the requested interface. - HRESULT hr = pOemCP->QueryInterface(iid, ppv); - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCP->Release(); - return hr; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - return S_OK; -} - - -// -// Registration functions -// - -// -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - VERBOSE(DLLTEXT("DllCanUnloadNow entered.\r\n")); - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:\tCreate class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMRENDER) - { - return CLASS_E_CLASSNOTAVAILABLE; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv); - pFontCF->Release(); - - return hr; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.h deleted file mode 100644 index 7a4a3c84..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/intrface.h +++ /dev/null @@ -1,116 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.H -// -// -// PURPOSE: Define COM interface for User Mode Printer Customization DLL. -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IWaterMarkPS -// -// Interface for PostScript OEM sample rendering module -// -class IWaterMarkPS : public IPrintOemPS -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Method for OEM to specify DDI hook out - // - - STDMETHOD(EnableDriver) (THIS_ DWORD DriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded); - - // - // Method to notify OEM plugin that it is no longer required - // - - STDMETHOD(DisableDriver) (THIS); - - // - // Method for OEM to contruct its own PDEV - // - - STDMETHOD(EnablePDEV) (THIS_ PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem); - - // - // Method for OEM to free any resource associated with its PDEV - // - - STDMETHOD(DisablePDEV) (THIS_ PDEVOBJ pdevobj); - - // - // Method for OEM to transfer from old PDEV to new PDEV - // - - STDMETHOD(ResetPDEV) (THIS_ PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew); - - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, - POEMDMPARAM pOemDMParam); - - // - // OEMCommand - PSCRIPT only, return E_NOTIMPL on Unidrv - // - - STDMETHOD(Command) (THIS_ PDEVOBJ pdevobj, - DWORD dwIndex, - PVOID pData, - DWORD cbSize, - OUT DWORD *pdwResult); - - // - - IWaterMarkPS() { m_cRef = 1; m_pOEMHelp = NULL; }; - ~IWaterMarkPS(); - -protected: - LONG m_cRef; - IPrintOemDriverPS* m_pOEMHelp; -}; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precomp.h deleted file mode 100644 index 1c44a730..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precomp.h +++ /dev/null @@ -1,51 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.h -// -// PURPOSE: Header files that should be in the precompiled header. - -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Safe integer functions to detect integer overflow/underflow conditions: -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/resource.h deleted file mode 100644 index 819dbd98..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/resource.h +++ /dev/null @@ -1,18 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by WMarkPS.rc -// -#define IDR_WATERMARK_PROLOGUE 1 -#define IDR_WATERMARK_DRAW 2 -#define RC_PSCRIPT 0x5053 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmark.ps b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmark.ps deleted file mode 100644 index e9200e65..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmark.ps +++ /dev/null @@ -1,33 +0,0 @@ -userdict /DrawWaterMark { -userdict begin -/Watermark (%ls) def -/FontSize %d def -/Font /Helvetica def -/WaterMarkColor {%s setrgbcolor} bind def -/Angle %s def - -gsave -initgraphics - -Angle rotate - -clippath -pathbbox /MaxY exch def /MaxX exch def /MinY exch def /MinX exch def - -Font findfont FontSize scalefont setfont -/MarkLen Watermark stringwidth pop 1.20 mul def -WaterMarkColor - -MinY FontSize MaxY -{ - MinX MarkLen MaxX - { - 1 index moveto Watermark show - } for - pop -} bind for -grestore -end -} bind put - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmarkps.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmarkps.h deleted file mode 100644 index d16c6581..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkps/wmarkps.h +++ /dev/null @@ -1,25 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: WMarkPS.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debug.cpp. -// -#pragma once - -#include -#include - - -//////////////////////////////////////////////////////// -// OEM Defines -//////////////////////////////////////////////////////// - -#define DLLTEXT(s) "WMARKPS: " s - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj deleted file mode 100644 index 323f5446..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj +++ /dev/null @@ -1,1096 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {BE3E261C-4EF8-4BC2-AAD2-49F1292512CE} - $(MSBuildProjectName) - Win10 Debug - Win32 - {975265B8-77E8-4C62-AD5A-C554605BE6DF} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - WMARKUI - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - WMARKUI.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj.Filters deleted file mode 100644 index d5115804..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/WMARKUI.vcxproj.Filters +++ /dev/null @@ -1,140 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {0B03BE39-8181-4B6F-B5BE-004CA8F13B55} - - - h;hpp;hxx;hm;inl;inc;xsd - {F94EBF1D-EB81-461D-9960-95F6ABDC92C2} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {43EA5B9C-BE86-4C59-BE80-7DAF38D33EEE} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/dllentry.cpp deleted file mode 100644 index ae16c921..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/dllentry.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// -// PURPOSE: Source module for DLL entry function(s). -// - - -#include "precomp.h" -#include "wmarkui.h" -#include "debug.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/fdevmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/fdevmode.cpp deleted file mode 100644 index bc8d4b6e..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/fdevmode.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: fDevmode.cpp -// -// -// PURPOSE: Place holder file for devmode functions. -// - - -#include "precomp.h" -#include "wmarkui.h" - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -#include diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.cpp deleted file mode 100644 index 39f8e57a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.cpp -// -// -// PURPOSE: File that contains all the globals. -// - -#pragma once -#include "precomp.h" -#include "wmarkui.h" - - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.h deleted file mode 100644 index 5472f514..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/globals.h +++ /dev/null @@ -1,22 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.h -// -// -// PURPOSE: Lists of globals declared in Globals.cpp. -// - -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -extern HINSTANCE ghInstance; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.cpp deleted file mode 100644 index d610f46d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.cpp +++ /dev/null @@ -1,522 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.cpp -// -// PURPOSE: Implement the UI interface plug-in -// - -#include "precomp.h" - -#include "wmarkui.h" -#include "debug.h" -#include "intrface.h" - - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0 ; // Count of active components -static long g_cServerLocks = 0 ; // Count of locks - - - -//////////////////////////////////////////////////////////////////////////////// -// -// IWaterMarkUI body -// -HRESULT __stdcall IWaterMarkUI::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:QueryInterface entry.\r\n\r\n")); - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IWaterMarkUI:Return pointer to IUnknown.\r\n\r\n")); - } - else if (iid == IID_IPrintOemUI) - { - *ppv = static_cast(this) ; - VERBOSE(DLLTEXT("IWaterMarkUI:Return pointer to IPrintOemUI.\r\n")); - } - else - { - VERBOSE(DLLTEXT("IWaterMarkUI::QueryInterface: interface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IWaterMarkUI::AddRef() -{ - VERBOSE(DLLTEXT("IWaterMarkUI:AddRef entry.\r\n")); - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IWaterMarkUI::Release() -{ - VERBOSE(DLLTEXT("IWaterMarkUI:Release entry.\r\n")); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -HRESULT __stdcall IWaterMarkUI::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:PublishDriverInterface entry.\r\n")); - - UNREFERENCED_PARAMETER(pIUnknown); - - // Don't use the DriverInterface, so don't store it. - - return S_OK; -} - -HRESULT __stdcall IWaterMarkUI::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IWaterMarkUI::GetInfo entry.\r\r\n")); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - VERBOSE(DLLTEXT("IWaterMarkUI::GetInfo() exit pcbNeeded is NULL!\r\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("IWaterMarkUI::GetInfo() exit insufficient buffer!\r\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IWaterMarkUI::GetInfo() exit mode not supported.\r\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(DLLTEXT("IWaterMarkUI::GetInfo() exit S_OK.\r\r\n")); - return S_OK; -} - -HRESULT __stdcall IWaterMarkUI::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DevMode entry.\r\n")); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IWaterMarkUI::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:CommonUIProp entry.\r\n")); - - return hrOEMPropertyPage(dwMode, pOemCUIPParam); -} - - -HRESULT __stdcall IWaterMarkUI::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DocumentPropertySheets entry.\r\n")); - - UNREFERENCED_PARAMETER(pPSUIInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DevicePropertySheets entry.\r\n")); - - UNREFERENCED_PARAMETER(pPSUIInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DeviceCapabilities( - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DeviceCapabilities entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DevQueryPrintEx entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:UpgradePrinter entry.\r\n")); - - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:PrinterEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DriverEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -HRESULT __stdcall IWaterMarkUI::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:QueryColorProfile entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(ulQueryMode); - UNREFERENCED_PARAMETER(pvProfileData); - UNREFERENCED_PARAMETER(pcbProfileData); - UNREFERENCED_PARAMETER(pflProfileData); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IWaterMarkUI::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:FontInstallerDlgProc entry.\r\n")); - - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IWaterMarkUI::UpdateExternalFonts( - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:UpdateExternalFonts entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this) ; - } - else - { - WARNING(DLLTEXT("IOemCF::QueryInterface: interface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - //DbgPrint(DLLTEXT("Class factory:\t\tCreate component.")) ; - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION ; - } - - // Create component. - IWaterMarkUI* pOemCB = new IWaterMarkUI ; - if (pOemCB == NULL) - { - return E_OUTOFMEMORY ; - } - // Get the requested interface. - HRESULT hr = pOemCB->QueryInterface(iid, ppv) ; - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release() ; - return hr ; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks) ; - } - else - { - InterlockedDecrement(&g_cServerLocks) ; - } - return S_OK ; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:Create class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE ; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF ; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY ; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv) ; - pFontCF->Release() ; - - return hr ; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.h deleted file mode 100644 index cccfce7d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/intrface.h +++ /dev/null @@ -1,177 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: intrface.H -// -// PURPOSE: Define the UI interface plug-in -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IWaterMarkUI -// -class IWaterMarkUI: public IPrintOemUI -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - - IWaterMarkUI() { m_cRef = 1; }; - ~IWaterMarkUI() { }; - -protected: - LONG m_cRef; -}; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precomp.h deleted file mode 100644 index e861cd21..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precomp.h +++ /dev/null @@ -1,50 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.h -// -// PURPOSE: Header files that should be in the precompiled header. - -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "WINDDIUI.H" -#include -#include -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/resource.h deleted file mode 100644 index 5993d40c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/resource.h +++ /dev/null @@ -1,24 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by wmarkui.rc -// -#define IDS_WATERMARK 1 -#define IDS_TEXT 2 -#define IDS_FONTSIZE 3 -#define IDS_ANGLE 4 -#define IDS_COLOR 5 -#define IDS_GRAY 6 -#define IDS_RED 7 -#define IDS_GREEN 8 -#define IDS_BLUE 9 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.cpp deleted file mode 100644 index c09e47c6..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.cpp +++ /dev/null @@ -1,590 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: WMarkUI.cpp -// -// -// PURPOSE: Main file for OEM UI test module. -// -// - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "wmarkui.h" - - -// This indicates to Prefast that this is a usermode driver file. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -LONG APIENTRY OEMUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems); -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams); -static DWORD FontSizeToIndex(DWORD dwFontSize); -static DWORD FontIndexToSize(DWORD dwIndex); -static DWORD TextColorToIndex(COLORREF crTextColor); -static COLORREF IndexToTextColor(DWORD dwIndex); -static PTSTR GetStringResource(HANDLE hHeap, HMODULE hModule, UINT uResource); - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM device or document property UI. -// -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hResult = S_OK; - - - VERBOSE(DLLTEXT("hrOEMPropertyPage entry.\r\n")); - - // Validate parameters. - if( (OEMCUIP_DOCPROP != dwMode) - && - (OEMCUIP_PRNPROP != dwMode) - ) - { - ERR(DLLTEXT("hrOEMPropertyPage() ERROR_INVALID_PARAMETER.\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - hResult = hrDocumentPropertyPage(dwMode, pOEMUIParam); - break; - - case OEMCUIP_PRNPROP: - // Don't have any Printer Proptery UI. - hResult = E_NOTIMPL; - break; - - default: - // Should never reach this! - ERR(DLLTEXT("hrOEMPropertyPage() Invalid dwMode")); - SetLastError(ERROR_INVALID_PARAMETER); - hResult = E_FAIL; - break; - } - - return hResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM device or document property UI. -// -LONG APIENTRY OEMUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("OEMUICallBack() entry.\r\n")); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Store OptItems state in DEVMODE. - pOEMDev->bEnabled = !pOEMUIParam->pOEMOptItems[0].Sel; - if(FAILED(StringCbCopyW(pOEMDev->szWaterMark, sizeof(pOEMDev->szWaterMark), (LPWSTR)pOEMUIParam->pOEMOptItems[1].pSel))) - { - ERR(DLLTEXT("OEMUICallBack() failed to copy water mark text\r\n")); - } - pOEMDev->dwFontSize = FontIndexToSize(pOEMUIParam->pOEMOptItems[2].Sel); - pOEMDev->dfRotate = (DOUBLE) pOEMUIParam->pOEMOptItems[3].Sel; - pOEMDev->crTextColor = IndexToTextColor(pOEMUIParam->pOEMOptItems[4].Sel); - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM document property UI. -// -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM document property UI. - pOEMUIParam->cOEMOptItems = 5; - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() requesting items.\r\n")); - } - else if(dwMode == OEMCUIP_DOCPROP) - { - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() fill out items.\r\n")); - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // Water Mark Section Name. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_WATERMARK); - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->bEnabled ? 0 : 1; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_COMBOBOX; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[0].pData = L"Enabled"; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[0].IconID = IDI_CPSUI_ON; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].pData = L"Disabled"; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = IDI_CPSUI_OFF; - - - // WaterMark Text. - pOEMUIParam->pOEMOptItems[1].Level = 2; - pOEMUIParam->pOEMOptItems[1].Flags = 0; - pOEMUIParam->pOEMOptItems[1].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_TEXT); - pOEMUIParam->pOEMOptItems[1].pSel = (LPTSTR) HeapAlloc(pOEMUIParam->hOEMHeap, HEAP_ZERO_MEMORY, MAX_PATH * sizeof(WCHAR)); - if (pOEMUIParam->pOEMOptItems[1].pSel == NULL) - { - ERR(DLLTEXT("hrDocumentPropertyPage() failed to copy water mark text\r\n")); - return E_OUTOFMEMORY; - } - - if(FAILED(StringCbCopyW((LPWSTR)pOEMUIParam->pOEMOptItems[1].pSel, MAX_PATH * sizeof(WCHAR), pOEMDev->szWaterMark))) - { - ERR(DLLTEXT("hrDocumentPropertyPage() failed to copy water mark text\r\n")); - } - - pOEMUIParam->pOEMOptItems[1].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[1].pOptType->Type = TVOT_EDITBOX; - pOEMUIParam->pOEMOptItems[1].pOptType->pOptParam[1].IconID = sizeof(((POEMDEV)NULL)->szWaterMark)/sizeof(WCHAR); - - - // WaterMark Font Size. - pOEMUIParam->pOEMOptItems[2].Level = 2; - pOEMUIParam->pOEMOptItems[2].Flags = 0; - pOEMUIParam->pOEMOptItems[2].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_FONTSIZE); - pOEMUIParam->pOEMOptItems[2].Sel = FontSizeToIndex(pOEMDev->dwFontSize); - - pOEMUIParam->pOEMOptItems[2].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 16); - - pOEMUIParam->pOEMOptItems[2].pOptType->Type = TVOT_COMBOBOX; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[0].pData = L"8"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[1].pData = L"9"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[2].pData = L"10"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[3].pData = L"11"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[4].pData = L"12"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[5].pData = L"14"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[6].pData = L"16"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[7].pData = L"18"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[8].pData = L"20"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[9].pData = L"22"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[10].pData = L"24"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[11].pData = L"26"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[12].pData = L"28"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[13].pData = L"36"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[14].pData = L"48"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[15].pData = L"72"; - - - // WaterMark Angle. - pOEMUIParam->pOEMOptItems[3].Level = 2; - pOEMUIParam->pOEMOptItems[3].Flags = 0; - pOEMUIParam->pOEMOptItems[3].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_ANGLE); - pOEMUIParam->pOEMOptItems[3].Sel = (LONG) pOEMDev->dfRotate; - - pOEMUIParam->pOEMOptItems[3].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[3].pOptType->Type = TVOT_UDARROW; - pOEMUIParam->pOEMOptItems[3].pOptType->pOptParam[1].IconID = 0; - pOEMUIParam->pOEMOptItems[3].pOptType->pOptParam[1].lParam = 360; - - - // WaterMark Color. - pOEMUIParam->pOEMOptItems[4].Level = 2; - pOEMUIParam->pOEMOptItems[4].Flags = 0; - pOEMUIParam->pOEMOptItems[4].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_COLOR); - pOEMUIParam->pOEMOptItems[4].Sel = TextColorToIndex(pOEMDev->crTextColor); - - pOEMUIParam->pOEMOptItems[4].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 4); - - pOEMUIParam->pOEMOptItems[4].pOptType->Type = TVOT_COMBOBOX; - pOEMUIParam->pOEMOptItems[4].pOptType->pOptParam[0].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_GRAY); - pOEMUIParam->pOEMOptItems[4].pOptType->pOptParam[1].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_RED); - pOEMUIParam->pOEMOptItems[4].pOptType->pOptParam[2].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_GREEN); - pOEMUIParam->pOEMOptItems[4].pOptType->pOptParam[3].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_BLUE); - } - - return S_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems. -// -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems) -{ - VERBOSE(DLLTEXT("InitOptItems() entry.\r\n")); - - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for(DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OptType for OptItem. -// -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams) -{ - POPTTYPE pOptType = NULL; - - - VERBOSE(DLLTEXT("CreateOptType() entry.\r\n")); - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - if(NULL != pOptType) - { - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, wOptParams * sizeof(OPTPARAM)); - if(NULL != pOptType->pOptParam) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - ERR(DLLTEXT("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n")); - - // Free allocated memory and return NULL. - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR(DLLTEXT("CreateOptType() failed to allocated memory for OPTTYPE!\r\n")); - } - - return pOptType; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts Font point size to index in combo box. -// -static DWORD FontSizeToIndex(DWORD dwFontSize) -{ - DWORD dwIndex; - - - switch(dwFontSize) - { - case 8: - dwIndex = 0; - break; - - case 9: - dwIndex = 1; - break; - - case 10: - dwIndex = 2; - break; - - case 11: - dwIndex = 3; - break; - - case 12: - dwIndex = 4; - break; - - case 14: - dwIndex = 5; - break; - - case 16: - dwIndex = 6; - break; - - case 18: - dwIndex = 7; - break; - - case 20: - dwIndex = 8; - break; - - case 22: - dwIndex = 9; - break; - - case 24: - dwIndex = 10; - break; - - case 26: - dwIndex = 11; - break; - - default: - case 28: - dwIndex = 12; - break; - - case 36: - dwIndex = 13; - break; - - case 48: - dwIndex = 14; - break; - - case 72: - dwIndex = 15; - break; - } - - - return dwIndex; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts Font combo box index to font point size. -// -static DWORD FontIndexToSize(DWORD dwIndex) -{ - DWORD dwFontSize = 0; - - - switch(dwIndex) - { - case 0: - dwFontSize = 8; - break; - - case 1: - dwFontSize = 9; - break; - - case 2: - dwFontSize = 10; - break; - - case 3: - dwFontSize = 11; - break; - - case 4: - dwFontSize = 12; - break; - - case 5: - dwFontSize = 14; - break; - - case 6: - dwFontSize = 16; - break; - - case 7: - dwFontSize = 18; - break; - - case 8: - dwFontSize = 20; - break; - - case 9: - dwFontSize = 22; - break; - - case 10: - dwFontSize = 24; - break; - - case 11: - dwFontSize = 26; - break; - - case 12: - dwFontSize = 28; - break; - - case 13: - dwFontSize = 36; - break; - - case 14: - dwFontSize = 48; - break; - - case 15: - dwFontSize = 72; - break; - } - - return dwFontSize; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts text color to combo box index. -// -static DWORD TextColorToIndex(COLORREF crTextColor) -{ - DWORD dwIndex; - - - // The color is what ever color is dominate. If none are, then it is gray. - if( (GetRValue(crTextColor) > GetGValue(crTextColor)) - && - (GetGValue(crTextColor) >= GetBValue(crTextColor)) - ) - { - // Set index to red. - dwIndex = 1; - } - else if( (GetRValue(crTextColor) < GetGValue(crTextColor)) - && - (GetGValue(crTextColor) > GetBValue(crTextColor)) - ) - { - // Set index to green. - dwIndex = 2; - } - else if( (GetRValue(crTextColor) <= GetGValue(crTextColor)) - && - (GetGValue(crTextColor) < GetBValue(crTextColor)) - ) - { - // Set index to blue. - dwIndex = 3; - } - else - { - // Set index to gray. - dwIndex = 0; - } - - return dwIndex; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts text combo box index to text color. -// -static COLORREF IndexToTextColor(DWORD dwIndex) -{ - COLORREF crTextColor; - - // Map index to desired text color. - // We just support 4 colors in the UI: Red, Green, Blue, and gray. - // The rendering module is capable of using any color for the Water Mark Text. - switch(dwIndex) - { - case 1: - // Color is red. - crTextColor = RGB(255, 216, 216); - break; - - case 2: - // Color is green. - crTextColor = RGB(216, 255, 216); - break; - - case 3: - // Color is blue. - crTextColor = RGB(216, 216, 255); - break; - - default: - case 0: - // Color is gray. - crTextColor = WATER_MARK_DEFAULT_COLOR; - break; - } - - return crTextColor; -} - -//////////////////////////////////////////////////////////////////////////////////// -// -// Retrieves pointer to a String resource. -// -static PTSTR GetStringResource(HANDLE hHeap, HMODULE hModule, UINT uResource) -{ - int nResult; - DWORD dwSize = MAX_PATH; - PTSTR pszString = NULL; - - - VERBOSE(DLLTEXT("GetStringResource() entered.\r\n")); - - // Allocate buffer for string resource from heap; let the driver clean it up. - pszString = (PTSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(TCHAR)); - if(NULL != pszString) - { - PTSTR pTemp; - - // Load string resource; resize after loading so as not to waste memory. - nResult = LoadString(hModule, uResource, pszString, dwSize); - pTemp = (PTSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszString, (nResult + 1) * sizeof(TCHAR)); - if(NULL != pTemp) - { - pszString = pTemp; - } - } - else - { - ERR(DLLTEXT("GetStringResource() failed to allocate string buffer!\r\n")); - } - - return pszString; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.def b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.def deleted file mode 100644 index 8bea2782..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY WMARKUI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.h b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.h deleted file mode 100644 index 909056be..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.h +++ /dev/null @@ -1,35 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: WMarkUI.H -// -// PURPOSE: Define common data types, and external function prototypes -// for WaterMark UI. -// -#pragma once - -#include -#include -#include "globals.h" - - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - - -// OEM Signature and version. -#define PROP_TITLE L"WaterMark UI Page" -#define DLLTEXT(s) "WMARKUI: " s - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.rc b/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.rc deleted file mode 100644 index 3ac11d52..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermark/wmarkui/wmarkui.rc +++ /dev/null @@ -1,128 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team\0" - VALUE "CompanyName", "Microsoft Corp.\0" - VALUE "FileDescription", "WaterMark UI\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "WMarkUI\0" - VALUE "LegalCopyright", "Copyright © 1998-2003\0" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation\0" - VALUE "OriginalFilename", "WMarkUI.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Microsoft WaterMark\0" - VALUE "ProductVersion", "1.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_WATERMARK "Water Mark" - IDS_TEXT "Text" - IDS_FONTSIZE "Font Size" - IDS_ANGLE "Angle" - IDS_COLOR "Color" - IDS_GRAY "Gray" - IDS_RED "Red" - IDS_GREEN "Green" - IDS_BLUE "Blue" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/debug.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/debug.h deleted file mode 100644 index 0414569c..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/debug.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Debug.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debugging functions. Also defines the various debug macros. -// -// - -#pragma once - -///////////////////////////////////////////////////////// -// Macros -///////////////////////////////////////////////////////// -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// WARNING("App passed NULL pointer, ignoring...\n"); -// - -#define DBG_VERBOSE 0 -#define DBG_WARNING 1 -#define DBG_ERROR 2 -#define DBG_NONE 3 - -// VC and Build use different debug defines. -#if defined (DBG) || defined (_DEBUG) - - // __declspec(selectany) ensures that even if this is defined in multiple compilation - // modules, they will all resolve to the same symbol in the linked DLL - __declspec(selectany) INT giDebugLevel = 2; - - #define STRINGIZE(x) #x - #define QUOTE(x) STRINGIZE(x) - #define FILE_AND_LINE __FILE__ "@" QUOTE(__LINE__) - - #define VERBOSE(msg) { if(giDebugLevel <= DBG_VERBOSE) OutputDebugStringA( FILE_AND_LINE ": " msg); } - #define WARNING(msg) { if(giDebugLevel <= DBG_WARNING) OutputDebugStringA( FILE_AND_LINE ": Warning: " msg); } - #define ERR(msg) { if(giDebugLevel <= DBG_ERROR) OutputDebugStringA(FILE_AND_LINE ": Error:" msg); } - #define ASSERT(cond) { if (!(cond)) RIP("\n"); } - #define RIP(msg) { OutputDebugStringA(FILE_AND_LINE ": Error (not recoverable): " msg); DebugBreak(); } - -#else // !DBG - - #define VERBOSE(msg) - #define WARNING(msg) - #define ERR(msg) - #define ASSERT(cond) - #define RIP(msg) - -#endif - - - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.cpp deleted file mode 100644 index 328d6fb4..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.cpp +++ /dev/null @@ -1,216 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.cpp -// -// PURPOSE: Implementation of Devmode functions shared with OEM UI and OEM rendering modules. -// - -// This file is wrapped in fdebug.cpp in other parts of the watermark sample. -// The appropriate precompiled header should be included there. -// #include "precomp.h -#include "debug.h" -#include "devmode.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam) -{ - HRESULT hResult = S_OK; - POEMDEV pOEMDevIn = NULL; - POEMDEV pOEMDevOut = NULL; - - - // Verify parameters. - if( (NULL == pOemDMParam) - || - ( (OEMDM_SIZE != dwMode) - && - (OEMDM_DEFAULT != dwMode) - && - (OEMDM_CONVERT != dwMode) - && - (OEMDM_MERGE != dwMode) - ) - ) - { - ERR(DLLTEXT("DevMode() ERROR_INVALID_PARAMETER.\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Cast generic (i.e. PVOID) to OEM private devomode pointer type. - pOEMDevIn = (POEMDEV) pOemDMParam->pOEMDMIn; - pOEMDevOut = (POEMDEV) pOemDMParam->pOEMDMOut; - - switch(dwMode) - { - case OEMDM_SIZE: - pOemDMParam->cbBufSize = sizeof(OEMDEV); - break; - - case OEMDM_DEFAULT: - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->bWmarkEnabled = WATER_MARK_DEFAULT_ENABLED; - pOEMDevOut->dwWmarkFontSize = WATER_MARK_DEFAULT_FONTSIZE; - pOEMDevOut->crWmarkTextColor = WATER_MARK_DEFAULT_COLOR; - hResult = StringCbCopyW(pOEMDevOut->szWaterMark, sizeof(pOEMDevOut->szWaterMark), WATER_MARK_DEFAULT_TEXT); - break; - - case OEMDM_CONVERT: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - break; - - case OEMDM_MERGE: - ConvertOEMDevmode(pOEMDevIn, pOEMDevOut); - MakeOEMDevmodeValid(pOEMDevOut); - break; - } - - return hResult; -} - - -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut) -{ - HRESULT hCopy = S_OK; - - - if( (NULL == pOEMDevIn) - || - (NULL == pOEMDevOut) - ) - { - ERR(DLLTEXT("ConvertOEMDevmode() invalid parameters.\r\n")); - return FALSE; - } - - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - if(pOEMDevIn->dmOEMExtra.dwSignature == pOEMDevOut->dmOEMExtra.dwSignature) - { - VERBOSE(DLLTEXT("Converting private OEM Devmode.\r\n")); - - // Set the devmode defaults so that anything the isn't copied over will - // be set to the default value. - pOEMDevOut->bWmarkEnabled = WATER_MARK_DEFAULT_ENABLED; - pOEMDevOut->dwWmarkFontSize = WATER_MARK_DEFAULT_FONTSIZE; - pOEMDevOut->crWmarkTextColor = WATER_MARK_DEFAULT_COLOR; - hCopy = StringCbCopyW(pOEMDevOut->szWaterMark, sizeof(pOEMDevOut->szWaterMark), WATER_MARK_DEFAULT_TEXT); - - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - memcpy(pOEMDevOut, pOEMDevIn, __min(pOEMDevOut->dmOEMExtra.dwSize, pOEMDevIn->dmOEMExtra.dwSize)); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - } - else - { - WARNING(DLLTEXT("Unknown DEVMODE signature, pOEMDMIn ignored.\r\n")); - - // Don't know what the input DEVMODE is, so just use defaults. - pOEMDevOut->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevOut->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevOut->dmOEMExtra.dwVersion = OEM_VERSION; - pOEMDevOut->bWmarkEnabled = WATER_MARK_DEFAULT_ENABLED; - pOEMDevOut->dwWmarkFontSize = WATER_MARK_DEFAULT_FONTSIZE; - pOEMDevOut->crWmarkTextColor = WATER_MARK_DEFAULT_COLOR; - hCopy = StringCbCopyW(pOEMDevOut->szWaterMark, sizeof(pOEMDevOut->szWaterMark), WATER_MARK_DEFAULT_TEXT); - } - - return SUCCEEDED(hCopy); -} - - -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode) -{ - if(NULL == pOEMDevmode) - { - return FALSE; - } - - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - pOEMDevmode->dmOEMExtra.dwSize = sizeof(OEMDEV); - pOEMDevmode->dmOEMExtra.dwSignature = OEM_SIGNATURE; - pOEMDevmode->dmOEMExtra.dwVersion = OEM_VERSION; - - // bEnable should be either TRUE or FALSE. - if( (TRUE != pOEMDevmode->bWmarkEnabled) - && - (FALSE != pOEMDevmode->bWmarkEnabled) - ) - { - pOEMDevmode->bWmarkEnabled = WATER_MARK_DEFAULT_ENABLED; - } - - - // dwWmarkFontSize should be 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, or 72. - if(!IsValidFontSize(pOEMDevmode->dwWmarkFontSize)) - { - pOEMDevmode->dwWmarkFontSize = WATER_MARK_DEFAULT_FONTSIZE; - } - - // The high byte of the hi word should be zero. - if(0 != HIBYTE(HIWORD(pOEMDevmode->crWmarkTextColor))) - { - pOEMDevmode->crWmarkTextColor = WATER_MARK_DEFAULT_COLOR; - } - - // Make sure that water mark string is terminated. - pOEMDevmode->szWaterMark[WATER_MARK_TEXT_SIZE - 1] = L'\0'; - - return TRUE; -} - - -BOOL IsValidFontSize(DWORD dwWmarkFontSize) -{ - BOOL bValid = FALSE; - - - switch(dwWmarkFontSize) - { - case 8: - case 9: - case 10: - case 11: - case 12: - case 14: - case 16: - case 18: - case 20: - case 22: - case 24: - case 26: - case 28: - case 36: - case 48: - case 72: - bValid = TRUE; - break; - - default: - ERR(DLLTEXT("IsValidFontSize() found invalid font size\r\n")); - break; - } - - return bValid; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.h deleted file mode 100644 index de7ee919..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/devmode.h +++ /dev/null @@ -1,52 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Devmode.h -// -// PURPOSE: Define common data types, and external function prototypes -// for devmode functions. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - -#define WATER_MARK_TEXT_SIZE 128 -#define WATER_MARK_DEFAULT_ENABLED TRUE -#define WATER_MARK_DEFAULT_FONTSIZE 28 -#define WATER_MARK_DEFAULT_COLOR RGB(230, 230, 230) -#define WATER_MARK_DEFAULT_TEXT L"WaterMark" - - - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - BOOL bWmarkEnabled; - DWORD dwWmarkFontSize; - COLORREF crWmarkTextColor; - WCHAR szWaterMark[WATER_MARK_TEXT_SIZE]; - -} OEMDEV, *POEMDEV; - -typedef const OEMDEV *PCOEMDEV; - - - -///////////////////////////////////////////////////////// -// ProtoTypes -///////////////////////////////////////////////////////// - -HRESULT hrOEMDevMode(DWORD dwMode, POEMDMPARAM pOemDMParam); -BOOL ConvertOEMDevmode(PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut); -BOOL MakeOEMDevmodeValid(POEMDEV pOEMDevmode); -BOOL IsValidFontSize(DWORD dwWmarkFontSize); diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/oem.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/oem.h deleted file mode 100644 index d63814ad..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/common/oem.h +++ /dev/null @@ -1,23 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997- 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: oem.H -// -// PURPOSE: Define common data types, and external function prototypes -// for debug.cpp. -// -#pragma once - -//////////////////////////////////////////////////////// -// OEM Defines -//////////////////////////////////////////////////////// - -#define OEM_SIGNATURE 'MSFT' -#define OEM_VERSION 0x00000001L - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj deleted file mode 100644 index 4e88c6a9..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj +++ /dev/null @@ -1,1150 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {1D0BAFC7-C244-4EC1-9DE3-5AC3937DDD62} - $(MSBuildProjectName) - Win10 Debug - Win32 - {39C728EB-3DCE-45B1-BC93-76678BB2A0A6} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - WMARKUNIUI - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - true - Level4 - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);..\common;. - - - %(AdditionalDependencies);kernel32.lib;user32.lib;ole32.lib;advapi32.lib;uuid.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - WMARKUNIUI.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj.Filters deleted file mode 100644 index 660c3ddf..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/WMARKUNIUI.vcxproj.Filters +++ /dev/null @@ -1,140 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {6078E9AC-04DC-4263-AA1A-9501916D09D2} - - - h;hpp;hxx;hm;inl;inc;xsd - {0E5A51EE-1609-4F50-8955-63F7D0C1A20E} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {C5E399CF-1AAE-4A3D-B806-84CCA8D9930D} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/dllentry.cpp deleted file mode 100644 index f4769ff4..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/dllentry.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "wmarkui.h" -#include "debug.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - ghInstance = hInst; - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/fdevmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/fdevmode.cpp deleted file mode 100644 index c82072c5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/fdevmode.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: fDevmode.cpp -// -// -// PURPOSE: Place holder file for devmode functions. -// - -#include "precomp.h" -#include "wmarkui.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.cpp deleted file mode 100644 index dd0ea334..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.cpp -// -// -// PURPOSE: File that contains all the globals. -// - -#include "precomp.h" -#include "wmarkui.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -HINSTANCE ghInstance = NULL; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.h deleted file mode 100644 index eac586c2..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/globals.h +++ /dev/null @@ -1,21 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Globals.h -// -// -// PURPOSE: Lists of globals declared in Globals.cpp. -// -// -#pragma once - -/////////////////////////////////////// -// Globals -/////////////////////////////////////// - -// Module's Instance handle from DLLEntry of process. -extern HINSTANCE ghInstance; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.cpp deleted file mode 100644 index cc8cceae..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.cpp +++ /dev/null @@ -1,525 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Interface for User Mode COM Customization DLL. -// - -#include "precomp.h" - -#include "wmarkui.h" -#include "debug.h" -#include "intrface.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0 ; // Count of active components -static long g_cServerLocks = 0 ; // Count of locks - - - -//////////////////////////////////////////////////////////////////////////////// -// -// IWaterMarkUI body -// -HRESULT __stdcall IWaterMarkUI::QueryInterface(const IID& iid, void** ppv) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:QueryInterface entry.\r\n\r\n")); - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IWaterMarkUI:Return pointer to IUnknown.\r\n\r\n")); - } - else if (iid == IID_IPrintOemUI) - { - *ppv = static_cast(this) ; - VERBOSE(DLLTEXT("IWaterMarkUI:Return pointer to IPrintOemUI.\r\n")); - } - else - { - VERBOSE(DLLTEXT("IWaterMarkUI::QueryInterface: interface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IWaterMarkUI::AddRef() -{ - VERBOSE(DLLTEXT("IWaterMarkUI:AddRef entry.\r\n")); - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IWaterMarkUI::Release() -{ - VERBOSE(DLLTEXT("IWaterMarkUI:Release entry.\r\n")); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -HRESULT __stdcall IWaterMarkUI::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:PublishDriverInterface entry.\r\n")); - - UNREFERENCED_PARAMETER(pIUnknown); - - // Don't use the DriverInterface, so don't store it. - - return S_OK; -} - -HRESULT __stdcall IWaterMarkUI::GetInfo( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IWaterMarkUI::GetInfo entry.\r\r\n")); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - VERBOSE(DLLTEXT("IWaterMarkUI::GetInfo() exit pcbNeeded is NULL!\r\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size and number of bytes written. - *pcbNeeded = sizeof(DWORD); - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - WARNING(DLLTEXT("IWaterMarkUI::GetInfo() exit insufficient buffer!\r\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IWaterMarkUI::GetInfo() exit mode not supported.\r\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(DLLTEXT("IWaterMarkUI::GetInfo() exit S_OK.\r\r\n")); - return S_OK; -} - -HRESULT __stdcall IWaterMarkUI::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DevMode entry.\r\n")); - - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IWaterMarkUI::CommonUIProp( - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:CommonUIProp entry.\r\n")); - - return hrOEMPropertyPage(dwMode, pOemCUIPParam); -} - - -HRESULT __stdcall IWaterMarkUI::DocumentPropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DocumentPropertySheets entry.\r\n")); - - UNREFERENCED_PARAMETER(pPSUIInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DevicePropertySheets( - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DevicePropertySheets entry.\r\n")); - - UNREFERENCED_PARAMETER(pPSUIInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DeviceCapabilities( - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DeviceCapabilities entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pDeviceName); - UNREFERENCED_PARAMETER(wCapability); - UNREFERENCED_PARAMETER(pOutput); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(dwOld); - UNREFERENCED_PARAMETER(dwResult); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DevQueryPrintEx( - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DevQueryPrintEx entry.\r\n")); - - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pDQPInfo); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::UpgradePrinter( - DWORD dwLevel, - PBYTE pDriverUpgradeInfo) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:UpgradePrinter entry.\r\n")); - - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverUpgradeInfo); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::PrinterEvent( - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:PrinterEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(iDriverEvent); - UNREFERENCED_PARAMETER(dwFlags); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWaterMarkUI::DriverEvent( - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:DriverEvent entry.\r\n")); - - UNREFERENCED_PARAMETER(dwDriverEvent); - UNREFERENCED_PARAMETER(dwLevel); - UNREFERENCED_PARAMETER(pDriverInfo); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - - -HRESULT __stdcall IWaterMarkUI::QueryColorProfile( - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulQueryMode, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:QueryColorProfile entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(poemuiobj); - UNREFERENCED_PARAMETER(pPublicDM); - UNREFERENCED_PARAMETER(pOEMDM); - UNREFERENCED_PARAMETER(ulQueryMode); - UNREFERENCED_PARAMETER(pvProfileData); - UNREFERENCED_PARAMETER(pcbProfileData); - UNREFERENCED_PARAMETER(pflProfileData); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IWaterMarkUI::FontInstallerDlgProc( - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:FontInstallerDlgProc entry.\r\n")); - - UNREFERENCED_PARAMETER(hWnd); - UNREFERENCED_PARAMETER(usMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -}; - -HRESULT __stdcall IWaterMarkUI::UpdateExternalFonts( - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges) -{ - VERBOSE(DLLTEXT("IWaterMarkUI:UpdateExternalFonts entry.\r\n")); - - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(hHeap); - UNREFERENCED_PARAMETER(pwstrCartridges); - - return E_NOTIMPL; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this) ; - } - else - { - WARNING(DLLTEXT("IOemCF::QueryInterface: interface not supported.\r\n")); - *ppv = NULL ; - return E_NOINTERFACE ; - } - reinterpret_cast(*ppv)->AddRef() ; - return S_OK ; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef) ; -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - //DbgPrint(DLLTEXT("Class factory:\t\tCreate component.")) ; - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION ; - } - - // Create component. - IWaterMarkUI* pOemCB = new IWaterMarkUI ; - if (pOemCB == NULL) - { - return E_OUTOFMEMORY ; - } - // Get the requested interface. - HRESULT hr = pOemCB->QueryInterface(iid, ppv) ; - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCB->Release() ; - return hr ; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks) ; - } - else - { - InterlockedDecrement(&g_cServerLocks) ; - } - return S_OK ; -} - -/////////////////////////////////////////////////////////// -// -// Exported functions -// - - -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:Create class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMUI) - { - return CLASS_E_CLASSNOTAVAILABLE ; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF ; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY ; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv) ; - pFontCF->Release() ; - - return hr ; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.h deleted file mode 100644 index 7f1ebad8..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/intrface.h +++ /dev/null @@ -1,178 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.H -// -// PURPOSE: Define COM interface for User Mode Printer UI plug-in. -// -#pragma once - -//////////////////////////////////////////////////////////////////////////////// -// -// IWaterMarkUI -// -class IWaterMarkUI: public IPrintOemUI -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, PVOID pBuffer, DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, POEMDMPARAM pOemDMParam) ; - - // - // OEMCommonUIProp - // - - STDMETHOD(CommonUIProp) (THIS_ - DWORD dwMode, - POEMCUIPPARAM pOemCUIPParam - ); - - // - // OEMDocumentPropertySheets - // - - STDMETHOD(DocumentPropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - // - // OEMDevicePropertySheets - // - - STDMETHOD(DevicePropertySheets) (THIS_ - PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam - ); - - - // - // OEMDevQueryPrintEx - // - - STDMETHOD(DevQueryPrintEx) (THIS_ - POEMUIOBJ poemuiobj, - PDEVQUERYPRINT_INFO pDQPInfo, - PDEVMODE pPublicDM, - PVOID pOEMDM - ); - - // - // OEMDeviceCapabilities - // - - STDMETHOD(DeviceCapabilities) (THIS_ - POEMUIOBJ poemuiobj, - HANDLE hPrinter, - _In_ PWSTR pDeviceName, - WORD wCapability, - PVOID pOutput, - PDEVMODE pPublicDM, - PVOID pOEMDM, - DWORD dwOld, - DWORD *dwResult - ); - - // - // OEMUpgradePrinter - // - - STDMETHOD(UpgradePrinter) (THIS_ - DWORD dwLevel, - PBYTE pDriverUpgradeInfo - ); - - // - // OEMPrinterEvent - // - - STDMETHOD(PrinterEvent) (THIS_ - _In_ PWSTR pPrinterName, - INT iDriverEvent, - DWORD dwFlags, - LPARAM lParam - ); - - // - // OEMDriverEvent - // - - STDMETHOD(DriverEvent)(THIS_ - DWORD dwDriverEvent, - DWORD dwLevel, - LPBYTE pDriverInfo, - LPARAM lParam - ); - - // - // OEMQueryColorProfile - // - - STDMETHOD(QueryColorProfile) (THIS_ - HANDLE hPrinter, - POEMUIOBJ poemuiobj, - PDEVMODE pPublicDM, - PVOID pOEMDM, - ULONG ulReserved, - VOID *pvProfileData, - ULONG *pcbProfileData, - FLONG *pflProfileData); - - // - // OEMFontInstallerDlgProc - // - - STDMETHOD(FontInstallerDlgProc) (THIS_ - HWND hWnd, - UINT usMsg, - WPARAM wParam, - LPARAM lParam - ); - // - // UpdateExternalFonts - // - - STDMETHOD(UpdateExternalFonts) (THIS_ - HANDLE hPrinter, - HANDLE hHeap, - _In_ PWSTR pwstrCartridges - ); - - - IWaterMarkUI() { m_cRef = 1; }; - ~IWaterMarkUI() { }; - -protected: - LONG m_cRef; -}; - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precomp.h deleted file mode 100644 index 644d21cd..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precomp.h +++ /dev/null @@ -1,54 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.H -// -// -// PURPOSE: Optimize compilation of headers that don't change frequently. -// -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "WINDDIUI.H" -#include -#include -#include - - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/resource.h deleted file mode 100644 index 22c03be5..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/resource.h +++ /dev/null @@ -1,26 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by wmarkui.rc -// -#define IDS_WATERMARK 1 -#define IDS_TEXT 2 -#define IDS_FONTSIZE 3 -#define IDS_COLOR 5 -#define IDS_GRAY 6 -#define IDS_RED 7 -#define IDS_GREEN 8 -#define IDS_BLUE 9 -#define IDS_ENBLED 10 -#define IDS_ENABLED 10 -#define IDS_DISABLED 11 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.cpp deleted file mode 100644 index fb875d30..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.cpp +++ /dev/null @@ -1,594 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: WMarkUI.cpp -// -// -// PURPOSE: Main file for OEM UI test module. -// -// - -#include "precomp.h" -#include "resource.h" -#include "debug.h" -#include "wmarkui.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - - -//////////////////////////////////////////////////////// -// INTERNAL MACROS and DEFINES -//////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////// -// INTERNAL PROTOTYPES -//////////////////////////////////////////////////////// - -LONG APIENTRY OEMUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam); -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems); -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams); -static DWORD FontSizeToIndex(DWORD dwWmarkFontSize); -static DWORD FontIndexToSize(DWORD dwIndex); -static DWORD TextColorToIndex(COLORREF crWmarkTextColor); -static COLORREF IndexToTextColor(DWORD dwIndex); -static PTSTR GetStringResource(HANDLE hHeap, HMODULE hModule, UINT uResource); - - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM device or document property UI. -// -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - HRESULT hResult = S_OK; - - - VERBOSE(DLLTEXT("hrOEMPropertyPage entry.\r\n")); - - // Validate parameters. - if( (OEMCUIP_DOCPROP != dwMode) - && - (OEMCUIP_PRNPROP != dwMode) - ) - { - ERR(DLLTEXT("hrOEMPropertyPage() ERROR_INVALID_PARAMETER.\r\n")); - - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - switch(dwMode) - { - case OEMCUIP_DOCPROP: - hResult = hrDocumentPropertyPage(dwMode, pOEMUIParam); - break; - - case OEMCUIP_PRNPROP: - // Don't have any Printer Proptery UI. - hResult = E_NOTIMPL; - break; - - default: - // Should never reach this! - ERR(DLLTEXT("hrOEMPropertyPage() Invalid dwMode")); - SetLastError(ERROR_INVALID_PARAMETER); - hResult = E_FAIL; - break; - } - - return hResult; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// OptItems call back for OEM device or document property UI. -// -LONG APIENTRY OEMUICallBack(PCPSUICBPARAM pCallbackParam, POEMCUIPPARAM pOEMUIParam) -{ - LONG lReturn = CPSUICB_ACTION_NONE; - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("OEMUICallBack() entry.\r\n")); - - switch(pCallbackParam->Reason) - { - case CPSUICB_REASON_APPLYNOW: - // Store OptItems state in DEVMODE. - pOEMDev->bWmarkEnabled = !pOEMUIParam->pOEMOptItems[0].Sel; - if(FAILED(StringCbCopyW(pOEMDev->szWaterMark, sizeof(pOEMDev->szWaterMark), (LPWSTR)pOEMUIParam->pOEMOptItems[1].pSel))) - { - ERR(DLLTEXT("OEMUICallBack() failed to copy water mark text\r\n")); - } - pOEMDev->dwWmarkFontSize = FontIndexToSize(pOEMUIParam->pOEMOptItems[2].Sel); - pOEMDev->crWmarkTextColor = IndexToTextColor(pOEMUIParam->pOEMOptItems[3].Sel); - break; - - default: - break; - } - - return lReturn; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems to display OEM document property UI. -// -static HRESULT hrDocumentPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam) -{ - if ( NULL == pOEMUIParam || NULL == pOEMUIParam->pOEMDM ) - { - ERR(DLLTEXT("hrDocumentPropertyPage() ERROR_INVALID_PARAMETER.\r\n")); - // Return invalid parameter error. - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - if(NULL == pOEMUIParam->pOEMOptItems) - { - // Fill in the number of OptItems to create for OEM document property UI. - pOEMUIParam->cOEMOptItems = 4; - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() requesting items.\r\n")); - } - else if(dwMode == OEMCUIP_DOCPROP) - { - POEMDEV pOEMDev = (POEMDEV) pOEMUIParam->pOEMDM; - - - VERBOSE(DLLTEXT("hrDocumentPropertyPage() fill out items.\r\n")); - - // Init UI Callback reference. - pOEMUIParam->OEMCUIPCallback = OEMUICallBack; - - // Init OEMOptItmes. - InitOptItems(pOEMUIParam->pOEMOptItems, pOEMUIParam->cOEMOptItems); - - // Fill out tree view items. - - // Water Mark Section Name. - pOEMUIParam->pOEMOptItems[0].Level = 1; - pOEMUIParam->pOEMOptItems[0].Flags = OPTIF_COLLAPSE; - pOEMUIParam->pOEMOptItems[0].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_WATERMARK); - pOEMUIParam->pOEMOptItems[0].Sel = pOEMDev->bWmarkEnabled ? 0 : 1; - - pOEMUIParam->pOEMOptItems[0].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[0].pOptType->Type = TVOT_COMBOBOX; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[0].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_ENABLED); - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[0].IconID = IDI_CPSUI_ON; - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_DISABLED); - pOEMUIParam->pOEMOptItems[0].pOptType->pOptParam[1].IconID = IDI_CPSUI_OFF; - - - // WaterMark Text. - pOEMUIParam->pOEMOptItems[1].Level = 2; - pOEMUIParam->pOEMOptItems[1].Flags = 0; - pOEMUIParam->pOEMOptItems[1].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_TEXT); - pOEMUIParam->pOEMOptItems[1].pSel = (LPTSTR) HeapAlloc(pOEMUIParam->hOEMHeap, HEAP_ZERO_MEMORY, MAX_PATH * sizeof(WCHAR)); - if (pOEMUIParam->pOEMOptItems[1].pSel == NULL) - { - ERR(DLLTEXT("hrDocumentPropertyPage() failed to copy water mark text\r\n")); - return E_OUTOFMEMORY; - } - - if(FAILED(StringCbCopyW((LPWSTR)pOEMUIParam->pOEMOptItems[1].pSel, MAX_PATH * sizeof(WCHAR), pOEMDev->szWaterMark))) - { - ERR(DLLTEXT("hrDocumentPropertyPage() failed to copy water mark text \r\n")); - } - - pOEMUIParam->pOEMOptItems[1].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 2); - - pOEMUIParam->pOEMOptItems[1].pOptType->Type = TVOT_EDITBOX; - pOEMUIParam->pOEMOptItems[1].pOptType->pOptParam[1].IconID = sizeof(((POEMDEV)NULL)->szWaterMark)/sizeof(WCHAR); - - - // WaterMark Font Size. - pOEMUIParam->pOEMOptItems[2].Level = 2; - pOEMUIParam->pOEMOptItems[2].Flags = 0; - pOEMUIParam->pOEMOptItems[2].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_FONTSIZE); - pOEMUIParam->pOEMOptItems[2].Sel = FontSizeToIndex(pOEMDev->dwWmarkFontSize); - - pOEMUIParam->pOEMOptItems[2].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 16); - - pOEMUIParam->pOEMOptItems[2].pOptType->Type = TVOT_COMBOBOX; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[0].pData = L"8"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[1].pData = L"9"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[2].pData = L"10"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[3].pData = L"11"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[4].pData = L"12"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[5].pData = L"14"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[6].pData = L"16"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[7].pData = L"18"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[8].pData = L"20"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[9].pData = L"22"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[10].pData = L"24"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[11].pData = L"26"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[12].pData = L"28"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[13].pData = L"36"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[14].pData = L"48"; - pOEMUIParam->pOEMOptItems[2].pOptType->pOptParam[15].pData = L"72"; - - - // WaterMark Color. - pOEMUIParam->pOEMOptItems[3].Level = 2; - pOEMUIParam->pOEMOptItems[3].Flags = 0; - pOEMUIParam->pOEMOptItems[3].pName = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_COLOR); - pOEMUIParam->pOEMOptItems[3].Sel = TextColorToIndex(pOEMDev->crWmarkTextColor); - - pOEMUIParam->pOEMOptItems[3].pOptType = CreateOptType(pOEMUIParam->hOEMHeap, 4); - - pOEMUIParam->pOEMOptItems[3].pOptType->Type = TVOT_COMBOBOX; - pOEMUIParam->pOEMOptItems[3].pOptType->pOptParam[0].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_GRAY); - pOEMUIParam->pOEMOptItems[3].pOptType->pOptParam[1].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_RED); - pOEMUIParam->pOEMOptItems[3].pOptType->pOptParam[2].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_GREEN); - pOEMUIParam->pOEMOptItems[3].pOptType->pOptParam[3].pData = GetStringResource(pOEMUIParam->hOEMHeap, ghInstance, IDS_BLUE); - } - - return S_OK; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Initializes OptItems. -// -static void InitOptItems(POPTITEM pOptItems, DWORD dwOptItems) -{ - VERBOSE(DLLTEXT("InitOptItems() entry.\r\n")); - - // Zero out memory. - memset(pOptItems, 0, sizeof(OPTITEM) * dwOptItems); - - // Set each OptItem's size, and Public DM ID. - for(DWORD dwCount = 0; dwCount < dwOptItems; dwCount++) - { - pOptItems[dwCount].cbSize = sizeof(OPTITEM); - pOptItems[dwCount].DMPubID = DMPUB_NONE; - } -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Allocates and initializes OptType for OptItem. -// -static POPTTYPE CreateOptType(HANDLE hHeap, WORD wOptParams) -{ - POPTTYPE pOptType = NULL; - - - VERBOSE(DLLTEXT("CreateOptType() entry.\r\n")); - - // Allocate memory from the heap for the OPTTYPE; the driver will take care of clean up. - pOptType = (POPTTYPE) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, sizeof(OPTTYPE)); - if(NULL != pOptType) - { - // Initialize OPTTYPE. - pOptType->cbSize = sizeof(OPTTYPE); - pOptType->Count = wOptParams; - - // Allocate memory from the heap for the OPTPARAMs for the OPTTYPE. - pOptType->pOptParam = (POPTPARAM) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, wOptParams * sizeof(OPTPARAM)); - if(NULL != pOptType->pOptParam) - { - // Initialize the OPTPARAMs. - for(WORD wCount = 0; wCount < wOptParams; wCount++) - { - pOptType->pOptParam[wCount].cbSize = sizeof(OPTPARAM); - } - } - else - { - ERR(DLLTEXT("CreateOptType() failed to allocated memory for OPTPARAMs!\r\n")); - - // Free allocated memory and return NULL. - HeapFree(hHeap, 0, pOptType); - pOptType = NULL; - } - } - else - { - ERR(DLLTEXT("CreateOptType() failed to allocated memory for OPTTYPE!\r\n")); - } - - return pOptType; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts Font point size to index in combo box. -// -static DWORD FontSizeToIndex(DWORD dwWmarkFontSize) -{ - DWORD dwIndex; - - - switch(dwWmarkFontSize) - { - case 8: - dwIndex = 0; - break; - - case 9: - dwIndex = 1; - break; - - case 10: - dwIndex = 2; - break; - - case 11: - dwIndex = 3; - break; - - case 12: - dwIndex = 4; - break; - - case 14: - dwIndex = 5; - break; - - case 16: - dwIndex = 6; - break; - - case 18: - dwIndex = 7; - break; - - case 20: - dwIndex = 8; - break; - - case 22: - dwIndex = 9; - break; - - case 24: - dwIndex = 10; - break; - - case 26: - dwIndex = 11; - break; - - case 36: - dwIndex = 13; - break; - - case 48: - dwIndex = 14; - break; - - case 72: - dwIndex = 15; - break; - - case 28: - default: - dwIndex = 12; - break; - } - - return dwIndex; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts Font combo box index to font point size. -// -static DWORD FontIndexToSize(DWORD dwIndex) -{ - DWORD dwWmarkFontSize; - - switch(dwIndex) - { - case 0: - dwWmarkFontSize = 8; - break; - - case 1: - dwWmarkFontSize = 9; - break; - - case 2: - dwWmarkFontSize = 10; - break; - - case 3: - dwWmarkFontSize = 11; - break; - - case 4: - dwWmarkFontSize = 12; - break; - - case 5: - dwWmarkFontSize = 14; - break; - - case 6: - dwWmarkFontSize = 16; - break; - - case 7: - dwWmarkFontSize = 18; - break; - - case 8: - dwWmarkFontSize = 20; - break; - - case 9: - dwWmarkFontSize = 22; - break; - - case 10: - dwWmarkFontSize = 24; - break; - - case 11: - dwWmarkFontSize = 26; - break; - - case 13: - dwWmarkFontSize = 36; - break; - - case 14: - dwWmarkFontSize = 48; - break; - - case 15: - dwWmarkFontSize = 72; - break; - - case 12: - default: - dwWmarkFontSize = 28; - break; - } - - return dwWmarkFontSize; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts text color to combo box index. -// -static DWORD TextColorToIndex(COLORREF crWmarkTextColor) -{ - DWORD dwIndex; - - - // The color is what ever color is dominate. If none are, then it is gray. - if( (GetRValue(crWmarkTextColor) > GetGValue(crWmarkTextColor)) - && - (GetGValue(crWmarkTextColor) >= GetBValue(crWmarkTextColor)) - ) - { - // Set index to red. - dwIndex = 1; - } - else if( (GetRValue(crWmarkTextColor) < GetGValue(crWmarkTextColor)) - && - (GetGValue(crWmarkTextColor) > GetBValue(crWmarkTextColor)) - ) - { - // Set index to green. - dwIndex = 2; - } - else if( (GetRValue(crWmarkTextColor) <= GetGValue(crWmarkTextColor)) - && - (GetGValue(crWmarkTextColor) < GetBValue(crWmarkTextColor)) - ) - { - // Set index to blue. - dwIndex = 3; - } - else - { - // Set index to gray. - dwIndex = 0; - } - - return dwIndex; -} - -//////////////////////////////////////////////////////////////////////////////// -// -// Converts text combo box index to text color. -// -static COLORREF IndexToTextColor(DWORD dwIndex) -{ - COLORREF crWmarkTextColor; - - // Map index to desired text color. - // We just support 4 colors in the UI: Red, Green, Blue, and gray. - // The rendering module is capable of using any color for the Water Mark Text. - switch(dwIndex) - { - case 1: - // Color is red. - crWmarkTextColor = RGB(255, 216, 216); - break; - - case 2: - // Color is green. - crWmarkTextColor = RGB(216, 255, 216); - break; - - case 3: - // Color is blue. - crWmarkTextColor = RGB(216, 216, 255); - break; - - default: - case 0: - // Color is gray. - crWmarkTextColor = WATER_MARK_DEFAULT_COLOR; - break; - } - - return crWmarkTextColor; -} - -//////////////////////////////////////////////////////////////////////////////////// -// -// Retrieves pointer to a String resource. -// -static PTSTR GetStringResource(HANDLE hHeap, HMODULE hModule, UINT uResource) -{ - int nResult; - DWORD dwSize = MAX_PATH; - PTSTR pszString = NULL; - - - VERBOSE(DLLTEXT("GetStringResource() entered.\r\n")); - - // Allocate buffer for string resource from heap; let the driver clean it up. - pszString = (PTSTR) HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwSize * sizeof(TCHAR)); - if(NULL != pszString) - { - PTSTR pTemp; - - // Load string resource; resize after loading so as not to waste memory. - nResult = LoadString(hModule, uResource, pszString, dwSize); - if (0 == nResult) - { - ERR(DLLTEXT("GetStringResource() failed to load the the string resource!\r\n")); - HeapFree(hHeap, 0, pszString); - pszString=NULL; - } - else - { - pTemp = (PTSTR) HeapReAlloc(hHeap, HEAP_ZERO_MEMORY, pszString, (nResult + 1) * sizeof(TCHAR)); - if(NULL != pTemp) - { - pszString = pTemp; - } - } - } - else - { - ERR(DLLTEXT("GetStringResource() failed to allocate string buffer!\r\n")); - } - - return pszString; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.h deleted file mode 100644 index ca19064a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.h +++ /dev/null @@ -1,37 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: WMarkUI.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for WaterMark UI. -// -#pragma once - -#include -#include -#include "globals.h" - - -//////////////////////////////////////////////////////// -// OEM UI Defines -//////////////////////////////////////////////////////// - - -// OEM Signature and version. -#define PROP_TITLE L"WaterMark UI Page" -#define DLLTEXT(s) "WMARKUI: " s - -//////////////////////////////////////////////////////// -// Prototypes -//////////////////////////////////////////////////////// - -HRESULT hrOEMPropertyPage(DWORD dwMode, POEMCUIPPARAM pOEMUIParam); - - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.rc b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.rc deleted file mode 100644 index 44358b9a..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkui.rc +++ /dev/null @@ -1,124 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Windows Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "WaterMarkUni UI" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "WMarkUniUI" - VALUE "LegalCopyright", "Copyright © 1998-2003" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "WMarkUniUI.dll" - VALUE "ProductName", "Microsoft WaterMark" - VALUE "ProductVersion", "1.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_WATERMARK "Water Mark" - IDS_TEXT "Text" - IDS_FONTSIZE "Font Size" - IDS_COLOR "Color" - IDS_GRAY "Gray" - IDS_RED "Red" - IDS_GREEN "Green" - IDS_BLUE "Blue" - IDS_ENABLED "Enabled" - IDS_DISABLED "Disabled" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkuniui.def b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkuniui.def deleted file mode 100644 index 26c192f9..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkui/wmarkuniui.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY WMARKUI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj deleted file mode 100644 index 0ad2b890..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj +++ /dev/null @@ -1,1090 +0,0 @@ - - - - - Win10 Debug - ARM64 - - - Win10 Debug - Win32 - - - Win10 Debug - x64 - - - Win10 Release - ARM64 - - - Win10 Release - Win32 - - - Win10 Release - x64 - - - Win8.1 Debug - Win32 - - - Win8 Debug - Win32 - - - Win7 Debug - Win32 - - - Win8.1 Release - Win32 - - - Win8 Release - Win32 - - - Win7 Release - Win32 - - - Win8.1 Debug - x64 - - - Win8 Debug - x64 - - - Win7 Debug - x64 - - - Win8.1 Release - x64 - - - Win8 Release - x64 - - - Win7 Release - x64 - - - - {866141A6-4989-41D7-9409-4A5A73B535B0} - $(MSBuildProjectName) - Win10 Debug - Win32 - {FF810DA7-AF7F-4167-9078-A43C6CA46E83} - - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - False - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - False - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Win7 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Win8 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - WindowsV6.3 - True - - WindowsApplicationForDrivers8.1 - DynamicLibrary - - - Windows10 - True - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - WMARKUNI - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - true - Level4 - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(PreprocessorDefinitions);KERNEL_MODE;_UNICODE;UNICODE;OEMCOM;USERMODE_DRIVER - %(AdditionalIncludeDirectories);..\common;.. - - - %(AdditionalDependencies);uuid.lib;kernel32.lib;user32.lib;ole32.lib - - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0603 - 0x06030000 - - - 0x0A00 - 0x0A000000 - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - WMARKUNI.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj.Filters b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj.Filters deleted file mode 100644 index 480c5f75..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/WMARKUNI.vcxproj.Filters +++ /dev/null @@ -1,137 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {0906BEFF-05C5-43D6-A8A8-56287C3F1FDD} - - - h;hpp;hxx;hm;inl;inc;xsd - {33052901-7C1C-4E06-A9A5-0FDB9BE8B947} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {F0995942-2A83-43B2-B61A-69B8DFE2E12D} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - - - Resource Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/ddihook.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/ddihook.cpp deleted file mode 100644 index 36615fac..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/ddihook.cpp +++ /dev/null @@ -1,1226 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: DDIHook.cpp -// -// -// PURPOSE: DDI Hook routines for User Mode COM Customization DLL. -// -// - -#include "precomp.h" -#include "debug.h" -#include "wmarkuni.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -// Loop limiter. -#define MAX_LOOP 10 - -void RenderWaterMark(PDEVOBJ pdevobj); -static DWORD FormatResource(_In_ LPSTR pszResource, _Out_ LPSTR *ppszBuffer, ...); -// -// OEMBitBlt -// - - - -BOOL APIENTRY -OEMBitBlt( - SURFOBJ *psoTrg, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclTrg, - POINTL *pptlSrc, - POINTL *pptlMask, - BRUSHOBJ *pbo, - POINTL *pptlBrush, - ROP4 rop4 - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMBitBlt() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoTrg->dhpdev; - - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvBitBlt)(poempdev->pfnUnidrv[UD_DrvBitBlt])) ( - psoTrg, - psoSrc, - psoMask, - pco, - pxlo, - prclTrg, - pptlSrc, - pptlMask, - pbo, - pptlBrush, - rop4)); - -} - -// -// OEMStretchBlt -// - -BOOL APIENTRY -OEMStretchBlt( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMStretchBlt() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - - // - // turn around to call Unidrv - // - - return (((PFN_DrvStretchBlt)(poempdev->pfnUnidrv[UD_DrvStretchBlt])) ( - psoDest, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDest, - prclSrc, - pptlMask, - iMode)); - -} - -// -// OEMCopyBits -// - -BOOL APIENTRY -OEMCopyBits( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDest, - POINTL *pptlSrc - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMCopyBits() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvCopyBits)(poempdev->pfnUnidrv[UD_DrvCopyBits])) ( - psoDest, - psoSrc, - pco, - pxlo, - prclDest, - pptlSrc)); - -} - -// -// OEMTextOut -// - -BOOL APIENTRY -OEMTextOut( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMTextOut() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvTextOut)(poempdev->pfnUnidrv[UD_DrvTextOut])) ( - pso, - pstro, - pfo, - pco, - prclExtra, - prclOpaque, - pboFore, - pboOpaque, - pptlOrg, - mix)); - -} - -// -// OEMStrokePath -// - -BOOL APIENTRY -OEMStrokePath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - LINEATTRS *plineattrs, - MIX mix - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMStokePath() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvStrokePath)(poempdev->pfnUnidrv[UD_DrvStrokePath])) ( - pso, - ppo, - pco, - pxo, - pbo, - pptlBrushOrg, - plineattrs, - mix)); - -} - -// -// OEMFillPath -// - -BOOL APIENTRY -OEMFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - MIX mix, - FLONG flOptions - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMFillPath() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvFillPath)(poempdev->pfnUnidrv[UD_DrvFillPath])) ( - pso, - ppo, - pco, - pbo, - pptlBrushOrg, - mix, - flOptions)); - -} - -// -// OEMStrokeAndFillPath -// - -BOOL APIENTRY -OEMStrokeAndFillPath( - SURFOBJ *pso, - PATHOBJ *ppo, - CLIPOBJ *pco, - XFORMOBJ *pxo, - BRUSHOBJ *pboStroke, - LINEATTRS *plineattrs, - BRUSHOBJ *pboFill, - POINTL *pptlBrushOrg, - MIX mixFill, - FLONG flOptions - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMStrokeAndFillPath() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvStrokeAndFillPath)(poempdev->pfnUnidrv[UD_DrvStrokeAndFillPath])) ( - pso, - ppo, - pco, - pxo, - pboStroke, - plineattrs, - pboFill, - pptlBrushOrg, - mixFill, - flOptions)); - -} - -// -// OEMRealizeBrush -// - -BOOL APIENTRY -OEMRealizeBrush( - BRUSHOBJ *pbo, - SURFOBJ *psoTarget, - SURFOBJ *psoPattern, - SURFOBJ *psoMask, - XLATEOBJ *pxlo, - ULONG iHatch - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMRealizeBrush() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoTarget->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvRealizeBrush)(poempdev->pfnUnidrv[UD_DrvRealizeBrush])) ( - pbo, - psoTarget, - psoPattern, - psoMask, - pxlo, - iHatch)); -} - -// -// OEMStartPage -// - -BOOL APIENTRY -OEMStartPage( - SURFOBJ *pso - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMStartPage() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // turn around to call Unidrv - // - - return (((PFN_DrvStartPage)(poempdev->pfnUnidrv[UD_DrvStartPage]))(pso)); - -} - -#define OEM_TESTSTRING "The DDICMDCB DLL adds this line of text." - -// -// OEMSendPage -// - -BOOL APIENTRY -OEMSendPage( - SURFOBJ *pso - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMSendPage() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - POEMDEV pOemDevmode = (POEMDEV) pdevobj->pOEMDM; - if(pOemDevmode && pOemDevmode->bWmarkEnabled) - { - RenderWaterMark(pdevobj); - } - // - // print a line of text, just for testing - // - if (pso->iType == STYPE_BITMAP) - { - pdevobj->pDrvProcs->DrvXMoveTo(pdevobj, 0, 0); - pdevobj->pDrvProcs->DrvYMoveTo(pdevobj, 0, 0); - pdevobj->pDrvProcs->DrvWriteSpoolBuf(pdevobj, OEM_TESTSTRING, - sizeof(OEM_TESTSTRING)); - } - - // - // turn around to call Unidrv - // - - return (((PFN_DrvSendPage)(poempdev->pfnUnidrv[UD_DrvSendPage]))(pso)); - -} - -// -// OEMEscape -// - -ULONG APIENTRY -OEMEscape( - SURFOBJ *pso, - ULONG iEsc, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMEscape() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvEscape)(poempdev->pfnUnidrv[UD_DrvEscape])) ( - pso, - iEsc, - cjIn, - pvIn, - cjOut, - pvOut)); - -} - -// -// OEMStartDoc -// - -BOOL APIENTRY -OEMStartDoc( - SURFOBJ *pso, - _In_ PWSTR pwszDocName, - DWORD dwJobId - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMStartDoc() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvStartDoc)(poempdev->pfnUnidrv[UD_DrvStartDoc])) ( - pso, - pwszDocName, - dwJobId)); - -} - -// -// OEMEndDoc -// - -BOOL APIENTRY -OEMEndDoc( - SURFOBJ *pso, - FLONG fl - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMEndDoc() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvEndDoc)(poempdev->pfnUnidrv[UD_DrvEndDoc])) ( - pso, - fl)); - -} - -//////// -// NOTE: -// OEM DLL needs to hook out the following six font related DDI calls only -// if it enumerates additional fonts beyond what's in the GPD file. -// And if it does, it needs to take care of its own fonts for all font DDI -// calls and DrvTextOut call. -/////// - -// -// OEMQueryFont -// - -PIFIMETRICS APIENTRY -OEMQueryFont( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG_PTR *pid - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMQueryFont() entry.\r\n")); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvQueryFont)(poempdev->pfnUnidrv[UD_DrvQueryFont])) ( - dhpdev, - iFile, - iFace, - pid)); - -} - -// -// OEMQueryFontTree -// - -PVOID APIENTRY -OEMQueryFontTree( - DHPDEV dhpdev, - ULONG_PTR iFile, - ULONG iFace, - ULONG iMode, - ULONG_PTR *pid - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMQueryFontTree() entry.\r\n")); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvQueryFontTree)(poempdev->pfnUnidrv[UD_DrvQueryFontTree])) ( - dhpdev, - iFile, - iFace, - iMode, - pid)); - -} - -// -// OEMQueryFontData -// - -LONG APIENTRY -OEMQueryFontData( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - HGLYPH hg, - GLYPHDATA *pgd, - _Out_writes_bytes_(cjSize) PVOID pv, - ULONG cjSize - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMQueryFontData() entry.\r\n")); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv if this is not the font that OEM enumerated. - // - - return (((PFN_DrvQueryFontData)(poempdev->pfnUnidrv[UD_DrvQueryFontData])) ( - dhpdev, - pfo, - iMode, - hg, - pgd, - pv, - cjSize)); - -} - -// -// OEMQueryAdvanceWidths -// - -BOOL APIENTRY -OEMQueryAdvanceWidths( - DHPDEV dhpdev, - FONTOBJ *pfo, - ULONG iMode, - _In_reads_(cGlyphs) HGLYPH *phg, - _Out_writes_bytes_(cGlyphs*sizeof(USHORT)) PVOID pvWidths, - ULONG cGlyphs - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMQueryAdvanceWidths() entry.\r\n")); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv if this is not the font that OEM enumerated. - // - - return (((PFN_DrvQueryAdvanceWidths) - (poempdev->pfnUnidrv[UD_DrvQueryAdvanceWidths])) ( - dhpdev, - pfo, - iMode, - phg, - pvWidths, - cGlyphs)); - -} - -// -// OEMFontManagement -// - -ULONG APIENTRY -OEMFontManagement( - SURFOBJ *pso, - FONTOBJ *pfo, - ULONG iMode, - ULONG cjIn, - _In_reads_bytes_(cjIn) PVOID pvIn, - ULONG cjOut, - _Out_writes_bytes_(cjOut) PVOID pvOut - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMFontManagement() entry.\r\n")); - - // - // Note that Unidrv will not call OEM DLL for iMode==QUERYESCSUPPORT. - // So pso is not NULL for sure. - // - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv if this is not the font that OEM enumerated. - // - - return (((PFN_DrvFontManagement)(poempdev->pfnUnidrv[UD_DrvFontManagement])) ( - pso, - pfo, - iMode, - cjIn, - pvIn, - cjOut, - pvOut)); - -} - -// -// OEMGetGlyphMode -// - -ULONG APIENTRY -OEMGetGlyphMode( - DHPDEV dhpdev, - FONTOBJ *pfo - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMGetGlyphMode() entry.\r\n")); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv if this is not the font that OEM enumerated. - // - - return (((PFN_DrvGetGlyphMode)(poempdev->pfnUnidrv[UD_DrvGetGlyphMode])) ( - dhpdev, - pfo)); - -} - -BOOL APIENTRY -OEMNextBand( - SURFOBJ *pso, - POINTL *pptl - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMNextBand() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvNextBand)(poempdev->pfnUnidrv[UD_DrvNextBand])) ( - pso, - pptl)); - -} - -BOOL APIENTRY -OEMStartBanding( - SURFOBJ *pso, - POINTL *pptl - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMStartBanding() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - POEMDEV pOemDevmode = (POEMDEV) pdevobj->pOEMDM; - if(pOemDevmode->bWmarkEnabled) - { - RenderWaterMark(pdevobj); - } - - // - // turn around to call Unidrv - // - - return (((PFN_DrvStartBanding)(poempdev->pfnUnidrv[UD_DrvStartBanding])) ( - pso, - pptl)); - - -} - -ULONG APIENTRY -OEMDitherColor( - DHPDEV dhpdev, - ULONG iMode, - ULONG rgbColor, - ULONG *pulDither - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMDitherColor() entry.\r\n")); - - pdevobj = (PDEVOBJ)dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvDitherColor)(poempdev->pfnUnidrv[UD_DrvDitherColor])) ( - dhpdev, - iMode, - rgbColor, - pulDither)); - -} - -BOOL APIENTRY -OEMPaint( - SURFOBJ *pso, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrg, - MIX mix - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMPaint() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvPaint)(poempdev->pfnUnidrv[UD_DrvPaint])) ( - pso, - pco, - pbo, - pptlBrushOrg, - mix)); - -} - -BOOL APIENTRY -OEMLineTo( - SURFOBJ *pso, - CLIPOBJ *pco, - BRUSHOBJ *pbo, - LONG x1, - LONG y1, - LONG x2, - LONG y2, - RECTL *prclBounds, - MIX mix - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMLineTo() entry.\r\n")); - - pdevobj = (PDEVOBJ)pso->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvLineTo)(poempdev->pfnUnidrv[UD_DrvLineTo])) ( - pso, - pco, - pbo, - x1, - y1, - x2, - y2, - prclBounds, - mix)); - -} - - -// -// OEMStretchBltROP -// - -BOOL APIENTRY -OEMStretchBltROP( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlHTOrg, - RECTL *prclDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode, - BRUSHOBJ *pbo, - ROP4 rop4 - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMStretchBltROP() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvStretchBltROP)(poempdev->pfnUnidrv[UD_DrvStretchBltROP])) ( - psoDest, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlHTOrg, - prclDest, - prclSrc, - pptlMask, - iMode, - pbo, - rop4 - )); - - -} - -// -// OEMPlgBlt -// - -BOOL APIENTRY -OEMPlgBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - COLORADJUSTMENT *pca, - POINTL *pptlBrushOrg, - POINTFIX *pptfixDest, - RECTL *prclSrc, - POINTL *pptlMask, - ULONG iMode - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMPlgBlt() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoDst->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvPlgBlt)(poempdev->pfnUnidrv[UD_DrvPlgBlt])) ( - psoDst, - psoSrc, - psoMask, - pco, - pxlo, - pca, - pptlBrushOrg, - pptfixDest, - prclSrc, - pptlMask, - iMode)); - -} - -// -// OEMAlphaBlend -// - -BOOL APIENTRY -OEMAlphaBlend( - SURFOBJ *psoDest, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDest, - RECTL *prclSrc, - BLENDOBJ *pBlendObj - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMAlphaBlend() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvAlphaBlend)(poempdev->pfnUnidrv[UD_DrvAlphaBlend])) ( - psoDest, - psoSrc, - pco, - pxlo, - prclDest, - prclSrc, - pBlendObj - )); - -} - -// -// OEMGradientFill -// - -BOOL APIENTRY -OEMGradientFill( - SURFOBJ *psoDest, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - TRIVERTEX *pVertex, - ULONG nVertex, - PVOID pMesh, - ULONG nMesh, - RECTL *prclExtents, - POINTL *pptlDitherOrg, - ULONG ulMode - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMGradientFill() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoDest->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvGradientFill)(poempdev->pfnUnidrv[UD_DrvGradientFill])) ( - psoDest, - pco, - pxlo, - pVertex, - nVertex, - pMesh, - nMesh, - prclExtents, - pptlDitherOrg, - ulMode - )); - -} - -BOOL APIENTRY -OEMTransparentBlt( - SURFOBJ *psoDst, - SURFOBJ *psoSrc, - CLIPOBJ *pco, - XLATEOBJ *pxlo, - RECTL *prclDst, - RECTL *prclSrc, - ULONG iTransColor, - ULONG ulReserved - ) -{ - PDEVOBJ pdevobj; - POEMPDEV poempdev; - - VERBOSE(DLLTEXT("OEMTransparentBlt() entry.\r\n")); - - pdevobj = (PDEVOBJ)psoDst->dhpdev; - poempdev = (POEMPDEV)pdevobj->pdevOEM; - - // - // turn around to call Unidrv - // - - return (((PFN_DrvTransparentBlt)(poempdev->pfnUnidrv[UD_DrvTransparentBlt])) ( - psoDst, - psoSrc, - pco, - pxlo, - prclDst, - prclSrc, - iTransColor, - ulReserved - )); - -} - -void RenderWaterMark(PDEVOBJ pdevobj) -{ - POEMDEV pOemDevmode = (POEMDEV) pdevobj->pOEMDM; - // We have a programmable palette. See GPD file for PaletteProgrammable option. - // We are programming color index 8 to the new color and selectiing it with the PJL code "\xv%da%db%dc8I\xib*v8S". - // In the font selection code, we are selecting the arial font (4148)"\x1b(19U\x1b(s4148t0b0s%dv1P" - // Cursor position is hard coded to but you it can also be made dependent on user input. - // PCL5 can print in 0,90,180 and 270 degrees. So Vertical can also be supported. - // The \x1b*v7S after the watermark sets the foreground color back to black - - /* - //Note we can push and pop the cursor position if needed. - Push/Pop Cursor position - \x1b&f0S //push - \x1b&f1S //pop - */ - - PSTR pszBuffer = NULL; - char str_wmark[]="\x1b*v%da%db%dc8I\x1b*v8S\x1b(19U\x1b(s4148t0b0s%dv1P\x1b*p1000Y\x1b*p750X%ls\x1b*v7S"; - DWORD dwLen= FormatResource (str_wmark, - &pszBuffer, - GetRValue(pOemDevmode->crWmarkTextColor), - GetGValue(pOemDevmode->crWmarkTextColor), - GetBValue(pOemDevmode->crWmarkTextColor), - pOemDevmode->dwWmarkFontSize,pOemDevmode->szWaterMark); - - if ( dwLen != 0 ) - { - pdevobj->pDrvProcs->DrvWriteSpoolBuf(pdevobj, pszBuffer, dwLen); - } - - if ( pszBuffer ) - { - delete[]pszBuffer; - pszBuffer = NULL; - } -} - - -DWORD -FormatResource( - _In_ LPSTR pszResource, - _Out_ LPSTR *ppszBuffer, - ...) -{ - DWORD dwBufferSize = 0; - DWORD dwLoop = 0; - va_list vaList; - HRESULT hResult = S_OK; - - if ( NULL == pszResource || - NULL == ppszBuffer ) - { - hResult = E_INVALIDARG; - return 0; - } - - - if ( SUCCEEDED(hResult) ) - { - dwBufferSize = (DWORD)strlen(pszResource) + MAX_PATH; - - va_start(vaList, ppszBuffer); - - // *ppszBuffer should be NULL when passed in. - *ppszBuffer = NULL; - - // Allocate and format the string. - do { - - if(NULL != *ppszBuffer) - { - delete[] *ppszBuffer; - } - *ppszBuffer = new CHAR[dwBufferSize]; - if(NULL == *ppszBuffer) - { - hResult = E_OUTOFMEMORY; - goto Cleanup; - } - - hResult = StringCbVPrintfA(*ppszBuffer, dwBufferSize, pszResource, vaList); - - if(STRSAFE_E_INSUFFICIENT_BUFFER == hResult) - { - dwBufferSize *= 2; - } - - } while ( FAILED(hResult) && (dwLoop++ < MAX_LOOP)); - } - -Cleanup: - - // Check to see if we hit error. - if(FAILED(hResult)) - { - if(NULL != *ppszBuffer) - { - delete[] *ppszBuffer; - *ppszBuffer = NULL; - } - } - - va_end(vaList); - - if ( *ppszBuffer ) - { - DWORD dwToReturn = 0; - - if (SUCCEEDED(SIZETToDWord(strlen(*ppszBuffer), &dwToReturn))) - { - return dwToReturn; - } - } - return 0; -} diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/dllentry.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/dllentry.cpp deleted file mode 100644 index 5230f243..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/dllentry.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: dllentry.cpp -// -// PURPOSE: Source module for DLL entry function(s). -// - -#include "precomp.h" -#include "wmarkuni.h" -#include "debug.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -/////////////////////////////////////////////////////////// -// -// DLL entry point -// -BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved) -{ - UNREFERENCED_PARAMETER(hInst); - UNREFERENCED_PARAMETER(lpReserved); - - switch(wReason) - { - case DLL_PROCESS_ATTACH: - VERBOSE(DLLTEXT("Process attach.\r\n")); - break; - - case DLL_THREAD_ATTACH: - VERBOSE(DLLTEXT("Thread attach.\r\n")); - break; - - case DLL_PROCESS_DETACH: - VERBOSE(DLLTEXT("Process detach.\r\n")); - break; - - case DLL_THREAD_DETACH: - VERBOSE(DLLTEXT("Thread detach.\r\n")); - break; - } - - return TRUE; -} - - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/fdevmode.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/fdevmode.cpp deleted file mode 100644 index c32e0bcb..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/fdevmode.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: fDevmode.cpp -// -// -// PURPOSE: Place holder file for devmode functions. -// - -#include "precomp.h" -#include "wmarkuni.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - - -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.cpp deleted file mode 100644 index 5688cb8d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.cpp +++ /dev/null @@ -1,950 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.cpp -// -// -// PURPOSE: Interface for User Mode COM Customization DLL. -// - -#include "precomp.h" - -#include "wmarkuni.h" -#include "debug.h" -#include "intrface.h" -#include "name.h" - -// indicate to prefast that this is a user-mode component. -_Analysis_mode_(_Analysis_code_type_user_driver_); - -//////////////////////////////////////////////////////// -// Internal Globals -//////////////////////////////////////////////////////// - -static long g_cComponents = 0; // Count of active components -static long g_cServerLocks = 0; // Count of locks - -//////////////////////////////////////////////////////// -// Internal Constants -//////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////// -// Warning: the following array order must match the -// order in enum ENUMHOOKS. -/////////////////////////////////////////////////////// - -static const DRVFN OEMHookFuncs[] = -{ - { INDEX_DrvRealizeBrush, (PFN) OEMRealizeBrush }, - { INDEX_DrvDitherColor, (PFN) OEMDitherColor }, - { INDEX_DrvCopyBits, (PFN) OEMCopyBits }, - { INDEX_DrvBitBlt, (PFN) OEMBitBlt }, - { INDEX_DrvStretchBlt, (PFN) OEMStretchBlt }, - { INDEX_DrvTextOut, (PFN) OEMTextOut }, - { INDEX_DrvStrokePath, (PFN) OEMStrokePath }, - { INDEX_DrvFillPath, (PFN) OEMFillPath }, - { INDEX_DrvStrokeAndFillPath, (PFN) OEMStrokeAndFillPath }, - { INDEX_DrvPaint, (PFN) OEMPaint }, - { INDEX_DrvLineTo, (PFN) OEMLineTo }, - { INDEX_DrvStartPage, (PFN) OEMStartPage }, - { INDEX_DrvSendPage, (PFN) OEMSendPage }, - { INDEX_DrvEscape, (PFN) OEMEscape }, - { INDEX_DrvStartDoc, (PFN) OEMStartDoc }, - { INDEX_DrvEndDoc, (PFN) OEMEndDoc }, - { INDEX_DrvNextBand, (PFN) OEMNextBand }, - { INDEX_DrvStartBanding, (PFN) OEMStartBanding }, - { INDEX_DrvQueryFont, (PFN) OEMQueryFont }, - { INDEX_DrvQueryFontTree, (PFN) OEMQueryFontTree }, - { INDEX_DrvQueryFontData, (PFN) OEMQueryFontData }, - { INDEX_DrvQueryAdvanceWidths, (PFN) OEMQueryAdvanceWidths }, - { INDEX_DrvFontManagement, (PFN) OEMFontManagement }, - { INDEX_DrvGetGlyphMode, (PFN) OEMGetGlyphMode }, - { INDEX_DrvStretchBltROP, (PFN) OEMStretchBltROP }, - { INDEX_DrvPlgBlt, (PFN) OEMPlgBlt }, - { INDEX_DrvTransparentBlt, (PFN) OEMTransparentBlt }, - { INDEX_DrvAlphaBlend, (PFN) OEMAlphaBlend }, - { INDEX_DrvGradientFill, (PFN) OEMGradientFill }, -}; - -//////////////////////////////////////////////////////////////////////////////// -// -// IWmarkUni body -// -IWmarkUni::~IWmarkUni() -{ - // Make sure that helper interface is released. - if(NULL != m_pOEMHelp) - { - m_pOEMHelp->Release(); - m_pOEMHelp = NULL; - } - - // If this instance of the object is being deleted, then the reference - // count should be zero. - assert(0 == m_cRef); -} - - -HRESULT __stdcall IWmarkUni::QueryInterface(const IID& iid, void** ppv) -{ - if (iid == IID_IUnknown) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IWmarkUni::QueryInterface IUnknown.\r\n")); - } - else if (iid == IID_IPrintOemUni) - { - *ppv = static_cast(this); - VERBOSE(DLLTEXT("IWmarkUni::QueryInterface IPrintOemUni.\r\n")); - } - else - { - *ppv = NULL; - VERBOSE(DLLTEXT("IWmarkUni::QueryInterface interface not supported.\r\n")); - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall IWmarkUni::AddRef() -{ - VERBOSE(DLLTEXT("IWmarkUni::AddRef() entry.\r\n")); - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IWmarkUni::Release() -{ - VERBOSE(DLLTEXT("IWmarkUni::Release() entry.\r\n")); - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - - -HRESULT __stdcall IWmarkUni::GetInfo ( - DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IWmarkUni::GetInfo entry.\r\n")); - - // Validate parameters. - if( (NULL == pcbNeeded) - || - ( (OEMGI_GETSIGNATURE != dwMode) - && - (OEMGI_GETVERSION != dwMode) - && - (OEMGI_GETPUBLISHERINFO != dwMode) - ) - ) - { - WARNING(DLLTEXT("IWmarkUni::GetInfo() exit pcbNeeded is NULL! ERROR_INVALID_PARAMETER.\r\n")); - SetLastError(ERROR_INVALID_PARAMETER); - return E_FAIL; - } - - // Set expected buffer size. - if(OEMGI_GETPUBLISHERINFO != dwMode) - { - *pcbNeeded = sizeof(DWORD); - } - else - { - *pcbNeeded = sizeof(PUBLISHERINFO); - return E_FAIL; - } - - // Check buffer size is sufficient. - if((cbSize < *pcbNeeded) || (NULL == pBuffer)) - { - VERBOSE(DLLTEXT("IWmarkUni::GetInfo() exit insufficient buffer!\r\n")); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return E_FAIL; - } - - switch(dwMode) - { - // OEM DLL Signature - case OEMGI_GETSIGNATURE: - *(PDWORD)pBuffer = OEM_SIGNATURE; - break; - - // OEM DLL version - case OEMGI_GETVERSION: - *(PDWORD)pBuffer = OEM_VERSION; - break; - - // dwMode not supported. - case OEMGI_GETPUBLISHERINFO: - default: - // Set written bytes to zero since nothing was written. - WARNING(DLLTEXT("IWmarkUni::GetInfo() exit mode not supported.\r\n")); - *pcbNeeded = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return E_FAIL; - } - - VERBOSE(DLLTEXT("IWmarkUni::GetInfo() exit S_OK.\r\n")); - - return S_OK; -} - -HRESULT __stdcall IWmarkUni::PublishDriverInterface( - IUnknown *pIUnknown) -{ - VERBOSE(DLLTEXT("IWmarkUni::PublishDriverInterface() entry.\r\n")); - - // Need to store pointer to Driver Helper functions, if we already haven't. - if (this->m_pOEMHelp == NULL) - { - HRESULT hResult; - - - // Get Interface to Helper Functions. - hResult = pIUnknown->QueryInterface(IID_IPrintOemDriverUni, (void** ) &(this->m_pOEMHelp)); - - if(!SUCCEEDED(hResult)) - { - // Make sure that interface pointer reflects interface query failure. - this->m_pOEMHelp = NULL; - - return E_FAIL; - } - } - - return S_OK; -} - - -HRESULT __stdcall IWmarkUni::EnableDriver( - DWORD dwDriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded) -{ - VERBOSE(DLLTEXT("IWmarkUni::EnableDriver() entry.\r\n")); - - UNREFERENCED_PARAMETER(dwDriverVersion); - UNREFERENCED_PARAMETER(cbSize); - - // List DDI functions that are hooked. - pded->iDriverVersion = PRINTER_OEMINTF_VERSION; - pded->c = sizeof(OEMHookFuncs) / sizeof(DRVFN); - pded->pdrvfn = (DRVFN *) OEMHookFuncs; - - // Even if nothing is done, need to return S_OK so - // that DisableDriver() will be called, which releases - // the reference to the Printer Driver's interface. - // If error occurs, return E_FAIL. - return S_OK; -} - -HRESULT __stdcall IWmarkUni::DisableDriver(VOID) -{ - VERBOSE(DLLTEXT("IWmarkUni::DisaleDriver() entry.\r\n")); - - // Release reference to Printer Driver's interface. - if (this->m_pOEMHelp) - { - this->m_pOEMHelp->Release(); - this->m_pOEMHelp = NULL; - } - - return S_OK; -} - -HRESULT __stdcall IWmarkUni::DisablePDEV( - PDEVOBJ pdevobj) -{ - VERBOSE(DLLTEXT("IWmarkUni::DisablePDEV() entry.\r\n")); - - assert(NULL != pdevobj->pdevOEM); - delete pdevobj->pdevOEM; - - return S_OK; -}; - -HRESULT __stdcall IWmarkUni::EnablePDEV( - PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem) -{ - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pPrinterName); - UNREFERENCED_PARAMETER(cPatterns); - UNREFERENCED_PARAMETER(phsurfPatterns); - UNREFERENCED_PARAMETER(cjGdiInfo); - UNREFERENCED_PARAMETER(pGdiInfo); - UNREFERENCED_PARAMETER(cjDevInfo); - UNREFERENCED_PARAMETER(pDevInfo); - - VERBOSE(DLLTEXT("IWmarkUni::EnablePDEV() entry.\r\n")); - - POEMPDEV poempdev; - INT i, j; - DWORD dwDDIIndex; - PDRVFN pdrvfn; - - // - // Allocate the OEMDev - // - poempdev = new OEMPDEV; - if (NULL == poempdev) - { - return NULL; - } - - // - // Fill in OEMDEV - // - - for (i = 0; i < MAX_DDI_HOOKS; i++) - { - // - // search through Unidrv's hooks and locate the function ptr - // - dwDDIIndex = OEMHookFuncs[i].iFunc; - for (j = pded->c, pdrvfn = pded->pdrvfn; j > 0; j--, pdrvfn++) - { - if (dwDDIIndex == pdrvfn->iFunc) - { - poempdev->pfnUnidrv[i] = pdrvfn->pfn; - break; - } - } - if (j == 0) - { - // - // Didn't find the hook. This could mean Unidrv doesn't hook this DDI but allows OEMs to hook it out. - // - poempdev->pfnUnidrv[i] = NULL; - } - - } - - *pDevOem = (POEMPDEV) poempdev; - - return (NULL != *pDevOem ? S_OK : E_FAIL); -} - - -HRESULT __stdcall IWmarkUni::ResetPDEV( - PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew) -{ - VERBOSE(DLLTEXT("IWmarkUni::ResetPDEV() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobjOld); - UNREFERENCED_PARAMETER(pdevobjNew); - - return S_OK; -} - - -HRESULT __stdcall IWmarkUni::DevMode( - DWORD dwMode, - POEMDMPARAM pOemDMParam) -{ - VERBOSE(DLLTEXT("IWmarkUni:DevMode entry.\n")); - return hrOEMDevMode(dwMode, pOemDMParam); -} - -HRESULT __stdcall IWmarkUni::GetImplementedMethod(_In_ PSTR pMethodName) -{ - HRESULT Result = S_FALSE; - - - VERBOSE(DLLTEXT("IWmarkUni::GetImplementedMethod() entry.\r\n")); - - // Unidrv only calls GetImplementedMethod for optional - // methods. The required methods are assumed to be - // supported. - - // Return S_OK for supported function (i.e. implemented), - // and S_FALSE for functions that aren't supported (i.e. not implemented). - switch (*pMethodName) - { - case 'C': - if (!strcmp(NAME_CommandCallback, pMethodName)) - { - Result = S_OK; - } - else if (!strcmp(NAME_Compression, pMethodName)) - { - Result = S_FALSE; - } - break; - - case 'D': - if (!strcmp(NAME_DownloadFontHeader, pMethodName)) - { - Result = S_FALSE; - } - else if (!strcmp(NAME_DownloadCharGlyph, pMethodName)) - { - Result = S_FALSE; - } - break; - - case 'F': - if (!strcmp(NAME_FilterGraphics, pMethodName)) - { - Result = S_OK; - } - break; - - case 'H': - if (!strcmp(NAME_HalftonePattern, pMethodName)) - { - Result = S_FALSE; - } - break; - - case 'I': - if (!strcmp(NAME_ImageProcessing, pMethodName)) - { - Result = S_OK; - } - break; - - case 'M': - if (!strcmp(NAME_MemoryUsage, pMethodName)) - { - Result = S_FALSE; - } - break; - - case 'O': - if (!strcmp(NAME_OutputCharStr, pMethodName)) - { - Result = S_FALSE; - } - break; - - case 'S': - if (!strcmp(NAME_SendFontCmd, pMethodName)) - { - Result = S_FALSE; - } - break; - - case 'T': - if (!strcmp(NAME_TextOutAsBitmap, pMethodName)) - { - Result = S_FALSE; - } - else if (!strcmp(NAME_TTDownloadMethod, pMethodName)) - { - Result = S_FALSE; - } - else if (!strcmp(NAME_TTYGetInfo, pMethodName)) - { - Result = S_FALSE; - } - break; - - case 'W': - if(!strcmp(NAME_WritePrinter, pMethodName)) - { - Result = S_FALSE; - } - break; - } - - return Result; -} - -HRESULT __stdcall IWmarkUni::CommandCallback( - PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult) -{ - VERBOSE(DLLTEXT("IWmarkUni::CommandCallback() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pdwParams); - - *piResult = 0; - - return S_OK; -} - -HRESULT __stdcall IWmarkUni::ImageProcessing( - PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult) -{ - VERBOSE(DLLTEXT("IWmarkUni::ImageProcessing() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pSrcBitmap); - UNREFERENCED_PARAMETER(pBitmapInfoHeader); - UNREFERENCED_PARAMETER(pColorTable); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(pIPParams); - UNREFERENCED_PARAMETER(ppbResult); - - return S_OK; -} - -HRESULT __stdcall IWmarkUni::FilterGraphics( - PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen) -{ - DWORD dwResult; - VERBOSE(DLLTEXT("IWmarkUni::FilterGraphis() entry.\r\n")); - m_pOEMHelp->DrvWriteSpoolBuf(pdevobj, pBuf, dwLen, &dwResult); - - if (dwResult == dwLen) - return S_OK; - else - return E_FAIL; -} - -HRESULT __stdcall IWmarkUni::Compression( - PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult) -{ - VERBOSE(DLLTEXT("IWmarkUni::Compression() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pInBuf); - UNREFERENCED_PARAMETER(pOutBuf); - UNREFERENCED_PARAMETER(dwInLen); - UNREFERENCED_PARAMETER(dwOutLen); - UNREFERENCED_PARAMETER(piResult); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - - -HRESULT __stdcall IWmarkUni::HalftonePattern( - PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize) -{ - VERBOSE(DLLTEXT("IWmarkUni::HalftonePattern() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pHTPattern); - UNREFERENCED_PARAMETER(dwHTPatternX); - UNREFERENCED_PARAMETER(dwHTPatternY); - UNREFERENCED_PARAMETER(dwHTNumPatterns); - UNREFERENCED_PARAMETER(dwCallbackID); - UNREFERENCED_PARAMETER(pResource); - UNREFERENCED_PARAMETER(dwResourceSize); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::MemoryUsage( - PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage) -{ - VERBOSE(DLLTEXT("IWmarkUni::MemoryUsage() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pMemoryUsage); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::DownloadFontHeader( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult) -{ - VERBOSE(DLLTEXT("IWmarkUni::DownloadFontHeader() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::DownloadCharGlyph( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult) -{ - VERBOSE(DLLTEXT("IWmarkUni::DownloadCharGlyph() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(hGlyph); - UNREFERENCED_PARAMETER(pdwWidth); - UNREFERENCED_PARAMETER(pdwResult); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::TTDownloadMethod( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult) -{ - VERBOSE(DLLTEXT("IWmarkUni::TTDownloadMethod() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pdwResult); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::OutputCharStr( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph) -{ - VERBOSE(DLLTEXT("IWmarkUni::OutputCharStr() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(dwType); - UNREFERENCED_PARAMETER(dwCount); - UNREFERENCED_PARAMETER(pGlyph); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::SendFontCmd( - PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv) -{ - VERBOSE(DLLTEXT("IWmarkUni::SendFontCmd() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(pUFObj); - UNREFERENCED_PARAMETER(pFInv); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::DriverDMS( - PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded) -{ - VERBOSE(DLLTEXT("IWmarkUni::DriverDMS() entry.\r\n")); - - UNREFERENCED_PARAMETER(pDevObj); - UNREFERENCED_PARAMETER(pBuffer); - UNREFERENCED_PARAMETER(cbSize); - UNREFERENCED_PARAMETER(pcbNeeded); - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::TextOutAsBitmap( - SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix) -{ - VERBOSE(DLLTEXT("IWmarkUni::TextOutAsBitmap() entry.\r\n")); - - UNREFERENCED_PARAMETER(pso); - UNREFERENCED_PARAMETER(pstro); - UNREFERENCED_PARAMETER(pfo); - UNREFERENCED_PARAMETER(pco); - UNREFERENCED_PARAMETER(prclExtra); - UNREFERENCED_PARAMETER(prclOpaque); - UNREFERENCED_PARAMETER(pboFore); - UNREFERENCED_PARAMETER(pboOpaque); - UNREFERENCED_PARAMETER(pptlOrg); - UNREFERENCED_PARAMETER(mix); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - -HRESULT __stdcall IWmarkUni::TTYGetInfo( - PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded) -{ - VERBOSE(DLLTEXT("IWmarkUni::TTYGetInfo() entry.\r\n")); - - UNREFERENCED_PARAMETER(pdevobj); - UNREFERENCED_PARAMETER(dwInfoIndex); - UNREFERENCED_PARAMETER(pOutputBuf); - UNREFERENCED_PARAMETER(dwSize); - UNREFERENCED_PARAMETER(pcbcNeeded); - - // When implemented, the return from GetImplementedMethod - // for this method name must be S_OK. - - return E_NOTIMPL; -} - - -//////////////////////////////////////////////////////////////////////////////// -// -// oem class factory -// -class IOemCF : public IClassFactory -{ -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // *** IClassFactory methods *** - STDMETHOD(CreateInstance) (THIS_ - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID FAR* ppvObject); - STDMETHOD(LockServer) (THIS_ BOOL bLock); - - - // Constructor - IOemCF(): m_cRef(1) { }; - ~IOemCF() { }; - -protected: - LONG m_cRef; - -}; - -/////////////////////////////////////////////////////////// -// -// Class factory body -// -HRESULT __stdcall IOemCF::QueryInterface(const IID& iid, void** ppv) -{ - if ((iid == IID_IUnknown) || (iid == IID_IClassFactory)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - VERBOSE(DLLTEXT("IOemCF::QueryInterface interface not supported.\r\n")); - return E_NOINTERFACE; - } - reinterpret_cast(*ppv)->AddRef(); - return S_OK; -} - -ULONG __stdcall IOemCF::AddRef() -{ - return InterlockedIncrement(&m_cRef); -} - -_At_(this, __drv_freesMem(object)) -ULONG __stdcall IOemCF::Release() -{ - ASSERT( 0 != m_cRef); - ULONG cRef = InterlockedDecrement(&m_cRef); - if (0 == cRef) - { - delete this; - - } - return cRef; -} - -// IClassFactory implementation -HRESULT __stdcall IOemCF::CreateInstance(IUnknown* pUnknownOuter, - const IID& iid, - void** ppv) -{ - //VERBOSE(DLLTEXT("Class factory:\t\tCreate component.")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Cannot aggregate. - if (pUnknownOuter != NULL) - { - return CLASS_E_NOAGGREGATION; - } - - // Create component. - IWmarkUni* pOemCP = new IWmarkUni; - if (pOemCP == NULL) - { - return E_OUTOFMEMORY; - } - - // Get the requested interface. - HRESULT hr = pOemCP->QueryInterface(iid, ppv); - - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - pOemCP->Release(); - return hr; -} - -// LockServer -HRESULT __stdcall IOemCF::LockServer(BOOL bLock) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - return S_OK; -} - - -// -// Registration functions -// - -// -// Can DLL unload now? -// -STDAPI DllCanUnloadNow() -{ - // - // To avoid leaving OEM DLL still in memory when Unidrv or Pscript drivers - // are unloaded, Unidrv and Pscript driver ignore the return value of - // DllCanUnloadNow of the OEM DLL, and always call FreeLibrary on the OEMDLL. - // - // If OEM DLL spins off a working thread that also uses the OEM DLL, the - // thread needs to call LoadLibrary and FreeLibraryAndExitThread, otherwise - // it may crash after Unidrv or Pscript calls FreeLibrary. - // - - VERBOSE(DLLTEXT("DllCanUnloadNow entered.\r\n")); - - if ((g_cComponents == 0) && (g_cServerLocks == 0)) - { - return S_OK; - } - else - { - return S_FALSE; - } -} - -// -// Get class factory -// -STDAPI DllGetClassObject( - _In_ REFCLSID clsid, - _In_ REFIID iid, - _Outptr_ LPVOID* ppv) -{ - VERBOSE(DLLTEXT("DllGetClassObject:\tCreate class factory.\r\n")); - - if (ppv == NULL) - { - return E_POINTER; - } - *ppv = NULL; - - // Can we create this component? - if (clsid != CLSID_OEMRENDER) - { - return CLASS_E_CLASSNOTAVAILABLE; - } - - // Create class factory. - IOemCF* pFontCF = new IOemCF; // Reference count set to 1 - // in constructor - if (pFontCF == NULL) - { - return E_OUTOFMEMORY; - } - - // Get requested interface. - HRESULT hr = pFontCF->QueryInterface(iid, ppv); - pFontCF->Release(); - - return hr; -} - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.h deleted file mode 100644 index a87f5ba4..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/intrface.h +++ /dev/null @@ -1,254 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Intrface.H -// -// -// PURPOSE: Define COM interface for User Mode Printer Customization DLL. -// -#pragma once - - -//////////////////////////////////////////////////////////////////////////////// -// -// IWmarkUni -// -// Interface for Unidrv OEM sample rendering module -// -class IWmarkUni : public IPrintOemUni -{ -public: -public: - // *** IUnknown methods *** - - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj); - - STDMETHOD_(ULONG,AddRef) (THIS); - - // the _At_ tag here tells prefast that once release - // is called, the memory should not be considered leaked - _At_(this, __drv_freesMem(object)) - STDMETHOD_(ULONG,Release) (THIS); - - // - // Method for publishing Driver interface. - // - STDMETHOD(PublishDriverInterface)(THIS_ IUnknown *pIUnknown); - - // - // Method for getting the implemented methods. - // Returns S_OK if the given method is implemneted. - // Returns S_FALSE if the given method is notimplemneted. - // - - STDMETHOD(GetImplementedMethod)(THIS_ _In_ PSTR pMethodName); - - // - // Method for OEM to specify DDI hook out - // - - STDMETHOD(EnableDriver) (THIS_ DWORD DriverVersion, - DWORD cbSize, - PDRVENABLEDATA pded); - - // - // Method to notify OEM plugin that it is no longer required - // - - STDMETHOD(DisableDriver) (THIS); - - // - // Method for OEM to contruct its own PDEV - // - - STDMETHOD(EnablePDEV) (THIS_ PDEVOBJ pdevobj, - _In_ PWSTR pPrinterName, - ULONG cPatterns, - HSURF *phsurfPatterns, - ULONG cjGdiInfo, - GDIINFO *pGdiInfo, - ULONG cjDevInfo, - DEVINFO *pDevInfo, - DRVENABLEDATA *pded, - OUT PDEVOEM *pDevOem); - - // - // Method for OEM to free any resource associated with its PDEV - // - - STDMETHOD(DisablePDEV) (THIS_ PDEVOBJ pdevobj); - - // - // Method for OEM to transfer from old PDEV to new PDEV - // - - STDMETHOD(ResetPDEV) (THIS_ PDEVOBJ pdevobjOld, - PDEVOBJ pdevobjNew); - - // - // Get OEM dll related information - // - - STDMETHOD(GetInfo) (THIS_ DWORD dwMode, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDriverDMS - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(DriverDMS)(THIS_ PVOID pDevObj, - PVOID pBuffer, - DWORD cbSize, - PDWORD pcbNeeded); - - // - // OEMDevMode - // - - STDMETHOD(DevMode) (THIS_ DWORD dwMode, - POEMDMPARAM pOemDMParam); - - // - // OEMCommandCallback - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(CommandCallback)(THIS_ PDEVOBJ pdevobj, - DWORD dwCallbackID, - DWORD dwCount, - PDWORD pdwParams, - OUT INT *piResult); - - // - // OEMImageProcessing - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(ImageProcessing)(THIS_ PDEVOBJ pdevobj, - PBYTE pSrcBitmap, - PBITMAPINFOHEADER pBitmapInfoHeader, - PBYTE pColorTable, - DWORD dwCallbackID, - PIPPARAMS pIPParams, - OUT PBYTE *ppbResult); - - // - // OEMFilterGraphics - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(FilterGraphics) (THIS_ PDEVOBJ pdevobj, - PBYTE pBuf, - DWORD dwLen); - // - // OEMCompression - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(Compression)(THIS_ PDEVOBJ pdevobj, - PBYTE pInBuf, - PBYTE pOutBuf, - DWORD dwInLen, - DWORD dwOutLen, - OUT INT *piResult); - - // - // OEMHalftone - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(HalftonePattern) (THIS_ PDEVOBJ pdevobj, - PBYTE pHTPattern, - DWORD dwHTPatternX, - DWORD dwHTPatternY, - DWORD dwHTNumPatterns, - DWORD dwCallbackID, - PBYTE pResource, - DWORD dwResourceSize); - - // - // OEMMemoryUsage - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(MemoryUsage) (THIS_ PDEVOBJ pdevobj, - POEMMEMORYUSAGE pMemoryUsage); - - // - // OEMTTYGetInfo - UNIDRV only, return E_NOTIMPL on Pscript - // - - STDMETHOD(TTYGetInfo)(THIS_ PDEVOBJ pdevobj, - DWORD dwInfoIndex, - PVOID pOutputBuf, - DWORD dwSize, - DWORD *pcbcNeeded); - - // - // OEMDownloadFontheader - UNIDRV only - // - - STDMETHOD(DownloadFontHeader)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMDownloadCharGlyph - UNIDRV only - // - - STDMETHOD(DownloadCharGlyph)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - HGLYPH hGlyph, - PDWORD pdwWidth, - OUT DWORD *pdwResult); - - // - // OEMTTDownloadMethod - UNIDRV only - // - - STDMETHOD(TTDownloadMethod)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - OUT DWORD *pdwResult); - - // - // OEMOutputCharStr - UNIDRV only - // - - STDMETHOD(OutputCharStr)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - DWORD dwType, - DWORD dwCount, - PVOID pGlyph); - - // - // OEMSendFontCmd - UNIDRV only - // - - - STDMETHOD(SendFontCmd)(THIS_ PDEVOBJ pdevobj, - PUNIFONTOBJ pUFObj, - PFINVOCATION pFInv); - - // - // OEMTextOutAsBitmap - UNIDRV only - // - - STDMETHOD(TextOutAsBitmap)(THIS_ SURFOBJ *pso, - STROBJ *pstro, - FONTOBJ *pfo, - CLIPOBJ *pco, - RECTL *prclExtra, - RECTL *prclOpaque, - BRUSHOBJ *pboFore, - BRUSHOBJ *pboOpaque, - POINTL *pptlOrg, - MIX mix); - - - IWmarkUni() { m_cRef = 1; m_pOEMHelp = NULL; }; - ~IWmarkUni(); - -protected: - LONG m_cRef; - IPrintOemDriverUni* m_pOEMHelp; -}; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/name.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/name.h deleted file mode 100644 index 3018823b..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/name.h +++ /dev/null @@ -1,34 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1996 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: Name.H -// -// -// PURPOSE: Define string literals for interface funcion names. -// -#pragma once - -///////////////////////////////////////////////////////// -// String Leterals -///////////////////////////////////////////////////////// - - -CONST CHAR NAME_CommandCallback[] = "CommandCallback"; -CONST CHAR NAME_Compression[] = "Compression"; -CONST CHAR NAME_DownloadCharGlyph[] = "DownloadCharGlyph"; -CONST CHAR NAME_DownloadFontHeader[] = "DownloadFontHeader"; -CONST CHAR NAME_FilterGraphics[] = "FilterGraphics"; -CONST CHAR NAME_HalftonePattern[] = "HalftonePattern"; -CONST CHAR NAME_ImageProcessing[] = "ImageProcessing"; -CONST CHAR NAME_MemoryUsage[] = "MemoryUsage"; -CONST CHAR NAME_OutputCharStr[] = "OutputCharStr"; -CONST CHAR NAME_SendFontCmd[] = "SendFontCmd"; -CONST CHAR NAME_TextOutAsBitmap[] = "TextOutAsBitmap"; -CONST CHAR NAME_TTDownloadMethod[] = "TTDownloadMethod"; -CONST CHAR NAME_TTYGetInfo[] = "TTYGetInfo"; -CONST CHAR NAME_WritePrinter[] = "WritePrinter"; - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precomp.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precomp.h deleted file mode 100644 index 48078a7d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precomp.h +++ /dev/null @@ -1,53 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: precomp.H -// -// -// PURPOSE: Optimize compilation of headers that don't change frequently. -// -#pragma once - -// Necessary for compiling under VC. -#if(!defined(WINVER) || (WINVER < 0x0500)) - #undef WINVER - #define WINVER 0x0500 -#endif -#if(!defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)) - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 -#endif - - - -// Required header files that shouldn't change often. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Safe integer functions to detect integer overflow/underflow conditions: -#include - -// StrSafe.h needs to be included last -// to disallow unsafe string functions. -#include - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precompsrc.cpp b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/resource.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/resource.h deleted file mode 100644 index 35637c60..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by WMARKUNI.rc -// - - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.def b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.def deleted file mode 100644 index 86e376e8..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.def +++ /dev/null @@ -1,3 +0,0 @@ -LIBRARY WMARKUNI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.h b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.h deleted file mode 100644 index 87415a42..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.h +++ /dev/null @@ -1,82 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright 1997 - 2003 Microsoft Corporation. All Rights Reserved. -// -// FILE: WMARKUNI.H -// -// -// PURPOSE: Define common data types, and external function prototypes -// for debug.cpp. -// -#pragma once - -#include "OEM.H" -#include "DEVMODE.H" - - -//////////////////////////////////////////////////////// -// OEM Defines -//////////////////////////////////////////////////////// - -#define DLLTEXT(s) "WMARKUNI: " s - -/////////////////////////////////////////////////////// -// Warning: the following enum order must match the -// order in OEMHookFuncs[]. -/////////////////////////////////////////////////////// -typedef enum tag_Hooks { - UD_DrvRealizeBrush, - UD_DrvDitherColor, - UD_DrvCopyBits, - UD_DrvBitBlt, - UD_DrvStretchBlt, - UD_DrvTextOut, - UD_DrvStrokePath, - UD_DrvFillPath, - UD_DrvStrokeAndFillPath, - UD_DrvPaint, - UD_DrvLineTo, - UD_DrvStartPage, - UD_DrvSendPage, - UD_DrvEscape, - UD_DrvStartDoc, - UD_DrvEndDoc, - UD_DrvNextBand, - UD_DrvStartBanding, - UD_DrvQueryFont, - UD_DrvQueryFontTree, - UD_DrvQueryFontData, - UD_DrvQueryAdvanceWidths, - UD_DrvFontManagement, - UD_DrvGetGlyphMode, - UD_DrvStretchBltROP, - UD_DrvPlgBlt, - UD_DrvTransparentBlt, - UD_DrvAlphaBlend, - UD_DrvGradientFill, - - MAX_DDI_HOOKS, - -} ENUMHOOKS; - - -typedef struct _OEMPDEV { - // - // define whatever needed, such as working buffers, tracking information, - // etc. - // - // This test DLL hooks out every drawing DDI. So it needs to remember - // Unidrv's hook function pointer so it call back. - // - PFN pfnUnidrv[MAX_DDI_HOOKS]; - - // - // define whatever needed, such as working buffers, tracking information, - // etc. - // - DWORD dwReserved[1]; - -} OEMPDEV, *POEMPDEV; diff --git a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.rc b/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.rc deleted file mode 100644 index 54b0f627..00000000 --- a/print/OEM Printer Customization Plug-in Samples/C++/watermarkuni/wmarkuni/wmarkuni.rc +++ /dev/null @@ -1,104 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Written by Printing & Imaging Team" - VALUE "CompanyName", "Microsoft Corp." - VALUE "FileDescription", "Watermark Unidriver Sample" - VALUE "FileVersion", "1, 0, 0, 1" - VALUE "InternalName", "OEMPS" - VALUE "LegalCopyright", "Copyright © 1998-2003" - VALUE "LegalTrademarks", "Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation" - VALUE "OriginalFilename", "WMARKUNI.DLL" - VALUE "ProductName", "Microsoft WMARKUNI" - VALUE "ProductVersion", "1.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/OEM Printer Customization Plug-in Samples/C++/winxp.inf b/print/OEM Printer Customization Plug-in Samples/C++/winxp.inf deleted file mode 100644 index cf0ab050..00000000 Binary files a/print/OEM Printer Customization Plug-in Samples/C++/winxp.inf and /dev/null differ diff --git a/print/OEM Printer Customization Plug-in Samples/README.md b/print/OEM Printer Customization Plug-in Samples/README.md deleted file mode 100644 index 4a5fcf8d..00000000 --- a/print/OEM Printer Customization Plug-in Samples/README.md +++ /dev/null @@ -1,146 +0,0 @@ ---- -page_type: sample -description: "Provides examples of how to build OEM printer customization plug-ins." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# OEM Printer Customization Plug-in Samples - -The OEMDLL samples are an illustration of OEM customization plug-ins. The BITMAP, OEMPS, OEMUI, OEMUNI, OEMPREAN, CUSTHLP, SyncSet, ThemeUI, PSUIRep, and Watermark samples do not affect the printer output. They are only examples of how to build OEM Customization DLLs of various types. - -The following samples are included as part of this sample set: - -| Sample | Description | -| --- | --- | -| BITMAP | A Unidrv-based bitmap rendering plug-in. This sample demonstrates how to write a Unidrv-based rendering plug-in that functions as a bitmap driver. The sample is based on the redesigned version of the OEMUNI sample. | -| CUSTHLP | An OEM help-customization plug-in. This sample demonstrates adding OEM help to your customization plug-in and how to replace standard Microsoft supplied help with customized help. | -| OEMPREAN | Illustrates how you can leverage the pre-analysis feature in Unidrv. This sample is built on the redesigned version of the OEMUNI sample. | -| OEMPS | A PostScript rendering plug-in. This sample demonstrates how to write a PostScript-based rendering plug-in. | -| OEMUI | A user interface plug-in (both PostScript and Unidrv flavors are available). The OEMUI sample demonstrates common UI tasks such as adding additional elements to the UI (that is, items and pages). | -| OEMUNI | A user interface plug-in (both PostScript and Unidrv flavors are available). The OEMUI sample demonstrates common UI tasks such as adding additional elements to the UI (that is, items and pages). | -| PSUIREP | A PostScript UI replacement sample. This sample demonstrates how to completely replace the standard printer driver UI for PostScript driver plug-ins. | -| PTPCPIPR | The Unidrv Plug-in for Print Ticket Provider Interface sample contains a functional Unidrv configuration plug-in that implements the IPrintOemPrintTicketProvider interface. You can use this code as a starting point for developing new driver plug-ins that support PrintTicket functionality. | -| SYNCSET | A synchronization plug-in. This sample demonstrates how to synchronize driver settings between the OEM customization page and the standard device settings page. | -| THEMEUI | A theming plug-in. This sample demonstrates how to use theming (that is, comctl v6) for printer driver UI. | -| UNIUIREP | This Universal Printer Driver (Unidrv) UI plugin sample shows how to fully replace Unidrv's standard UI and how to use the new IPrintCoreHelper interface to enumerate GDP features/options, enumerate constraints, get/set Unidrv settings, and create a GDL snapshot. | -| WATERMARK | Demonstrates how to produce customizable watermark page simulation by controlling PostScript injected in the printing stream. The components of the sample include a PostScript-based rendering module in conjunction with a UI module. The rendering module is responsible for the injection of the modified PostScript into the printing stream. This sample demonstrates the required COM interfaces, required functions with sample code and how to use the OEM's private DEVMODE section to communicate between the UI and rendering modules. | -| WATERMARKUNI | Demonstrates how to produce customizable watermark page simulation by controlling PCL data injected in the printing stream. The components of the sample include a UNIDRV-based rendering module in conjunction with a UI module. The rendering module is responsible for the injection of the PCL data into the printing stream. This sample demonstrates the required COM interfaces, required functions with sample code and how to use the OEM's private DEVMODE section to communicate between the UI and rendering modules. This sample works only if you have a page printer that has its own fonts. It doesn't download any fonts nor convert fonts to bitmap. | - -For information about how to develop a plug-in for customizing the print driver UI, see [COM Interfaces for UI Plug-Ins](https://docs.microsoft.com/windows-hardware/drivers/print/com-interfaces-for-ui-plug-ins). - -> [!NOTE] -> The OEMDLL samples are for the v3 print driver model only. - -To build this sample, you can use Microsoft Visual Studio 2017 (Community, Professional, or Enterprise) and Windows Driver Kit (WDK) 10. You can get Visual Studio 2017 [here](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) and WDK 10 [here](https://docs.microsoft.com/windows-hardware/drivers/download-the-wdk). - -You can also build this sample with Visual Studio 2013 (Professional or Ultimate) and Windows Driver Kit (WDK) 8.1. - -For Windows Driver Kit (WDK) 8 samples, download the WDK 8 samples pack. The samples in the WDK 8 samples pack will build only with Microsoft Visual Studio Professional 2012 (Professional or Ultimate) and WDK 8. - -## Operating system requirements - -Client - Windows 7 or later -Server - Windows Server 2008 R2 or later - -## Build the sample - -To build a driver solution using Windows 10 driver kit (Windows Driver Kit (WDK)) and Visual Studio 2017, perform the following steps: - -1. Open the solution file in Visual Studio 2017 - -1. Add all non-binary files (usually located in the \install directory of the sample) to the Package project - - 1. In the **Solution Explorer**, right click **Driver Files**. If you can't find **Driver Files** in this step, please change the "Platform Toolset" like below - - a. In the **Solution Explorer**, right click the Package project which you want to build and select **Properties** - - b. Select **General** under the **Configuration Properties** - - c. Change **Platform Toolset** to **WindowsKernelModeDriver10.0** or **WindowsUserModeDriver10.0** - - 1. Select **Add**, then click **Existing Item** - - 1. Navigate to the location to which you downloaded the sample, and select all the files in the install directory, or the equivalent set of non-binary files such as INFs, INIs, GPD, PPD files, etc. - - 1. Click **Add** - -1. Configure these files to be added into the driver package - - 1. In the **Solution Explorer**, right click the Package project and select **Properties** - - 1. In the left pane, click **Configuration Properties** > **Driver Install** > **Package Files**. - - 1. In the right pane, use the ellipsis button (...) to browse to the set of files that needs to be added to the driver package. All the data files that you added in **Step 2-c**, except the INF file, should be added. This configuration is per-architecture, so this configuration must be repeated for each architecture that will be built. - - 1. Click **OK** - -1. Open the INF file and edit it to match the built output - - 1. Open the INF file - - 1. In the Version section, add a reference to a catalog file that matches the .INF name like this: CatalogFile=XpsDrvSmpl.cat - - 1. In the SourceDisksFiles section, change the location of the DLL files you are building, to =1. This indicates that there is no architecture specific directory in this driver. If you ship multiple architectures simultaneously, you will need to collate the driver INF manually. - -At this point, Visual Studio 2017 will be able to build a driver package and output the files to disk. In order to configure driver signing and deployment, see [Developing, Testing, and Deploying Drivers](https://docs.microsoft.com/windows-hardware/drivers/develop/). - -For more information about how to build a driver solution using Microsoft Visual Studio, see [Building a Driver with Visual Studio and the WDK](https://docs.microsoft.com/windows-hardware/drivers/develop/building-a-driver). - -## Run the sample - -### Installation - -After building the samples, you can install them by using the Add Printer Wizard. Select the local printer, click Have Disk, and point to the directory that contains the relevant INF (oemdll.inf, bitmap.inf, oemprean.inf, and so on) file. - -## Design and Operation - -### BITMAP - -This sample includes the following features: - -- The supported ColorMode options in the bitmap driver's GPD are monochrome, 4bpp, 8bpp, and 24bpp. - -- The bitmap driver implements the IPrintOemUni::ImageProcessing callback to access bitmap data one band at a time. The driver's implementation of ImageProcessing buffers the band data every time it is called. The function is also responsible for filling the BITMAPINFOHEADER and COLORTABLE structures that are necessary for dumping the data out to a bitmap file. - -- The bitmap driver implements the OEMEndDoc DDI hook to dump the buffered bitmap data to the spooler at the end of the print job. The driver's implementation of OEMEndDoc dumps the headers first and then the buffered data. - -- The GrowBuffer helper function is called every time the buffer needs to be enlarged to hold the bitmap data. - -- The bitmap driver renders multi-page documents into a single large output bitmap file. - -This sample has the following limitations: - -- The plug-in does not support landscape orientation although the option exists in the GPD. - -- In 24bpp mode, documents larger than three pages will produce an extremely large bitmap (.bmp) file. Although the output is correct, you might not be able to view it because of memory limitations in the bitmap viewer. - -### OEMPREAN - -When preanalysis is enabled in the GPD (for more details about preanalysis, see the WDK documentation), Unidrv defines the surface as a banding surface but causes the first playback (that is, the first band) to be of the entire page. Unidrv performs this definition by setting the GDI clip window to the entire page. Unidrv enables all drawing commands to be hooked but returns before any drawing can be done. On the subsequent passes, Unidrv resets the clip window back to the original band size and bands normally. - -In order for plugins to also take part in preanalysis, they can enable OEM preanalysis by specifying the `"*PreAnalysisOptions: 8"` parameter in the GPD. The OEM rendering plug-in must hook both `DrvStartBanding` and `DrvNextBand` when this mode is enabled in the GPD. The OEM rendering plug-in must test the `pptl` parameter of the `OEMStartBanding` call to determine whether preanalysis has been enabled on this page. If the `pptl` parameter is `NULL`, preanalysis has been enabled, and the OEM rendering plug-in should consider all drawing calls up to the first call to `OEMNextBand` to be part of preanalysis. - -During these preanalysis phase drawing calls, the plug-in should not draw on the surface. The plug-in should also not call back into unidrv. You should use this phase only for analysis of the objects on the page. For example, certain printers need to handle black objects that intersect with color objects differently from black objects that appear by themselves. Other printers might need to halftone `StretchBlt` objects differently from `BitBlt` objects. -You should be aware that after preanalysis, you might get more calls than you saw in the normal rendering, because primitives that cross band boundaries yield two or more DDI calls after the preanalysis pass. -The sample uses the `bPreAnalysis` flag in the OEMPDEV structure to denote whether a particular pass is the preanalysis pass or the actual rendering pass. If the `bPreAnalysis` flag is set, it indicates that the current pass is the preanalysis pass. The sample implements all of the drawing function hooks in Ddihook.cpp. The sample uses the `OEMStartBanding` and `OEMNextBand` functions to respectively set and reset the `bPreAnalysis` flag. The sample also uses the `DBG_CLIPOBJ` debug macro function to dump the bounds of the clipping rectangle available for preanalysis in each of the drawing functions during the preanalysis pass. To view all of the debug output in the debugger, you must set the debug level to VERBOSE. The rest of the sample is identical to the Oemuni sample that illustrates a basic OEM rendering plug-in. - -> [!NOTE] -> The surface used during preanalysis might differ from the surface passed in during the rendering pass. - -### PTPCPIPR - -This sample is an educational example that illustrates the basic functionality that a Unidrv plug-in for the `IPrintOemPrintTicketProvider` interface should implement. -The primary functionality of the plug-in is to support the PhotoPrintingIntent PrintSchema keyword. The PhotoPrintingIntent keyword is designed to provide a mechanism for photo printers to support enhancements that are specific to photo printing. An application or the user (through the print UI) can then specify whether a particular print job is a photo-printing job, in which case the device can apply appropriate enhancements. -The intent setting is communicated to the device driver in a PrintTicket. The actual enhancements made are device-specific, and as such, the driver has to map the high-level intent setting into specific output settings, like resolution or bpp. This plug-in sample demonstrates the conversion. -The plug-in implements the `ExpandIntentOptions` method of the `IPrintOemPrintTicketProvider` interface. This method is called with an input print-ticket. The plug-in checks if the print-ticket contains a photo-printing intent setting, and if so, removes the setting, while instead adding to the print-ticket output settings as mentioned above. The code sample uses MSXML6 for all PrintTicket XML handling. - -### UINUIREP - -This sample shows how a plug-in for a Unidrv-based driver can replace the default UI. It provides new property sheets for the printer property and printing preferences pages. -Use this sample as an example of implementing full UI replacement in a Unidrv-based plugin. It also demonstrates the use of the new `IPrintCoreHelper` interface. - -This sample is only provided for educational purposes and should not be used in a production environment. diff --git a/print/OEM Printer Customization Plug-in Samples/license.rtf b/print/OEM Printer Customization Plug-in Samples/license.rtf deleted file mode 100644 index 690a7ad0..00000000 --- a/print/OEM Printer Customization Plug-in Samples/license.rtf +++ /dev/null @@ -1,25 +0,0 @@ -{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 MS Shell Dlg;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs16\f2\cf0 \cf0\ql{\f2 \line \li0\ri0\sa0\sb0\fi0\ql\par} -{\fs40\f2 {\ltrch MICROSOFT LIMITED PUBLIC LICENSE version 1.1}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 \line {\ltrch ----------------------}\line \li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch This license governs use of code marked as \ldblquote sample\rdblquote or \ldblquote example\rdblquote available on this web site without a license agreement, as provided under the section above titled \ldblquote NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEB SITE.\rdblquote If you use such code (the \ldblquote software\rdblquote ), you accept this license. If you do not accept the license, do not use the software.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 \line \li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch 1. Definitions}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch The terms \ldblquote reproduce,\rdblquote \ldblquote reproduction,\rdblquote \ldblquote derivative works,\rdblquote and \ldblquote distribution\rdblquote have the same meaning here as under U.S. copyright law. }\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch A \ldblquote contribution\rdblquote is the original software, or any additions or changes to the software.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch A \ldblquote contributor\rdblquote is any person that distributes its contribution under this license.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch \ldblquote Licensed patents\rdblquote are a contributor\rquote s patent claims that read directly on its contribution.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 \line \li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch 2. Grant of Rights}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (A) Copyright Grant - Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (B) Patent Grant - Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 \line \li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch 3. Conditions and Limitations}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (A) No Trademark License- This license does not grant you rights to use any contributors\rquote name, logo, or trademarks.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (E) The software is licensed \ldblquote as-is.\rdblquote You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 {\ltrch (F) Platform Limitation - The licenses granted in sections 2(A) and 2(B) extend only to the software or derivative works that you create that run directly on a Microsoft Windows operating system product, Microsoft run-time technology (such as the .NET Framework or Silverlight), or Microsoft application platform (such as Microsoft Office or Microsoft Dynamics).}\li0\ri0\sa0\sb0\fi0\ql\par} -{\f2 \line \li0\ri0\sa0\sb0\fi0\ql\par} -} -} \ No newline at end of file diff --git a/print/README.md b/print/README.md new file mode 100644 index 00000000..4550aae0 --- /dev/null +++ b/print/README.md @@ -0,0 +1,5 @@ +# Printer Device Development with Print Support Apps (PSA) + +We recommend that you use Microsoft's IPP inbox class driver, along with Print Support Apps (PSA), to customize the print experience in Windows 10 and 11 for printer device development. + +For more information, see [Print support app design guide](https://learn.microsoft.com/windows-hardware/drivers/devapps/print-support-app-design-guide). diff --git a/print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj b/print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj deleted file mode 100644 index f59d1592..00000000 --- a/print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {3B7F3284-4571-493B-87DF-0DCEB924EDED} - $(MSBuildProjectName) - false - Debug - Win32 - {BA1AE07D-3F9D-449F-B619-E3B4F1A30603} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - BlankProject - - - BlankProject - - - BlankProject - - - BlankProject - - - BlankProject - - - BlankProject - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj.Filters b/print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj.Filters deleted file mode 100644 index 43165228..00000000 --- a/print/SampleOpenXPS/BlankProjSrc/BlankProject.vcxproj.Filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {42A3275D-9934-47FA-AD0F-7DBA1E120F71} - - - h;hpp;hxx;hm;inl;inc;xsd - {FFB74D15-891F-4C17-9361-01A451D65842} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {04F8087D-4C32-4605-8E33-40D0F6A3B97E} - - - \ No newline at end of file diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.1a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.1a.oxps deleted file mode 100644 index 7d57c6fa..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.1a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.2a.oxps deleted file mode 100644 index 8da67915..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M1.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.14a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.14a.oxps deleted file mode 100644 index a68e8299..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.14a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.17a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.17a.oxps deleted file mode 100644 index 5787ab9e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.17a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.20a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.20a.oxps deleted file mode 100644 index 272f75ff..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.20a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.24a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.24a.oxps deleted file mode 100644 index 3cb95fbd..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.24a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27a.oxps deleted file mode 100644 index b6dd42fc..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27b.oxps deleted file mode 100644 index 2d5a4a59..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.27b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.30a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.30a.oxps deleted file mode 100644 index 0063c896..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.30a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.31a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.31a.oxps deleted file mode 100644 index 82a3cec8..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.31a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.32a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.32a.oxps deleted file mode 100644 index 821826a6..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.32a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.33a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.33a.oxps deleted file mode 100644 index 1a709467..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.33a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.35a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.35a.oxps deleted file mode 100644 index c35fb749..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.35a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36a.oxps deleted file mode 100644 index d9176b43..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36b.oxps deleted file mode 100644 index ca568053..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.36b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41a.oxps deleted file mode 100644 index 092826a0..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41b.oxps deleted file mode 100644 index 1c48a335..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.41b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42a.oxps deleted file mode 100644 index b57510e9..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42b.oxps deleted file mode 100644 index 7877aadf..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.42b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43a.oxps deleted file mode 100644 index 91f3c64a..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43b.oxps deleted file mode 100644 index 661578e4..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.43b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.44a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.44a.oxps deleted file mode 100644 index a5a26d00..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.44a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.48a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.48a.oxps deleted file mode 100644 index 15313e86..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.48a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49a.oxps deleted file mode 100644 index 7e238cda..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49b.oxps deleted file mode 100644 index 3a1c4ae3..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.49b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.50a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.50a.oxps deleted file mode 100644 index 31045006..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.50a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.52a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.52a.oxps deleted file mode 100644 index d2c0d68f..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.52a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.55a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.55a.oxps deleted file mode 100644 index d9a21ca3..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.55a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.56a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.56a.oxps deleted file mode 100644 index 9c82a8c6..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/MarkupCompatibility/M2.56a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M1.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M1.2a.oxps deleted file mode 100644 index 12c0d526..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M1.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.23a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.23a.oxps deleted file mode 100644 index e4183e92..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.23a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6a.oxps deleted file mode 100644 index 18955f95..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6b.oxps deleted file mode 100644 index e2d0085f..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M10.6b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.2a.oxps deleted file mode 100644 index b080ba72..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3a.oxps deleted file mode 100644 index 0a83e2d0..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3b.oxps deleted file mode 100644 index 6c0bda7a..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.3b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5a.oxps deleted file mode 100644 index cc2330fa..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5b.oxps deleted file mode 100644 index b02d1522..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5c.oxps deleted file mode 100644 index dd8abe81..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.5c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.7a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.7a.oxps deleted file mode 100644 index f65645da..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M12.7a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10a.oxps deleted file mode 100644 index 4db2144d..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10b.oxps deleted file mode 100644 index ccbf170e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.10b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13a.oxps deleted file mode 100644 index 356a7c0a..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13b.oxps deleted file mode 100644 index 81819935..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.13b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14a.oxps deleted file mode 100644 index 8b629d76..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14b.oxps deleted file mode 100644 index 2e23e20b..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.14b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.17a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.17a.oxps deleted file mode 100644 index 9aa2db0b..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.17a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.18a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.18a.oxps deleted file mode 100644 index 6c4dc4da..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.18a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.25a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.25a.oxps deleted file mode 100644 index d3764cb1..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.25a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2a.oxps deleted file mode 100644 index 2e587765..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2b.oxps deleted file mode 100644 index a766c766..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2c.oxps deleted file mode 100644 index f94c3782..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.2c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.35a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.35a.oxps deleted file mode 100644 index 5cac28ee..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.35a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.36a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.36a.oxps deleted file mode 100644 index 615bcd03..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.36a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.37a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.37a.oxps deleted file mode 100644 index 26d9cc97..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.37a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39a.oxps deleted file mode 100644 index 4856a8f4..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39b.oxps deleted file mode 100644 index 976a3ffb..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39c.oxps deleted file mode 100644 index 163a06a0..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.39c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3a.oxps deleted file mode 100644 index fe72bc82..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3b.oxps deleted file mode 100644 index bd84ede6..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3c.oxps deleted file mode 100644 index 48f5513e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.3c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4a.oxps deleted file mode 100644 index 635ba653..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4b.oxps deleted file mode 100644 index 53f585b7..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.4b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.54a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.54a.oxps deleted file mode 100644 index 02e067b0..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.54a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59a.oxps deleted file mode 100644 index 749fc46c..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59b.oxps deleted file mode 100644 index 1732ba01..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59c.oxps deleted file mode 100644 index d4530964..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.59c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5a.oxps deleted file mode 100644 index eab5315b..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5b.oxps deleted file mode 100644 index 003785dc..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.5b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6a.oxps deleted file mode 100644 index 7d49183d..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6b.oxps deleted file mode 100644 index 344a2a4c..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6c.oxps deleted file mode 100644 index 8e6a3fee..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.6c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.70a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.70a.oxps deleted file mode 100644 index dd8207dd..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.70a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71a.oxps deleted file mode 100644 index a4768f4e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71b.oxps deleted file mode 100644 index 3875027e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71c.oxps deleted file mode 100644 index 6f0cb60b..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.71c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72a.oxps deleted file mode 100644 index 034178df..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72b.oxps deleted file mode 100644 index 24fa8200..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72c.oxps deleted file mode 100644 index cf695786..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.72c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73a.oxps deleted file mode 100644 index a19a1d76..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73b.oxps deleted file mode 100644 index c4c02c89..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.73b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74a.oxps deleted file mode 100644 index 34754853..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74b.oxps deleted file mode 100644 index 7ec5e802..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74c.oxps deleted file mode 100644 index 70df17e7..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.74c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75a.oxps deleted file mode 100644 index 3d6c80c6..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75b.oxps deleted file mode 100644 index f9453775..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75c.oxps deleted file mode 100644 index a6af0c05..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75d.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75d.oxps deleted file mode 100644 index 860d6ef7..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.75d.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.76a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.76a.oxps deleted file mode 100644 index 04009798..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.76a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77a.oxps deleted file mode 100644 index b09370b0..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77b.oxps deleted file mode 100644 index d4c716aa..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.77b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7a.oxps deleted file mode 100644 index 43ae8dd4..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7b.oxps deleted file mode 100644 index cd438ae8..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7c.oxps deleted file mode 100644 index 5769291e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.7c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.80.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.80.oxps deleted file mode 100644 index 54be15f5..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.80.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.81.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.81.oxps deleted file mode 100644 index 3ee96f65..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.81.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.82.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.82.oxps deleted file mode 100644 index c4f7bc34..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.82.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8a.oxps deleted file mode 100644 index 6d7ac332..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8b.oxps deleted file mode 100644 index c89d5178..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8c.oxps deleted file mode 100644 index 9189599c..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M2.8c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11a.oxps deleted file mode 100644 index 6a245834..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11b.oxps deleted file mode 100644 index 67b452f2..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.11b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12a.oxps deleted file mode 100644 index 51dd9a58..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12b.oxps deleted file mode 100644 index 1436e752..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.12b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.13a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.13a.oxps deleted file mode 100644 index 86d736fd..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.13a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.14a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.14a.oxps deleted file mode 100644 index 61153510..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.14a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20a.oxps deleted file mode 100644 index 54991b08..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20b.oxps deleted file mode 100644 index 48170f5d..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.20b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2a.oxps deleted file mode 100644 index 4249ffcf..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2b.oxps deleted file mode 100644 index 3fb18d33..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.2b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.3a.oxps deleted file mode 100644 index 65627a53..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5a.oxps deleted file mode 100644 index d692b79e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5b.oxps deleted file mode 100644 index 9c778641..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.5b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6a.oxps deleted file mode 100644 index 19bf2016..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6b.oxps deleted file mode 100644 index 072980cc..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M3.6b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1a.oxps deleted file mode 100644 index 27b1345f..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1b.oxps deleted file mode 100644 index a8ba179c..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1c.oxps deleted file mode 100644 index e0e0dfdd..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.1c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2a.oxps deleted file mode 100644 index f7e297c5..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2b.oxps deleted file mode 100644 index ec497e43..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.2b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.3a.oxps deleted file mode 100644 index fe050dcc..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M4.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.15a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.15a.oxps deleted file mode 100644 index 75944cfa..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.15a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2a.oxps deleted file mode 100644 index 3b83175d..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2b.oxps deleted file mode 100644 index 95a4fdfd..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2c.oxps deleted file mode 100644 index 3b334728..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.2c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3a.oxps deleted file mode 100644 index 9cd37caa..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3b.oxps deleted file mode 100644 index fac36836..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3c.oxps deleted file mode 100644 index 47b8e96f..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.3c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4a.oxps deleted file mode 100644 index 56874b52..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4b.oxps deleted file mode 100644 index d02e3e5b..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.4b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.7a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.7a.oxps deleted file mode 100644 index 67ea2d89..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M5.7a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1a.oxps deleted file mode 100644 index 10082c32..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1b.oxps deleted file mode 100644 index a495ea08..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.1b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2a.oxps deleted file mode 100644 index 47cb778b..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2b.oxps deleted file mode 100644 index d3f3abc8..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.2b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3a.oxps deleted file mode 100644 index f4366daa..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3b.oxps deleted file mode 100644 index 42c68be9..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.3b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4a.oxps deleted file mode 100644 index ca2a1fd8..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4b.oxps deleted file mode 100644 index a5011cc2..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.4b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5a.oxps deleted file mode 100644 index 31c389e5..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5b.oxps deleted file mode 100644 index 2153d0c1..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.5b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6a.oxps deleted file mode 100644 index 8879e4c7..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6b.oxps deleted file mode 100644 index c5c2f609..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M6.6b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11a.oxps deleted file mode 100644 index 73a45e80..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11b.oxps deleted file mode 100644 index b86db281..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.11b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2a.oxps deleted file mode 100644 index e82f6990..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2b.oxps deleted file mode 100644 index 69ba04cf..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.2b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.3a.oxps deleted file mode 100644 index c6d8e028..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.5a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.5a.oxps deleted file mode 100644 index 14bed3c0..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.5a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.6a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.6a.oxps deleted file mode 100644 index 1e6f679e..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M7.6a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M8.14a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M8.14a.oxps deleted file mode 100644 index 6bd6cba4..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M8.14a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10a.oxps deleted file mode 100644 index b933f9bb..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10b.oxps deleted file mode 100644 index 0691b803..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OXPS/M9.10b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10a.oxps deleted file mode 100644 index 86bb6c6d..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10b.oxps deleted file mode 100644 index 3e2820be..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.10b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.11a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.11a.oxps deleted file mode 100644 index f2a269d9..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.11a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.12a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.12a.oxps deleted file mode 100644 index f0f51a6a..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.12a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13a.oxps deleted file mode 100644 index 29fd37e8..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13b.oxps deleted file mode 100644 index 4a1aa928..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.13b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14a.oxps deleted file mode 100644 index a5b1c2fd..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14b.oxps deleted file mode 100644 index bda7b613..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14c.oxps deleted file mode 100644 index b16535f1..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.14c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.15a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.15a.oxps deleted file mode 100644 index e62a2c04..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.15a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17a.oxps deleted file mode 100644 index b46a75a8..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17b.oxps deleted file mode 100644 index abc66d3a..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.17b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18a.oxps deleted file mode 100644 index 8c4db483..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18b.oxps deleted file mode 100644 index 61f134ad..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.18b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.1a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.1a.oxps deleted file mode 100644 index 9fb579e9..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.1a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20a.oxps deleted file mode 100644 index dbf7e7b5..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20b.oxps deleted file mode 100644 index 5618a606..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.20b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21a.oxps deleted file mode 100644 index 7161dda4..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21b.oxps deleted file mode 100644 index 600251fa..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.21b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.22a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.22a.oxps deleted file mode 100644 index f115a574..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.22a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.25a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.25a.oxps deleted file mode 100644 index 92acd6dc..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.25a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26a.oxps deleted file mode 100644 index a1105597..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26b.oxps deleted file mode 100644 index 7f97b408..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.26b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27a.oxps deleted file mode 100644 index 66210956..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27b.oxps deleted file mode 100644 index 38d0a4c3..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.27b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28a.oxps deleted file mode 100644 index c4cd0cff..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28b.oxps deleted file mode 100644 index 0b31ee13..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.28b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2a.oxps deleted file mode 100644 index c28b2d74..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2b.oxps deleted file mode 100644 index a41da49d..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2c.oxps deleted file mode 100644 index e57161b6..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.2c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30a.oxps deleted file mode 100644 index 389055ab..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30b.oxps deleted file mode 100644 index 34a11721..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.30b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.3a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.3a.oxps deleted file mode 100644 index 43458263..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.3a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.5a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.5a.oxps deleted file mode 100644 index 527dacf3..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.5a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6a.oxps deleted file mode 100644 index 3380472a..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6b.oxps deleted file mode 100644 index 53b246e8..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6c.oxps deleted file mode 100644 index 1b412c9f..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6d.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6d.oxps deleted file mode 100644 index c0656f7a..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.6d.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7a.oxps deleted file mode 100644 index c7312c0c..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7b.oxps deleted file mode 100644 index f30e067c..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.7b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8a.oxps deleted file mode 100644 index edfee4f6..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8b.oxps deleted file mode 100644 index 56be3417..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8c.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8c.oxps deleted file mode 100644 index 447aa316..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.8c.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.9a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.9a.oxps deleted file mode 100644 index 39a2bab7..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M1.9a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.10a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.10a.oxps deleted file mode 100644 index d59d1efb..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.10a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.18a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.18a.oxps deleted file mode 100644 index b913fb02..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.18a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.4a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.4a.oxps deleted file mode 100644 index 2ff018f6..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.4a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5a.oxps deleted file mode 100644 index d3377da4..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5b.oxps deleted file mode 100644 index c720fb68..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.5b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6a.oxps deleted file mode 100644 index d91da44f..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6b.oxps deleted file mode 100644 index b6e8e3a2..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.6b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7a.oxps deleted file mode 100644 index 2cb5018c..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7b.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7b.oxps deleted file mode 100644 index 6f4ee6d0..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M2.7b.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.10a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.10a.oxps deleted file mode 100644 index 1cbac9f4..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.10a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.14a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.14a.oxps deleted file mode 100644 index a2579585..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.14a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.9a.oxps b/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.9a.oxps deleted file mode 100644 index 6b5fef0b..00000000 Binary files a/print/SampleOpenXPS/ConformanceViolations_oxps/OpenPackagingConventions/M3.9a.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/OpenXPSTestFiles_EndUserLicenseAgreement.txt b/print/SampleOpenXPS/OpenXPSTestFiles_EndUserLicenseAgreement.txt deleted file mode 100644 index bb9b187b..00000000 --- a/print/SampleOpenXPS/OpenXPSTestFiles_EndUserLicenseAgreement.txt +++ /dev/null @@ -1,7 +0,0 @@ -END-USER LICENSE AGREEMENT -IMPORTANT—READ CAREFULLY: This Microsoft End-User License Agreement (“EULA”) is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation (“Microsoft”) for Test Files owned by Microsoft and identified below. By installing, copying, or otherwise using the Test Files, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, you may not install or use the Test Files. - -Microsoft owns a library of sample Open XML Paper Specification (“OpenXPS”) files, which Microsoft created for testing features of the OpenXPS format (the “Test Files”). The Test Files are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. This is a license, not a sale, of the Test Files. -1. GRANT OF LICENSE. Microsoft grants to you as an individual, a personal, nonexclusive, and limited license to make and use copies of the Test Files on any number of computers residing on your premises for the sole purpose of developing and testing your software and/or hardware products. These license rights are conditioned on your compliance with the license restrictions and requirements described below. -2. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. -3. DISCLAIMER OF WARRANTIES. To the maximum extent permitted by applicable law, Microsoft provides the Test Files AS IS AND WITH ALL FAULTS, and hereby disclaim all warranties and conditions, either express, implied or statutory, including, but not limited to, any (if any) implied warranties or conditions of merchantability, of fitness for a particular purpose, of lack of viruses, of accuracy or completeness of responses, of results, and of lack of negligence or lack of workmanlike effort, all with regard to the Test Files. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT, WITH REGARD TO THE TEST FILES. THE ENTIRE RISK AS TO THE QUALITY OF OR ARISING OUT OF USE OR PERFORMANCE OF THE SAMPLE CODE, IF ANY, REMAINS WITH YOU. diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb01.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb01.oxps deleted file mode 100644 index 3e80f38a..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb01.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb02.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb02.oxps deleted file mode 100644 index ff9cfa89..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb02.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb03.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb03.oxps deleted file mode 100644 index b92f8aa0..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb03.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb04.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb04.oxps deleted file mode 100644 index 4db94294..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb04.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb05.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb05.oxps deleted file mode 100644 index a3352a3c..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb05.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb06.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb06.oxps deleted file mode 100644 index 99e89c53..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb06.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb07.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb07.oxps deleted file mode 100644 index 2fa2eb7e..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb07.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb08.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb08.oxps deleted file mode 100644 index f40d61cc..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb08.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb09.oxps b/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb09.oxps deleted file mode 100644 index eca31524..00000000 Binary files a/print/SampleOpenXPS/QualityLogicMinBar_oxps/mb09.oxps and /dev/null differ diff --git a/print/SampleOpenXPS/README.md b/print/SampleOpenXPS/README.md deleted file mode 100644 index 98269683..00000000 --- a/print/SampleOpenXPS/README.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -page_type: sample -description: "Contains a set of documents that exercise a variety of features of OpenXPS." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# OpenXPS Documents Print Sample - -This sample contains a set of documents that were generated from a variety of sources, including those generated from the Windows Presentation Foundation in the .NET Framework, from Office 2007, and from the Microsoft XPS Document Writer (MXDW). A few of the documents were either hand-built from scratch or hand-modified from another source. They have been included to provide you with a few documents that exercise a variety of features of the XML Paper Specification. - -In addition, a few high-quality documents have been provided in the Showcase directory to highlight some of the XPS advantages in terms of screen-to-print fidelity. We've also created some documents that are intended to fail, by violating at least one conformance rule. These are in the ConformanceViolations directory. For information about OpenXPS in Windows, see [Improvements in XPSDrv](https://docs.microsoft.com/windows-hardware/drivers/print/improvements-in-xpsdrv) and [Driver Support for OpenXPS](https://docs.microsoft.com/windows-hardware/drivers/print/driver-support-for-openxps). diff --git a/print/SampleOpenXPS/SampleOpenXPS.sln b/print/SampleOpenXPS/SampleOpenXPS.sln deleted file mode 100644 index d532a21b..00000000 --- a/print/SampleOpenXPS/SampleOpenXPS.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 12.0 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BlankProject", "BlankProjSrc\BlankProject.vcxproj", "{3B7F3284-4571-493B-87DF-0DCEB924EDED}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Debug|ARM64.Build.0 = Debug|ARM64 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Debug|Win32.ActiveCfg = Debug|Win32 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Debug|Win32.Build.0 = Debug|Win32 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Debug|x64.ActiveCfg = Debug|x64 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Debug|x64.Build.0 = Debug|x64 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Release|ARM64.ActiveCfg = Release|ARM64 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Release|ARM64.Build.0 = Release|ARM64 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Release|Win32.ActiveCfg = Release|Win32 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Release|Win32.Build.0 = Release|Win32 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Release|x64.ActiveCfg = Release|x64 - {3B7F3284-4571-493B-87DF-0DCEB924EDED}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/print/SampleXPS/BlankProjSrc/BlankProject.vcxproj b/print/SampleXPS/BlankProjSrc/BlankProject.vcxproj deleted file mode 100644 index 35a097ad..00000000 --- a/print/SampleXPS/BlankProjSrc/BlankProject.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {58038762-96ED-45A6-A3FF-C5898C7D1618} - $(MSBuildProjectName) - false - Debug - Win32 - {D934F796-350B-4012-9110-5FC97B7D9854} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - BlankProject - - - BlankProject - - - BlankProject - - - BlankProject - - - BlankProject - - - BlankProject - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - true - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/SampleXPS/BlankProjSrc/BlankProject.vcxproj.Filters b/print/SampleXPS/BlankProjSrc/BlankProject.vcxproj.Filters deleted file mode 100644 index 5a2cdec7..00000000 --- a/print/SampleXPS/BlankProjSrc/BlankProject.vcxproj.Filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {37D24E25-CD7F-41C0-AEB7-8778E808B081} - - - h;hpp;hxx;hm;inl;inc;xsd - {0BA751BA-90F8-4A21-BD3C-7FAB627E3EB1} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {383DE7BA-4B35-47EF-BE41-4FAFAF442060} - - - \ No newline at end of file diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.1a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.1a.xps deleted file mode 100644 index c32c6403..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.1a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.2a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.2a.xps deleted file mode 100644 index 48bd6490..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M1.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.13a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.13a.xps deleted file mode 100644 index f5f1ac2f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.13a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.14a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.14a.xps deleted file mode 100644 index 538f9e59..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.14a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.17a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.17a.xps deleted file mode 100644 index 023790ec..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.17a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.20a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.20a.xps deleted file mode 100644 index dd55104c..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.20a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.24a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.24a.xps deleted file mode 100644 index 0ba82cb8..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.24a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27a.xps deleted file mode 100644 index 3bc52c0c..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27b.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27b.xps deleted file mode 100644 index 87fa16b3..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.27b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.30a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.30a.xps deleted file mode 100644 index 2828247f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.30a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.31a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.31a.xps deleted file mode 100644 index f046b027..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.31a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.32a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.32a.xps deleted file mode 100644 index fd60c9c3..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.32a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.33a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.33a.xps deleted file mode 100644 index 76ecf75e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.33a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35a.xps deleted file mode 100644 index 8c8483dc..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35b.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35b.xps deleted file mode 100644 index 5d98e244..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.35b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.36a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.36a.xps deleted file mode 100644 index 6f77126d..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.36a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.41a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.41a.xps deleted file mode 100644 index 34ee4f7d..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.41a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.42a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.42a.xps deleted file mode 100644 index 3cb183e0..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.42a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.43a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.43a.xps deleted file mode 100644 index 69ecfb7a..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.43a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.44a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.44a.xps deleted file mode 100644 index d0875741..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.44a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.48a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.48a.xps deleted file mode 100644 index d0478fe8..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.48a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.49a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.49a.xps deleted file mode 100644 index 11a06bb0..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.49a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.50a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.50a.xps deleted file mode 100644 index 58edc94f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.50a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.52a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.52a.xps deleted file mode 100644 index 91ae6a0f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.52a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.55a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.55a.xps deleted file mode 100644 index b89e6f3e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.55a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.56a.xps b/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.56a.xps deleted file mode 100644 index 96723169..00000000 Binary files a/print/SampleXPS/ConformanceViolations/MarkupCompatibility/M2.56a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.10a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.10a.xps deleted file mode 100644 index 413b8ce8..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.10a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.11a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.11a.xps deleted file mode 100644 index aa8f754c..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.11a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.17a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.17a.xps deleted file mode 100644 index ae7640fb..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.17a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18a.xps deleted file mode 100644 index 8b682539..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18b.xps deleted file mode 100644 index b1291f17..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.18b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1a.xps deleted file mode 100644 index cf92a350..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1b.xps deleted file mode 100644 index 568f188e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.1b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.20a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.20a.xps deleted file mode 100644 index 84c5263b..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.20a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26a.xps deleted file mode 100644 index 0f2ca598..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26b.xps deleted file mode 100644 index 0bd649d5..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26c.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26c.xps deleted file mode 100644 index 17c7bcc5..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.26c.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.27a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.27a.xps deleted file mode 100644 index bb352cce..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.27a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.28a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.28a.xps deleted file mode 100644 index 606b7913..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.28a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2a.xps deleted file mode 100644 index 44c799ab..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2b.xps deleted file mode 100644 index 1a27e88a..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.2b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.34a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.34a.xps deleted file mode 100644 index b054bbe9..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.34a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.3a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.3a.xps deleted file mode 100644 index 597de9ed..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.3a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.5a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.5a.xps deleted file mode 100644 index 30da6c1f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.5a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6a.xps deleted file mode 100644 index 1dcebd8a..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6b.xps deleted file mode 100644 index b52b7acc..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.6b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7a.xps deleted file mode 100644 index f6746cd0..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7c.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7c.xps deleted file mode 100644 index 6bd60336..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.7c.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.8a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.8a.xps deleted file mode 100644 index e3f75acf..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M1.8a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.18a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.18a.xps deleted file mode 100644 index 6670b2f0..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.18a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.24a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.24a.xps deleted file mode 100644 index 4198d1f8..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.24a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5a.xps deleted file mode 100644 index 32d09c18..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5b.xps deleted file mode 100644 index 53ae6333..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.5b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6a.xps deleted file mode 100644 index e48d3250..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6b.xps deleted file mode 100644 index 50e0193f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.6b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7a.xps deleted file mode 100644 index 5ceb15a3..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7b.xps deleted file mode 100644 index f8278ecb..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M2.7b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10a.xps deleted file mode 100644 index 477c0183..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10b.xps deleted file mode 100644 index 31ac45f5..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10c.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10c.xps deleted file mode 100644 index b4eecdfd..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.10c.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11a.xps deleted file mode 100644 index 995040b6..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11b.xps deleted file mode 100644 index 64a8af21..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.11b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12a.xps deleted file mode 100644 index 498fe5cd..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12b.xps deleted file mode 100644 index ebca085e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.12b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.13a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.13a.xps deleted file mode 100644 index 5ec3479f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.13a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.14a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.14a.xps deleted file mode 100644 index ab717318..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.14a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.15a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.15a.xps deleted file mode 100644 index 35dea693..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.15a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.16a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.16a.xps deleted file mode 100644 index 4d8ac00d..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.16a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17a.xps deleted file mode 100644 index 7cbf5580..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17b.xps deleted file mode 100644 index 97876410..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.17b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.18a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.18a.xps deleted file mode 100644 index f81fe6f2..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.18a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1a.xps deleted file mode 100644 index a425eff9..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1b.xps deleted file mode 100644 index 052c570b..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.1b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.20a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.20a.xps deleted file mode 100644 index 5ec3479f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.20a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21a.xps deleted file mode 100644 index 7bb049e6..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21b.xps deleted file mode 100644 index c1d6f3b4..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.21b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.25a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.25a.xps deleted file mode 100644 index 08c33e3d..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.25a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.26a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.26a.xps deleted file mode 100644 index 8a05d7b7..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.26a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.28a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.28a.xps deleted file mode 100644 index 18ccf0d9..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.28a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.29a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.29a.xps deleted file mode 100644 index 9f4dede8..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.29a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.2a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.2a.xps deleted file mode 100644 index 43d3896e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31a.xps deleted file mode 100644 index 63134db2..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31b.xps deleted file mode 100644 index d4b716da..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.31b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32a.xps deleted file mode 100644 index d1adc199..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32b.xps deleted file mode 100644 index 5bbf1e0e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.32b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4a.xps deleted file mode 100644 index ec57c709..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4b.xps deleted file mode 100644 index 6eb0d1ce..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.4b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.5a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.5a.xps deleted file mode 100644 index 6593e647..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.5a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.6a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.6a.xps deleted file mode 100644 index ed36762e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.6a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.7a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.7a.xps deleted file mode 100644 index c7af760c..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.7a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.8a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.8a.xps deleted file mode 100644 index 342b5ced..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.8a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9a.xps deleted file mode 100644 index ef42bb32..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9b.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9b.xps deleted file mode 100644 index 6dbd62c6..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9c.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9c.xps deleted file mode 100644 index d791407a..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M3.9c.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.1a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.1a.xps deleted file mode 100644 index abac7f24..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.1a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.2a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.2a.xps deleted file mode 100644 index e3f75acf..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.3a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.3a.xps deleted file mode 100644 index 60e7330f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M4.3a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.1a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.1a.xps deleted file mode 100644 index 05e660a0..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.1a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.2a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.2a.xps deleted file mode 100644 index 544d2978..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.4a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.4a.xps deleted file mode 100644 index 942f4003..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.4a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.6a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.6a.xps deleted file mode 100644 index 42cf8e0e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.6a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.7a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.7a.xps deleted file mode 100644 index e71811e5..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.7a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.8a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.8a.xps deleted file mode 100644 index 07219ea1..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M6.8a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M7.2a.xps b/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M7.2a.xps deleted file mode 100644 index 7d0b1036..00000000 Binary files a/print/SampleXPS/ConformanceViolations/OpenPackagingConventions/M7.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M1.2a.xps b/print/SampleXPS/ConformanceViolations/XPS/M1.2a.xps deleted file mode 100644 index aa0aab99..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M1.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M12.2a.xps b/print/SampleXPS/ConformanceViolations/XPS/M12.2a.xps deleted file mode 100644 index 37b7f4a9..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M12.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M12.3b.xps b/print/SampleXPS/ConformanceViolations/XPS/M12.3b.xps deleted file mode 100644 index dd3cd57e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M12.3b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M12.5a.xps b/print/SampleXPS/ConformanceViolations/XPS/M12.5a.xps deleted file mode 100644 index a559be55..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M12.5a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M12.7a.xps b/print/SampleXPS/ConformanceViolations/XPS/M12.7a.xps deleted file mode 100644 index af87d904..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M12.7a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.10a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.10a.xps deleted file mode 100644 index 5a589bb1..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.10a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.13a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.13a.xps deleted file mode 100644 index 08dd879f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.13a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.13b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.13b.xps deleted file mode 100644 index cb9c951e..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.13b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.14a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.14a.xps deleted file mode 100644 index 5b2d29ef..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.14a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.18a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.18a.xps deleted file mode 100644 index 918a5b84..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.18a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.25a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.25a.xps deleted file mode 100644 index 64cb6df8..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.25a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.36a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.36a.xps deleted file mode 100644 index cc56b711..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.36a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.37a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.37a.xps deleted file mode 100644 index 6832246f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.37a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.3a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.3a.xps deleted file mode 100644 index 36faa225..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.3a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.3b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.3b.xps deleted file mode 100644 index a04712b7..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.3b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.3c.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.3c.xps deleted file mode 100644 index 61417822..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.3c.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.4a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.4a.xps deleted file mode 100644 index a2b7b46b..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.4a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.4b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.4b.xps deleted file mode 100644 index 6ba3ba3d..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.4b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.59a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.59a.xps deleted file mode 100644 index 4ed69dc3..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.59a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.5a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.5a.xps deleted file mode 100644 index 284cdf99..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.5a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.5b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.5b.xps deleted file mode 100644 index c2779265..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.5b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.6a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.6a.xps deleted file mode 100644 index 2b311786..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.6a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.6b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.6b.xps deleted file mode 100644 index a7af6881..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.6b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.71a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.71a.xps deleted file mode 100644 index d2fd6911..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.71a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.71b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.71b.xps deleted file mode 100644 index 8e129faf..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.71b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.71c.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.71c.xps deleted file mode 100644 index 6fcf2746..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.71c.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.73a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.73a.xps deleted file mode 100644 index 3724f3f2..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.73a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.73b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.73b.xps deleted file mode 100644 index cb492cde..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.73b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.74a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.74a.xps deleted file mode 100644 index 754a1dac..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.74a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.75a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.75a.xps deleted file mode 100644 index e60d1999..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.75a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.75b.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.75b.xps deleted file mode 100644 index afb8579f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.75b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M2.76a.xps b/print/SampleXPS/ConformanceViolations/XPS/M2.76a.xps deleted file mode 100644 index 70dcad6a..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M2.76a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M3.2a.xps b/print/SampleXPS/ConformanceViolations/XPS/M3.2a.xps deleted file mode 100644 index 974c52c8..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M3.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M3.3a.xps b/print/SampleXPS/ConformanceViolations/XPS/M3.3a.xps deleted file mode 100644 index 2d5f0f4c..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M3.3a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M3.5a.xps b/print/SampleXPS/ConformanceViolations/XPS/M3.5a.xps deleted file mode 100644 index 7471ee04..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M3.5a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M3.6a.xps b/print/SampleXPS/ConformanceViolations/XPS/M3.6a.xps deleted file mode 100644 index 0a2ec5ec..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M3.6a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M3.6b.xps b/print/SampleXPS/ConformanceViolations/XPS/M3.6b.xps deleted file mode 100644 index 3c353b55..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M3.6b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M4.3a.xps b/print/SampleXPS/ConformanceViolations/XPS/M4.3a.xps deleted file mode 100644 index dbceda8b..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M4.3a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M5.15a.xps b/print/SampleXPS/ConformanceViolations/XPS/M5.15a.xps deleted file mode 100644 index 1cea3661..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M5.15a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M5.2a.xps b/print/SampleXPS/ConformanceViolations/XPS/M5.2a.xps deleted file mode 100644 index abf74ae2..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M5.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M5.2b.xps b/print/SampleXPS/ConformanceViolations/XPS/M5.2b.xps deleted file mode 100644 index b3f2559d..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M5.2b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M5.4a.xps b/print/SampleXPS/ConformanceViolations/XPS/M5.4a.xps deleted file mode 100644 index 44f206c0..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M5.4a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M5.4b.xps b/print/SampleXPS/ConformanceViolations/XPS/M5.4b.xps deleted file mode 100644 index 77596f04..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M5.4b.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M5.7a.xps b/print/SampleXPS/ConformanceViolations/XPS/M5.7a.xps deleted file mode 100644 index 72860767..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M5.7a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M6.2a.xps b/print/SampleXPS/ConformanceViolations/XPS/M6.2a.xps deleted file mode 100644 index 7c64d19f..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M6.2a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M6.3a.xps b/print/SampleXPS/ConformanceViolations/XPS/M6.3a.xps deleted file mode 100644 index b62a394a..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M6.3a.xps and /dev/null differ diff --git a/print/SampleXPS/ConformanceViolations/XPS/M7.5a.xps b/print/SampleXPS/ConformanceViolations/XPS/M7.5a.xps deleted file mode 100644 index 93b14d89..00000000 Binary files a/print/SampleXPS/ConformanceViolations/XPS/M7.5a.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb01.xps b/print/SampleXPS/QualityLogicMinBar/mb01.xps deleted file mode 100644 index 138c8594..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb01.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb02.xps b/print/SampleXPS/QualityLogicMinBar/mb02.xps deleted file mode 100644 index ed09e1ef..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb02.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb03.xps b/print/SampleXPS/QualityLogicMinBar/mb03.xps deleted file mode 100644 index 2739c036..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb03.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb04.xps b/print/SampleXPS/QualityLogicMinBar/mb04.xps deleted file mode 100644 index 0287b040..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb04.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb05.xps b/print/SampleXPS/QualityLogicMinBar/mb05.xps deleted file mode 100644 index 225eed4e..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb05.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb06.xps b/print/SampleXPS/QualityLogicMinBar/mb06.xps deleted file mode 100644 index 39b38a71..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb06.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb07.xps b/print/SampleXPS/QualityLogicMinBar/mb07.xps deleted file mode 100644 index c844d85f..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb07.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb08.xps b/print/SampleXPS/QualityLogicMinBar/mb08.xps deleted file mode 100644 index 2b2146f1..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb08.xps and /dev/null differ diff --git a/print/SampleXPS/QualityLogicMinBar/mb09.xps b/print/SampleXPS/QualityLogicMinBar/mb09.xps deleted file mode 100644 index 12470ceb..00000000 Binary files a/print/SampleXPS/QualityLogicMinBar/mb09.xps and /dev/null differ diff --git a/print/SampleXPS/README.md b/print/SampleXPS/README.md deleted file mode 100644 index 795694d2..00000000 --- a/print/SampleXPS/README.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -page_type: sample -description: "Contains a set of documents that exercise a variety of features of the XML Paper Specification." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# XPS Documents Print Sample - -This sample is a set of documents that were generated from a variety of sources, including those generated from the Windows Presentation Foundation in the .NET Framework, from Office 2007, and from the Microsoft XPS Document Writer (MXDW). The set of documents also includes documents that were either hand-built from scratch or hand-modified from another source. They have been included to provide you with a few documents that exercise a variety of features of the XML Paper Specification. - -In addition, a few high-quality documents have been provided in the Showcase directory to highlight some of the XPS advantages in terms of screen-to-print fidelity. There are also some documents that are intended to fail by violating at least one conformance rule. These are in the ConformanceViolations directory. For information about XPS in Windows, see [XPS Printing Features](https://docs.microsoft.com/windows-hardware/drivers/print/xps-printing-features). diff --git a/print/SampleXPS/SampleXPS.sln b/print/SampleXPS/SampleXPS.sln deleted file mode 100644 index 52802ac5..00000000 --- a/print/SampleXPS/SampleXPS.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 12.0 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BlankProject", "BlankProjSrc\BlankProject.vcxproj", "{58038762-96ED-45A6-A3FF-C5898C7D1618}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Debug|ARM64.Build.0 = Debug|ARM64 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Debug|Win32.ActiveCfg = Debug|Win32 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Debug|Win32.Build.0 = Debug|Win32 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Debug|x64.ActiveCfg = Debug|x64 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Debug|x64.Build.0 = Debug|x64 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Release|ARM64.ActiveCfg = Release|ARM64 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Release|ARM64.Build.0 = Release|ARM64 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Release|Win32.ActiveCfg = Release|Win32 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Release|Win32.Build.0 = Release|Win32 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Release|x64.ActiveCfg = Release|x64 - {58038762-96ED-45A6-A3FF-C5898C7D1618}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/print/SampleXPS/XPSTestFiles_EndUserLicenseAgreement.txt b/print/SampleXPS/XPSTestFiles_EndUserLicenseAgreement.txt deleted file mode 100644 index 2e90e5d7..00000000 --- a/print/SampleXPS/XPSTestFiles_EndUserLicenseAgreement.txt +++ /dev/null @@ -1,7 +0,0 @@ -END-USER LICENSE AGREEMENT -IMPORTANT—READ CAREFULLY: This Microsoft End-User License Agreement (“EULA”) is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation (“Microsoft”) for Test Files owned by Microsoft and identified below. By installing, copying, or otherwise using the Test Files, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, you may not install or use the Test Files. - -Microsoft owns a library of sample XML Paper Specification (“XPS”) files, which Microsoft created for testing features of the XPS format (the “Test Files”). The Test Files are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. This is a license, not a sale, of the Test Files. -1. GRANT OF LICENSE. Microsoft grants to you as an individual, a personal, nonexclusive, and limited license to make and use copies of the Test Files on any number of computers residing on your premises for the sole purpose of developing and testing your software and/or hardware products. These license rights are conditioned on your compliance with the license restrictions and requirements described below. -2. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. -3. DISCLAIMER OF WARRANTIES. To the maximum extent permitted by applicable law, Microsoft provides the Test Files AS IS AND WITH ALL FAULTS, and hereby disclaim all warranties and conditions, either express, implied or statutory, including, but not limited to, any (if any) implied warranties or conditions of merchantability, of fitness for a particular purpose, of lack of viruses, of accuracy or completeness of responses, of results, and of lack of negligence or lack of workmanlike effort, all with regard to the Test Files. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT, WITH REGARD TO THE TEST FILES. THE ENTIRE RISK AS TO THE QUALITY OF OR ARISING OUT OF USE OR PERFORMANCE OF THE SAMPLE CODE, IF ANY, REMAINS WITH YOU. diff --git a/print/SimplePipelineFilter/FilterSample.def b/print/SimplePipelineFilter/FilterSample.def deleted file mode 100644 index f6a38ef5..00000000 --- a/print/SimplePipelineFilter/FilterSample.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY "FilterSample.DLL" - -EXPORTS - DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE - - - diff --git a/print/SimplePipelineFilter/FilterSample.rc b/print/SimplePipelineFilter/FilterSample.rc deleted file mode 100644 index caf78af0..00000000 --- a/print/SimplePipelineFilter/FilterSample.rc +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "Print Pipeline WDK Filter Sample" -#define VER_INTERNALNAME_STR "WdkPipelineFilter.dll" -#define VER_ORIGINALFILENAME_STR "WdkPipelineFilter.dll" - -#include "common.ver" diff --git a/print/SimplePipelineFilter/README.md b/print/SimplePipelineFilter/README.md deleted file mode 100644 index b3a1567c..00000000 --- a/print/SimplePipelineFilter/README.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -page_type: sample -description: "This sample shows how to use the print pipeline's filter interfaces." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# Print Pipeline Simple Filter - -The printing system supports a print filter pipeline. The pipeline is run when a print job is consumed by the print spooler and sent to the device. - -This sample shows how to use the print pipeline's filter interfaces. - -The filters in the print pipeline consume a certain data type and produce a certain data type. This information is specified in the pipeline configuration file on a per printer driver basis. - -The WDK print filter sample contains two filter samples: one that consumes and produces XPS data type, and the other one consumes and produces opaque byte stream. For more information, see [XPS Printer Driver (XPSDrv)](https://docs.microsoft.com/windows-hardware/drivers/print/xpsdrv-printer-driver). diff --git a/print/SimplePipelineFilter/SimplePipelineFilter.sln b/print/SimplePipelineFilter/SimplePipelineFilter.sln deleted file mode 100644 index fb7b4926..00000000 --- a/print/SimplePipelineFilter/SimplePipelineFilter.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 12.0 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WdkPipelineFilter", "WdkPipelineFilter.vcxproj", "{80A8ADEB-D954-428E-8809-7308A4F007EF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Debug|ARM64.Build.0 = Debug|ARM64 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Debug|Win32.ActiveCfg = Debug|Win32 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Debug|Win32.Build.0 = Debug|Win32 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Debug|x64.ActiveCfg = Debug|x64 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Debug|x64.Build.0 = Debug|x64 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Release|ARM64.ActiveCfg = Release|ARM64 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Release|ARM64.Build.0 = Release|ARM64 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Release|Win32.ActiveCfg = Release|Win32 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Release|Win32.Build.0 = Release|Win32 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Release|x64.ActiveCfg = Release|x64 - {80A8ADEB-D954-428E-8809-7308A4F007EF}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/print/SimplePipelineFilter/StreamFilter.cxx b/print/SimplePipelineFilter/StreamFilter.cxx deleted file mode 100644 index a03aafe0..00000000 --- a/print/SimplePipelineFilter/StreamFilter.cxx +++ /dev/null @@ -1,263 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// This is the C file for the stream filter sample. -// -//---------------------------------------------------------------------------- - -#include "precomp.hxx" -#include "main.hxx" -#include "StreamFilter.tmh" -#include "StreamFilter.hxx" - -#include "winddiui.h" -#include "compstui.h" -#include "printoem.h" - -#include "initguid.h" -#include "prcomoem.h" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// 5f5460d2-b313-44ca-82e4-37f83d793999 - generate a guid, do not use this one in your code -// -const GUID StreamFilterGuid = {0x5f5460d2, 0xb313, 0x44ca, {0x82, 0xe4, 0x37, 0xf8, 0x3d, 0x79, 0x39, 0x99}}; - -const GUID& -StreamFilter:: -FilterClsid( - void - ) -{ - return StreamFilterGuid; -} - -StreamFilter:: -StreamFilter() : - m_bShutdown(false), - m_cRef(1) -{ -} - -// -// IUnknown methods -// -__override -STDMETHODIMP -StreamFilter:: -QueryInterface( - _In_ REFIID riid, - _Out_ void **ppv - ) -{ - HRESULT hRes = E_POINTER; - - if (ppv) - { - hRes = E_NOINTERFACE; - - *ppv = NULL; - - if (riid == IID_IPrintPipelineFilter) - { - *ppv = static_cast(this); - } - else if (riid == IID_IUnknown) - { - *ppv = static_cast(this); - } - - if (*ppv) - { - AddRef(); - - hRes = S_OK; - } - } - - return hRes; -} - -__override -STDMETHODIMP_(ULONG) -StreamFilter:: -AddRef( - void - ) -{ - return InterlockedIncrement(&m_cRef); -} - -__override -STDMETHODIMP_(ULONG) -StreamFilter:: -Release( - void - ) -{ - ULONG cRefCount = InterlockedDecrement(&m_cRef); - - if (cRefCount) - { - return cRefCount; - } - - delete this; - - return 0; -} - -// -// IPrintPipelineFilter -// -__override -STDMETHODIMP -StreamFilter:: -ShutdownOperation( - void - ) -{ - m_bShutdown = true; - - return S_OK; -} - -__override -STDMETHODIMP -StreamFilter:: -InitializeFilter( - _In_ IInterFilterCommunicator *pIFilterCommunicator, - _In_ IPrintPipelinePropertyBag *pIPropertyBag, - _In_ IPrintPipelineManagerControl *pIPipelineControl - ) -{ - HRESULT hr = S_OK; - VARIANT varHelper; - PCSTR *pFeatures = NULL; - DWORD dwFeatures = 0; - Tools::SmartPtr pHelper; - - VariantInit(&varHelper); - - // - // StreamAccessSequential, IID_IPrintReadStream - // - hr = pIFilterCommunicator->RequestReader(reinterpret_cast(&m_pIRead)); - - if (SUCCEEDED(hr)) - { - // - // StreamAccessSequential, StreamModify, IID_IPrintWriteStream - // - hr = pIFilterCommunicator->RequestWriter(reinterpret_cast(&m_pIWrite)); - } - - if (SUCCEEDED(hr)) - { - m_pIPipelineControl = pIPipelineControl; - } - - // - // This shows how to use the helper interface to read information - // from a UnidrvUI based configuration module. - // - - if (SUCCEEDED(hr)) - { - hr = pIPropertyBag->GetProperty(L"IPrintCoreHelper", &varHelper); - } - - if (SUCCEEDED(hr) && V_UNKNOWN(&varHelper)) - { - hr = (V_UNKNOWN(&varHelper))->QueryInterface(IID_IPrintCoreHelper, (VOID**)(&pHelper)); - } - - // - // No need to release buffers provided by the helper. Their - // lifetime matches that of the helper. - // - if (SUCCEEDED(hr) && pHelper) - { - hr = pHelper->EnumFeatures(&pFeatures, &dwFeatures); - } - - if (SUCCEEDED(hr) && dwFeatures > 0) - { - for (DWORD i = 0; i < dwFeatures; i++) - { - DoTraceMessage(WS_TRACE, L"StreamFilter::InitializeFilter: Feature found: %s", pFeatures[i]); - } - } - - VariantClear(&varHelper); - - return hr; -} - -__override -STDMETHODIMP -StreamFilter:: -StartOperation( - void - ) -{ - HRESULT hr = S_OK; - Tools::SmartPtr pIErrorInfo; - DWORD cbRead; - BYTE *pReadBuf; - BOOL bEof = FALSE; - - pReadBuf = new BYTE[kBufferSize]; - - if (!pReadBuf) - { - hr = E_OUTOFMEMORY; - } - - while (SUCCEEDED(hr) && !bEof && !m_bShutdown) - { - hr = m_pIRead->ReadBytes(pReadBuf, kBufferSize, &cbRead, &bEof); - - if (SUCCEEDED(hr) && cbRead) - { - ULONG cbWritten; - - hr = m_pIWrite->WriteBytes(pReadBuf, cbRead, &cbWritten); - - if (SUCCEEDED(hr)) - { - DoTraceMessage(WS_TRACE, "StreamFilter::StartOperation read and wrote %u bytes", cbRead); - } - } - } - - m_pIWrite->Close(); - - if (FAILED(hr)) - { - m_pIPipelineControl->RequestShutdown(hr, pIErrorInfo); - } - - if (m_pIPipelineControl) - { - m_pIPipelineControl->FilterFinished(); - } - - delete [] pReadBuf; - - return hr; -} - - diff --git a/print/SimplePipelineFilter/StreamFilter.hxx b/print/SimplePipelineFilter/StreamFilter.hxx deleted file mode 100644 index c23f5fb2..00000000 --- a/print/SimplePipelineFilter/StreamFilter.hxx +++ /dev/null @@ -1,99 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// This is the header file for the stream filter sample. -// -//---------------------------------------------------------------------------- - -#ifndef _STREAM_FILTER_SAMPLE_HXX_ -#define _STREAM_FILTER_SAMPLE_HXX_ - -class StreamFilter : - public IPrintPipelineFilter, - private DllLockManager -{ -public: - - StreamFilter(); - - // - // IUnknown methods - // - __override - STDMETHODIMP - QueryInterface( - _In_ REFIID riid, - _Out_ void **ppv - ); - - __override - STDMETHODIMP_(ULONG) - AddRef( - void - ); - - __override - STDMETHODIMP_(ULONG) - Release( - void - ); - - // - // IPrintPipelineFilter - // - __override - STDMETHODIMP - ShutdownOperation( - void - ); - - __override - STDMETHODIMP - InitializeFilter( - _In_ IInterFilterCommunicator *pINegotiation, - _In_ IPrintPipelinePropertyBag *pIPropertyBag, - _In_ IPrintPipelineManagerControl *pIPipelineControl - ); - - __override - STDMETHODIMP - StartOperation( - void - ); - - // - // Other methods - // - static - const GUID& - FilterClsid( - void - ); - -private: - - enum - { - kBufferSize = 0x10000 - }; - - Tools::SmartPtr m_pIRead; - Tools::SmartPtr m_pIWrite; - Tools::SmartPtr m_pIPipelineControl; - Tools::SmartPtr m_pProgressReport; - bool m_bShutdown; - LONG m_cRef; -}; - -#endif // _STREAM_FILTER_SAMPLE_HXX_ diff --git a/print/SimplePipelineFilter/WdkPipelineFilter.vcxproj b/print/SimplePipelineFilter/WdkPipelineFilter.vcxproj deleted file mode 100644 index cfbb05f1..00000000 --- a/print/SimplePipelineFilter/WdkPipelineFilter.vcxproj +++ /dev/null @@ -1,407 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {80A8ADEB-D954-428E-8809-7308A4F007EF} - $(MSBuildProjectName) - Debug - Win32 - {57FB75E7-A506-4E55-82FE-E7EB9DF22861} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - true - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - true - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - true - ;%(AdditionalIncludeDirectories) - precomp.hxx - Use - $(IntDir)\precomp.hxx.pch - - - true - - - - WdkPipelineFilter - - - WdkPipelineFilter - - - WdkPipelineFilter - - - WdkPipelineFilter - - - WdkPipelineFilter - - - WdkPipelineFilter - - - - %(AdditionalDependencies);user32.lib;kernel32.lib;oleaut32.lib;ole32.lib;uuid.lib;advapi32.lib - - - - - %(AdditionalDependencies);user32.lib;kernel32.lib;oleaut32.lib;ole32.lib;uuid.lib;advapi32.lib - - - - - %(AdditionalDependencies);user32.lib;kernel32.lib;oleaut32.lib;ole32.lib;uuid.lib;advapi32.lib - - - - - %(AdditionalDependencies);user32.lib;kernel32.lib;oleaut32.lib;ole32.lib;uuid.lib;advapi32.lib - - - - - %(AdditionalDependencies);user32.lib;kernel32.lib;oleaut32.lib;ole32.lib;uuid.lib;advapi32.lib - - - - - %(AdditionalDependencies);user32.lib;kernel32.lib;oleaut32.lib;ole32.lib;uuid.lib;advapi32.lib - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - - - %(AdditionalOptions) /ignore:4070 - FilterSample.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - FilterSample.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - FilterSample.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - FilterSample.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - FilterSample.def - - - - - - - - - %(AdditionalOptions) /ignore:4070 - FilterSample.def - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.hxx - Create - $(IntDir)\precomp.hxx.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/SimplePipelineFilter/WdkPipelineFilter.vcxproj.Filters b/print/SimplePipelineFilter/WdkPipelineFilter.vcxproj.Filters deleted file mode 100644 index 278a2bc6..00000000 --- a/print/SimplePipelineFilter/WdkPipelineFilter.vcxproj.Filters +++ /dev/null @@ -1,91 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {E2F5222E-16C8-4A9F-810F-C8FDBA80C0AB} - - - h;hpp;hxx;hm;inl;inc;xsd - {E4866573-4690-40FB-9605-867A9A7433FA} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {A0672880-4BAF-4978-99DA-3AB202EF3F3A} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - Header Files - - - - - - - - - - Source Files - - - \ No newline at end of file diff --git a/print/SimplePipelineFilter/XpsFilter.cxx b/print/SimplePipelineFilter/XpsFilter.cxx deleted file mode 100644 index fe4945d0..00000000 --- a/print/SimplePipelineFilter/XpsFilter.cxx +++ /dev/null @@ -1,785 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// This is the C file for the stream filter sample. -// -//---------------------------------------------------------------------------- - -#include "precomp.hxx" -#include "main.hxx" -#include "XpsFilter.tmh" -#include "XpsFilter.hxx" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// 8267d291-6ddd-4972-a94e-3ce88149a1fa - generate a guid, do not use this one in your code -// -const GUID ClsidXpsFilter = {0x8267d291, 0x6ddd, 0x4972, {0xa9, 0x4e, 0x3c, 0xe8, 0x81, 0x49, 0xa1, 0xfa}}; - -const GUID& -XpsFilter:: -FilterClsid( - void - ) -{ - return ClsidXpsFilter; -} - -#define COUNTOF(x) (sizeof(x)/sizeof(*x)) - -HRESULT -GetLastErrorAsHResult( - void - ) -{ - DWORD dwError = GetLastError(); - - return HRESULT_FROM_WIN32(dwError); -} - -HRESULT -ProcessTicket( - _In_ IPartPrintTicket *pIPrintTicket - ) -{ - Tools::SmartBSTR bstr; - - HRESULT hRes = pIPrintTicket->GetUri(&bstr); - - if (SUCCEEDED(hRes)) - { - Tools::SmartPtr pIStream; - - hRes = pIPrintTicket->GetStream(&pIStream); - - if (SUCCEEDED(hRes)) - { - ULONG cbRead = 0; - BOOL bEof = FALSE; - - DoTraceMessage(WS_TRACE, "ProcessTicket print ticket follows."); - - do - { - BYTE buf[200] = {0}; - - // - // Save one byte to ensure null termination - // - if (SUCCEEDED(hRes = pIStream->ReadBytes(buf, COUNTOF(buf) - 1, &cbRead, &bEof)) && cbRead) - { - // - // use PT data - // - DoTraceMessage(WS_TRACE, "%s", reinterpret_cast(buf)); - } - } - while (!bEof && cbRead && SUCCEEDED(hRes)); - } - } - - return hRes; -} - -HRESULT -AddFontToPage( - _In_ IPartFont *pNewFont, - _In_ IPrintWriteStream *pFontStream, - _In_ IFixedPage *pNewPage - ) -{ - WCHAR szFont[MAX_PATH]; - HRESULT hRes = S_OK; - - if (!GetWindowsDirectory(szFont, MAX_PATH)) - { - hRes = GetLastErrorAsHResult(); - } - - if (SUCCEEDED(hRes)) - { - hRes = StringCchCat(szFont, MAX_PATH, L"\\fonts\\verdana.TTF"); - } - - if (SUCCEEDED(hRes)) - { - HANDLE hFile = CreateFile(szFont, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - 0, - NULL); - - if (hFile != INVALID_HANDLE_VALUE) - { - BYTE buf[400]; - ULONG cbBuf = 400; - ULONG cbRead, cbWritten; - - do - { - if (ReadFile(hFile, buf, cbBuf, &cbRead, NULL)) - { - hRes = pFontStream->WriteBytes(buf, cbRead, &cbWritten); - } - else - { - hRes = GetLastErrorAsHResult(); - } - } - while (SUCCEEDED(hRes) && cbRead); - - CloseHandle(hFile); - } - else - { - hRes = GetLastErrorAsHResult(); - } - - pFontStream->Close(); - } - - if (SUCCEEDED(hRes)) - { - hRes = pNewPage->SetPagePart(pNewFont); - } - - return hRes; -} - -HRESULT -AddTextToPage( - _In_ PCWSTR pszReferencedFont, - _In_ IPrintWriteStream *pPageMarkupStream - ) -{ - HRESULT hRes; - ULONG cb; - CHAR buf[500]; - - // - // Mark up for page generated on the fly: "hello world" - // - CHAR sz[] = "" - "" - ""; - - // - // Insert the URI of the font we added to the document - // - hRes = StringCchPrintfA(buf, COUNTOF(buf), sz, pszReferencedFont); - - // - // Write markup for page - // - if (SUCCEEDED(hRes) && - SUCCEEDED(hRes = pPageMarkupStream->WriteBytes(buf, static_cast(strlen(buf)), &cb))) - { - pPageMarkupStream->Close(); - } - - return hRes; -} - -// -// This function reads the page content and writes it back. Can be extended -// to do useful work -// -HRESULT -ModifyContent( - _In_ IPrintReadStream *pRead, - _In_ IPrintWriteStream *pWrite - ) -{ - CHAR buf[100] = {0}; - HRESULT hRes; - ULONG cbr, cbw; - BOOL bEof = FALSE; - - do - { - hRes = pRead->ReadBytes(buf, sizeof(buf), &cbr, &bEof); - - if (SUCCEEDED(hRes) && cbr) - { - // - // do something with buffer - // - cbw = cbr; - - hRes = pWrite->WriteBytes(buf, cbr, &cbw); - } - } - while (!bEof && cbr && SUCCEEDED(hRes)); - - return hRes; -} - -HRESULT -XpsFilter:: -ProcessImagePart( - _In_ IPartImage *pIPartImage - ) -{ - Tools::SmartBSTR bstr; - - HRESULT hRes = pIPartImage->GetUri(&bstr); - - DoTraceMessage(WS_TRACE, "ProcessImagePart uri %ws", static_cast(bstr)); - - if (SUCCEEDED(hRes)) - { - Tools::SmartPtr pRead; - - if (SUCCEEDED(hRes = pIPartImage->GetStream(&pRead))) - { - // - // do something with image - // - } - } - - return hRes; -} - -// -// Non-static members -// -XpsFilter:: -XpsFilter() : - m_bShutdown(false), - m_cRef(1), - m_cIdCount(0) -{ -} - -HRESULT -XpsFilter:: -ProcessFixedPage( - _In_ void *pVoid - ) -{ - Tools::SmartPtr pIFixedPage; - - // - // XpsFilter::ProcessPart already incremented the reference count for the object. This - // function is taking ownership of the object, there is no need for another AddRef call - // (hence the Attach) - // - pIFixedPage.Attach(static_cast(pVoid)); - - HRESULT hRes; - Tools::SmartBSTR bstr; - - if (SUCCEEDED(pIFixedPage->GetUri(&bstr))) - { - DoTraceMessage(WS_TRACE, "ProcessFixedPage uri %ws", static_cast(bstr)); - } - - Tools::SmartPtr pIPrintTicket; - - hRes = pIFixedPage->GetPrintTicket(&pIPrintTicket); - - if (SUCCEEDED(hRes)) - { - hRes = ProcessTicket(pIPrintTicket); - } - else if (hRes == E_ELEMENT_NOT_FOUND) - { - // - // No ticket. Benign. - // - hRes = S_OK; - - DoTraceMessage(WS_WARNING, "ProcessFixedPage uri %ws. Page print ticket not present.", static_cast(bstr)); - } - - pIFixedPage->SetPartCompression(Compression_Small); - - // - // modify content for page, optional - // - Tools::SmartPtr pRead; - Tools::SmartPtr pWrite; - - if (SUCCEEDED(hRes = pIFixedPage->GetStream(&pRead)) && - SUCCEEDED(hRes = pIFixedPage->GetWriteStream(&pWrite))) - { - hRes = ModifyContent(pRead, pWrite); - - pWrite->Close(); - } - - // - // Send page to next filter - // - if (SUCCEEDED(hRes)) - { - hRes = m_pReachConsumer->SendFixedPage(pIFixedPage); - } - - // - // Add a new page - // - if (SUCCEEDED(hRes)) - { - Tools::SmartPtr pNewPage; - Tools::SmartPtr pNewPageMarkupStream; - Tools::SmartPtr pNewFont; - Tools::SmartPtr pNewFontStream; - - WCHAR szName[MAX_PATH]; - - // - // Generate unique page name - // - if (SUCCEEDED(hRes = StringCchPrintf(szName, MAX_PATH, L"/pages/newaddedpage%u.xaml", m_cIdCount++))) - { - // - // Create new fixed page - // - hRes = m_pReachConsumer->GetNewEmptyPart(szName, - IID_IFixedPage, - reinterpret_cast(&pNewPage), - &pNewPageMarkupStream); - - DoTraceMessage(WS_TRACE, "ProcessFixedPage new page %ws", szName); - } - - // - // Generate unique font name, this can, of course, be optimized so we don't include - // the same font multiple times. But this code is supposed to just to show how to - // add a font - // - if (SUCCEEDED(hRes = StringCchPrintf(szName, MAX_PATH, L"/font_%u.ttf", m_cIdCount++))) - { - // - // Create new font resource - // - hRes = m_pReachConsumer->GetNewEmptyPart(szName, - IID_IPartFont, - reinterpret_cast(&pNewFont), - &pNewFontStream); - - DoTraceMessage(WS_TRACE, "ProcessFixedPage new font %ws", szName); - } - - if (SUCCEEDED(hRes) && - SUCCEEDED(hRes = AddFontToPage(pNewFont, pNewFontStream, pNewPage)) && - SUCCEEDED(hRes = AddTextToPage(szName, pNewPageMarkupStream))) - { - // - // Send page to next filter - // - hRes = m_pReachConsumer->SendFixedPage(pNewPage); - } - } - - return hRes; -} - - - -struct Pair_t -{ - typedef HRESULT (XpsFilter::*PFN)(void *); - - Pair_t(REFIID d, PFN n) : iid(d), pfn(n) {} - - REFIID iid; - PFN pfn; - -private: - - Pair_t& operator=(const Pair_t&); -}; - - -HRESULT -XpsFilter:: -ProcessPart( - _In_ IUnknown *pUnk - ) -{ - HRESULT hRes = S_OK; - - Pair_t pairs[] = - { - Pair_t(IID_IXpsDocument, &XpsFilter::ProcessXpsDoc), - Pair_t(IID_IFixedDocumentSequence, &XpsFilter::ProcessFixedDocSequence), - Pair_t(IID_IFixedDocument, &XpsFilter::ProcessFixedDoc), - Pair_t(IID_IFixedPage, &XpsFilter::ProcessFixedPage), - }; - - // - // Detect what part we got - // - for (ULONG i = 0; i < sizeof(pairs)/sizeof(*pairs); i++) - { - void *pvoid = NULL; - - if (SUCCEEDED(hRes = pUnk->QueryInterface(pairs[i].iid, &pvoid))) - { - // - // QueryInterface increments the reference count for the object it returns - // - hRes = (this->*pairs[i].pfn)(pvoid); - - break; - } - else if (hRes != E_NOINTERFACE) - { - break; - } - } - - // - // IPartDiscardControl objects may float through the pipeline. The code above does not check for IPartDiscardControl. - // So, for maximum compatibility, the filter forwards parts that it doesn't understand. - // - if (hRes == E_NOINTERFACE) - { - hRes = m_pReachConsumer->SendXpsUnknown(pUnk); - } - - return hRes; -} - -HRESULT -XpsFilter:: -ProcessXpsDoc( - _In_ void *pVoid - ) -{ - Tools::SmartPtr pIXpsDoc; - - pIXpsDoc.Attach(static_cast(pVoid)); - - DoTraceMessage(WS_TRACE, L"ProcessXpsDoc"); - - return m_pReachConsumer->SendXpsDocument(pIXpsDoc); -} - -HRESULT -XpsFilter:: -ProcessFixedDocSequence( - _In_ void *pVoid - ) -{ - Tools::SmartPtr pIFixedDocumentSequence; - - // - // XpsFilter::ProcessPart already incremented the reference count for the object. This - // function is taking ownership of the object, there is no need for another AddRef call - // (hence the Attach) - // - pIFixedDocumentSequence.Attach(static_cast(pVoid)); - - Tools::SmartBSTR bstr; - - if (SUCCEEDED(pIFixedDocumentSequence->GetUri(&bstr))) - { - DoTraceMessage(WS_TRACE, "ProcessFixedDocSequence uri %ws", static_cast(bstr)); - } - - Tools::SmartPtr pIPrintTicket; - - HRESULT hRes = pIFixedDocumentSequence->GetPrintTicket(&pIPrintTicket); - - if (SUCCEEDED(hRes)) - { - hRes = ProcessTicket(pIPrintTicket); - } - else if (hRes == E_ELEMENT_NOT_FOUND) - { - // - // No ticket. Benign. - // - hRes = S_OK; - - DoTraceMessage(WS_WARNING, "ProcessFixedDocSequence uri %ws. Page print ticket not present.", static_cast(bstr)); - } - - return m_pReachConsumer->SendFixedDocumentSequence(pIFixedDocumentSequence); -} - -HRESULT -XpsFilter:: -ProcessFixedDoc( - _In_ void *pVoid - ) -{ - Tools::SmartPtr pIFixedDocument; - - // - // XpsFilter::ProcessPart already incremented the reference count for the object. This - // function is taking ownership of the object, there is not need for another AddRef call - // (hence the Attach) - // - pIFixedDocument.Attach(static_cast(pVoid)); - - Tools::SmartBSTR bstr; - - if (SUCCEEDED(pIFixedDocument->GetUri(&bstr))) - { - DoTraceMessage(WS_TRACE, "ProcessFixedDoc uri %ws", static_cast(bstr)); - } - - Tools::SmartPtr pIPrintTicket; - - HRESULT hRes = pIFixedDocument->GetPrintTicket(&pIPrintTicket); - - if (SUCCEEDED(hRes)) - { - hRes = ProcessTicket(pIPrintTicket); - } - else if (hRes == E_ELEMENT_NOT_FOUND) - { - // - // No ticket. Benign. - // - hRes = S_OK; - - DoTraceMessage(WS_WARNING, "ProcessFixedDoc uri %ws. Page print ticket not present.", static_cast(bstr)); - } - - return m_pReachConsumer->SendFixedDocument(pIFixedDocument); -} - -// -// IPrintPipelineFilter -// -__override -STDMETHODIMP -XpsFilter:: -ShutdownOperation( - void - ) -{ - m_bShutdown = true; - - return S_OK; -} - -__override -STDMETHODIMP -XpsFilter:: -InitializeFilter( - _In_ IInterFilterCommunicator *pIfc, - _In_ IPrintPipelinePropertyBag *pIPropertyBag, - _In_ IPrintPipelineManagerControl *pIPipelineControl - ) -{ - HRESULT hRes = S_OK; - - // - // IID_IReachPackageProvider must be specified in the config file - // - hRes = pIfc->RequestReader(reinterpret_cast(&m_pReachProvider)); - - if (SUCCEEDED(hRes)) - { - // - // IID_IReachPackageConsumer must be specified in the config file - // - hRes = pIfc->RequestWriter(reinterpret_cast(&m_pReachConsumer)); - - m_pIPipelineControl = pIPipelineControl; - } - - VARIANT var, var2, var3, var4; - - VariantInit(&var); - VariantInit(&var2); - VariantInit(&var3); - VariantInit(&var4); - - if (SUCCEEDED(hRes) && - SUCCEEDED(hRes = pIPropertyBag->GetProperty(XPS_FP_PRINTER_NAME, &var)) && - SUCCEEDED(hRes = pIPropertyBag->GetProperty(XPS_FP_PRINTER_HANDLE, &var2)) && - SUCCEEDED(hRes = pIPropertyBag->GetProperty(XPS_FP_JOB_ID, &var3)) && - SUCCEEDED(hRes = pIPropertyBag->GetProperty(XPS_FP_USER_TOKEN, &var4))) - { - PWSTR pszName = var.bstrVal; - HANDLE hPrinter = var2.byref; - ULONG jobId = var3.ulVal; - HANDLE hUserSecurityToken = var4.byref; - - // - // Filter can use devmode, hPrinter and pszName. byref value should not be freed/deleted - // in any way. bstrVal must be deleted by clearing the variant. - // - - // - // Do not free any byref resource. Ex: do not call CloseHandle on the security token - // - - // - // Remove these if you use the variables. This is in order to build clean with /W4 - // - UNREFERENCED_PARAMETER(jobId); - UNREFERENCED_PARAMETER(hPrinter); - UNREFERENCED_PARAMETER(pszName); - - // - // Sample code to show how to impersonate in order to access resources on behalf of the - // user who submitted the job - // - if (SetThreadToken(NULL, hUserSecurityToken)) - { - // - // now revert back to the original security context - // - if (!SetThreadToken(NULL, NULL)) - { - hRes = GetLastErrorAsHResult(); - } - } - else - { - hRes = GetLastErrorAsHResult(); - } - } - - VariantClear(&var); - VariantClear(&var2); - VariantClear(&var3); - VariantClear(&var4); - - // - // Example of how to add and delete a property from the bag - // - var.vt = VT_I4; - var.lVal = 5; - - if (SUCCEEDED(hRes) && - SUCCEEDED(hRes = pIPropertyBag->AddProperty(L"TestProperty", &var))) - { - hRes = pIPropertyBag->DeleteProperty(L"TestProperty") ? S_OK : E_FAIL; - } - - - return hRes; -} - -__override -STDMETHODIMP -XpsFilter:: -StartOperation( - void - ) -{ - HRESULT hRes = S_OK; - - while (SUCCEEDED(hRes) && !m_bShutdown) - { - Tools::SmartPtr pUnk; - - hRes = m_pReachProvider->GetXpsPart(&pUnk); - - if (SUCCEEDED(hRes)) - { - if (!pUnk) - { - // - // End of objects - // - break; - } - - hRes = ProcessPart(pUnk); - } - } - - m_pReachConsumer->CloseSender(); - - if (FAILED(hRes)) - { -#pragma prefast(suppress:__WARNING_INVALID_PARAM_VALUE_1, "MSDN requires that pReason be NULL.") - m_pIPipelineControl->RequestShutdown(hRes, NULL); - } - - m_pIPipelineControl->FilterFinished(); - - return hRes; -} - -// -// IUnknown -// -STDMETHODIMP_(ULONG) -XpsFilter:: -AddRef( - VOID - ) -{ - return InterlockedIncrement(&m_cRef); -} - -STDMETHODIMP_(ULONG) -XpsFilter:: -Release( - VOID - ) -{ - ULONG cRefCount = InterlockedDecrement(&m_cRef); - - if (cRefCount) - { - return cRefCount; - } - - delete this; - - return 0; -} - -STDMETHODIMP -XpsFilter:: -QueryInterface( - _In_ REFIID riid, - _Out_ VOID **ppv - ) -{ - HRESULT hRes = E_POINTER; - - if (ppv) - { - hRes = E_NOINTERFACE; - - *ppv = NULL; - - if (riid == IID_IPrintPipelineFilter) - { - *ppv = static_cast(this); - } - else if (riid == IID_IUnknown) - { - *ppv = static_cast(this); - } - - if (*ppv) - { - AddRef(); - - hRes = S_OK; - } - } - - return hRes; -} - diff --git a/print/SimplePipelineFilter/XpsFilter.hxx b/print/SimplePipelineFilter/XpsFilter.hxx deleted file mode 100644 index 003650a6..00000000 --- a/print/SimplePipelineFilter/XpsFilter.hxx +++ /dev/null @@ -1,126 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// This is the header file for the XPS sample. -// -//---------------------------------------------------------------------------- - -#ifndef _XPS_FILTER_SAMPLE_HXX_ -#define _XPS_FILTER_SAMPLE_HXX_ - -class XpsFilter : - public IPrintPipelineFilter, - private DllLockManager -{ -public: - - XpsFilter(); - - // - // IUnknown methods - // - __override - STDMETHODIMP - QueryInterface( - _In_ REFIID riid, - _Out_ void **ppv - ); - - __override - STDMETHODIMP_(ULONG) - AddRef( - void - ); - - __override - STDMETHODIMP_(ULONG) - Release( - void - ); - - // - // IPrintPipelineFilter - // - __override - STDMETHODIMP - ShutdownOperation( - void - ); - - __override - STDMETHODIMP - InitializeFilter( - _In_ IInterFilterCommunicator *pINegotiation, - _In_ IPrintPipelinePropertyBag *pIPropertyBag, - _In_ IPrintPipelineManagerControl *pIPipelineControl - ); - - __override - STDMETHODIMP - StartOperation( - void - ); - - // - // Other methods - // - static - const GUID& - FilterClsid( - void - ); - -private: - - HRESULT - ProcessFixedPage( - _In_ void *pVoid - ); - - HRESULT - ProcessXpsDoc( - _In_ void *pVoid - ); - - HRESULT - ProcessFixedDocSequence( - _In_ void *pVoid - ); - - HRESULT - ProcessFixedDoc( - _In_ void *pVoid - ); - - HRESULT - ProcessPart( - _In_ IUnknown *pUnk - ); - - static - HRESULT - ProcessImagePart( - _In_ IPartImage *pIPartImage - ); - - Tools::SmartPtr m_pIPipelineControl; - Tools::SmartPtr m_pReachProvider; - Tools::SmartPtr m_pReachConsumer; - bool m_bShutdown; - LONG m_cRef; - LONG m_cIdCount; -}; - -#endif // _XPS_FILTER_SAMPLE_HXX_ - diff --git a/print/SimplePipelineFilter/main.cxx b/print/SimplePipelineFilter/main.cxx deleted file mode 100644 index 180fb4c6..00000000 --- a/print/SimplePipelineFilter/main.cxx +++ /dev/null @@ -1,172 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. This file contains the implementation for -// DllGetClassObject and DllMain -// -//---------------------------------------------------------------------------- - -#include "precomp.hxx" -#include "main.hxx" -#include "XpsFilter.hxx" -#include "StreamFilter.hxx" -#include "main.tmh" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -LONG DllLockManager::m_cGlobalRef = 0; - -HRESULT -WINAPI -DllCanUnloadNow(void) throw() -{ - return 0 == DllLockManager::GetGlobalRef() ? S_OK : S_FALSE; -} - -HRESULT -WINAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ PVOID *ppv - ) throw() -{ - HRESULT hRetval = E_POINTER; - - if (ppv) - { - *ppv = NULL; - - if (rclsid == XpsFilter::FilterClsid()) - { - Tools::SmartPtr pFilter; - - pFilter.Attach(new XpsFilter()); - - if (pFilter) - { - hRetval = pFilter->QueryInterface(riid, ppv); - } - else - { - hRetval = E_OUTOFMEMORY; - } - } - else if (rclsid == StreamFilter::FilterClsid()) - { - Tools::SmartPtr pFilter; - - pFilter.Attach(new StreamFilter()); - - if (pFilter) - { - hRetval = pFilter->QueryInterface(riid, ppv); - } - else - { - hRetval = E_OUTOFMEMORY; - } - } - else - { - hRetval = CLASS_E_CLASSNOTAVAILABLE; - } - } - - return hRetval; -} - -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ DWORD dwReason, - _In_opt_ PVOID pReserved - ) -{ - if (dwReason == DLL_PROCESS_ATTACH) - { - DisableThreadLibraryCalls(hInst); - - WPP_INIT_TRACING(L"WdkPipelineFilter"); - } - else if (dwReason == DLL_PROCESS_DETACH) - { - WPP_CLEANUP(); - } - - UNREFERENCED_PARAMETER(dwReason); - UNREFERENCED_PARAMETER(pReserved); - - return TRUE; -} - -void -WppTraceDebugOut( - _In_z_ const WCHAR *pszFmt, - ... - ) -{ - va_list pArgs; - - va_start(pArgs, pszFmt); - - WCHAR buf[MAX_PATH]; - - if (SUCCEEDED(StringCchVPrintf(buf, - MAX_PATH, - pszFmt, - pArgs)) && - SUCCEEDED(StringCchCat(buf, - MAX_PATH, - L"\n"))) - { - OutputDebugString(buf); - } - - va_end(pArgs); -} - -void -WppTraceDebugOut( - _In_z_ const CHAR *pszFmt, - ... - ) -{ - va_list pArgs; - - va_start(pArgs, pszFmt); - - CHAR buf[MAX_PATH]; - - if (SUCCEEDED(StringCchVPrintfA(buf, - MAX_PATH, - pszFmt, - pArgs)) && - SUCCEEDED(StringCchCatA(buf, - MAX_PATH, - "\n"))) - { - OutputDebugStringA(buf); - } - - va_end(pArgs); -} - - - - - - - - - diff --git a/print/SimplePipelineFilter/main.hxx b/print/SimplePipelineFilter/main.hxx deleted file mode 100644 index 88d8c052..00000000 --- a/print/SimplePipelineFilter/main.hxx +++ /dev/null @@ -1,51 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// The filters need to derive from DllLockManager. Thus the filter constructor and -// destructor call the DllLockManager constructor and destructor, respectively. -// -//---------------------------------------------------------------------------- - -#ifndef _FILTER_MAIN_HXX_ -#define _FILTER_MAIN_HXX_ - -class DllLockManager -{ -public: - - DllLockManager() - { - InterlockedIncrement(&m_cGlobalRef); - } - - ~DllLockManager() - { - InterlockedDecrement(&m_cGlobalRef); - } - - static - LONG - GetGlobalRef() - { - return InterlockedCompareExchange(&m_cGlobalRef, 0, 0); - } - -private: - - static LONG m_cGlobalRef; -}; - -#endif - - diff --git a/print/SimplePipelineFilter/precomp.hxx b/print/SimplePipelineFilter/precomp.hxx deleted file mode 100644 index 4ca7012d..00000000 --- a/print/SimplePipelineFilter/precomp.hxx +++ /dev/null @@ -1,26 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// This is the precompiled header file. -// -//---------------------------------------------------------------------------- - -#include -#include -#include -#include -#include "smartptr.hxx" -#include "trace.hxx" - -_Analysis_mode_(_Analysis_code_type_user_driver_) diff --git a/print/SimplePipelineFilter/precompsrc.cpp b/print/SimplePipelineFilter/precompsrc.cpp deleted file mode 100644 index 5d84a122..00000000 --- a/print/SimplePipelineFilter/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.hxx" \ No newline at end of file diff --git a/print/SimplePipelineFilter/smartptr.hxx b/print/SimplePipelineFilter/smartptr.hxx deleted file mode 100644 index 7f20c530..00000000 --- a/print/SimplePipelineFilter/smartptr.hxx +++ /dev/null @@ -1,233 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// This file contains a smart pointer implementation. -// -//---------------------------------------------------------------------------- - -#ifndef __SAMPLE_SMART_PTR_HXX__ -#define __SAMPLE_SMART_PTR_HXX__ - -namespace Tools -{ - -template -inline -void -SmartAddRef( - T *pInterface - ) throw() -{ - if (pInterface) - { - pInterface->AddRef(); - } -} - -template -inline -void -SmartRelease( - T **ppInterface - ) throw() -{ - if (*ppInterface) - { - (*ppInterface)->Release(); - *ppInterface = NULL; - } -} - -template -class SmartPtr -{ -public: - - inline - SmartPtr( - void - ) throw() : m_Pointer(NULL) - { - } - - inline - SmartPtr( - _In_opt_ T *pointer - ) throw() - : m_Pointer(pointer) - { - SmartAddRef(m_Pointer); - } - - inline - SmartPtr( - _In_ const SmartPtr © - ) throw() - { - m_Pointer = copy.m_Pointer; - SmartAddRef(m_Pointer); - } - - inline - ~SmartPtr( - void - ) throw() - { - SmartRelease(&m_Pointer); - } - - inline - SmartPtr & - operator=( - _In_opt_ T *pointer - ) throw() - { - T *temp = m_Pointer; - - m_Pointer = pointer; - SmartAddRef(m_Pointer); - SmartRelease(&temp); - - return *this; - } - - inline - SmartPtr & - operator=( - _In_ const SmartPtr © - ) throw() - { - T *temp = m_Pointer; - - m_Pointer = copy.m_Pointer; - SmartAddRef(m_Pointer); - SmartRelease(&temp); - - return *this; - } - - inline - operator T *() throw() - { - return m_Pointer; - } - - inline - operator const T *() const throw() - { - return m_Pointer; - } - - inline - T ** - operator&() throw() - { - return &m_Pointer; - } - - inline - const T ** - operator&() const throw() - { - return &m_Pointer; - } - - inline - T * - operator->() throw() - { - return m_Pointer; - } - - inline - const T * - operator->( - ) const throw() - { - return m_Pointer; - } - - inline - void - Attach( - _In_opt_ T *pointer - ) throw() - { - T *temp = m_Pointer; - m_Pointer = pointer; - - SmartRelease(&temp); - } - - inline - T * - Detach( - void - ) throw() - { - T *pTemp = m_Pointer; - m_Pointer = NULL; - - return pTemp; - } - - inline - void - Clear( - void - ) throw() - { - SmartRelease(&m_Pointer); - } - -private: - - T *m_Pointer; -}; - -/////////////////////////////////////////////////////////////////////////////// - -class SmartBSTR -{ -public: - - SmartBSTR() throw() - : m_bstr (NULL) - { - } - - ~SmartBSTR() throw() - { - ::SysFreeString(m_bstr); - } - - operator BSTR() const throw() - { - return m_bstr; - } - - BSTR* - operator&() throw() - { - return &m_bstr; - } - -private: - - BSTR m_bstr; -}; - -}; // namespace tools - -#endif diff --git a/print/SimplePipelineFilter/trace.hxx b/print/SimplePipelineFilter/trace.hxx deleted file mode 100644 index 8b905c49..00000000 --- a/print/SimplePipelineFilter/trace.hxx +++ /dev/null @@ -1,51 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// This source code is intended only as a supplement to Microsoft -// Development Tools and/or on-line documentation. See these other -// materials for detailed information regarding Microsoft code samples. -// -// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// -// Abstract: -// WDK print filter sample. -// Declares what is needed to Event Tracing. -// -//---------------------------------------------------------------------------- - -#ifndef __WDK_SAMPLE_TRACE_HXX__ -#define __WDK_SAMPLE_TRACE_HXX__ - -// -// Generate your own guid. Feel free to add more flags, as needed. -// -#define WPP_CONTROL_GUIDS \ - WPP_DEFINE_CONTROL_GUID(WdkSample, (79ad6dce, adad, 47ae, b49e, 41bcdccf9ed8), \ - WPP_DEFINE_BIT(WS_ERROR) \ - WPP_DEFINE_BIT(WS_WARNING) \ - WPP_DEFINE_BIT(WS_TRACE) \ - ) - -void -WppTraceDebugOut( - _In_z_ const WCHAR *pszFmt, - ... - ); - -void -WppTraceDebugOut( - _In_z_ const CHAR *pszFmt, - ... - ); - -// -// For checked builds, send output to debugger rather than to file -// -#ifdef DBG -#define WPP_DEBUG(x) WppTraceDebugOut x -#endif - -#endif diff --git a/print/XPSDrvSmpl/Package/package.VcxProj b/print/XPSDrvSmpl/Package/package.VcxProj deleted file mode 100644 index cff0717f..00000000 --- a/print/XPSDrvSmpl/Package/package.VcxProj +++ /dev/null @@ -1,161 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - {42677515-C196-4C0F-99A2-F11E2FB55BF6} - - - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - - - {8D542B56-EB45-43B1-AAB8-417352F5BDE6} - - - {C9C14C99-103E-45CB-B1B4-2C165429E35C} - - - {0F8262C1-75D8-4A92-BCB6-37A290891708} - - - {23BA577F-B171-4CEC-92E0-49EE44564366} - - - {1893FA97-40A9-480F-BB77-279F959EAE6E} - - - {E31D1C4F-8E0D-428A-8583-5159CE690B33} - - - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A} - - - {7441D7F2-F509-4A47-9404-3EB8653AE037} - - - - WindowsKernelModeDriver10.0 - Utility - Package - true - Debug - - - - {4A7303D2-92DB-4537-A380-24D334FC24FE} - {A7EB2426-E8C0-4DB0-A077-F37FCB01D98C} - $(MSBuildProjectName) - - - Windows10 - true - - - Windows10 - false - - - Windows10 - true - - - Windows10 - true - - - Windows10 - true - - - Windows10 - false - - - Windows10 - false - - - Windows10 - false - - - - - - - - - - - DbgengRemoteDebugger - False - None - - - - - - %PathToInf% - False - False - True - - 133563 - - - - sha256 - - - - - sha256 - - - - - sha256 - - - - - sha256 - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/Package/package.VcxProj.Filters b/print/XPSDrvSmpl/Package/package.VcxProj.Filters deleted file mode 100644 index 1ac9986d..00000000 --- a/print/XPSDrvSmpl/Package/package.VcxProj.Filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {DEBD3DE2-918F-4EC4-BC14-22DC48643C2A} - - - h;hpp;hxx;hm;inl;inc;xsd - {FDFF8748-4F96-4902-A7A8-D371D6258627} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {15BBE04E-6C77-4886-A5A7-AE978AA52FCD} - - - inf;inv;inx;mof;mc; - {A84D9116-BBD8-4002-84A9-63115C291561} - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/README.md b/print/XPSDrvSmpl/README.md deleted file mode 100644 index f23f78ad..00000000 --- a/print/XPSDrvSmpl/README.md +++ /dev/null @@ -1,292 +0,0 @@ ---- -page_type: sample -description: "Provide a starting point for developing XPSDrv printer drivers and to illustrate the facility and potential of an XPSDrv print driver." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# XPSDrv Driver and Filter Sample - -This sample is intended to provide a starting point for developing XPSDrv printer drivers and to illustrate the facility and potential of an XPSDrv print driver. This goal is accomplished by implementing a number of real-world features within a set of XPS print pipeline filters that are configured through a configuration plug-in that supports custom UI content and PrintTicket handling. - -Windows includes a print architecture and a document format known as XPS (XML Paper Specification). Part of the new architecture is the XPSDrv print driver, which is designed to provide a flexible, extensible path to manipulate and print an XPS spool file through a series of filters. - -This sample is intended to provide a starting point for developing XPSDrv printer drivers and to illustrate the facility and potential of an XPSDrv print driver. This goal is accomplished by implementing a number of real-world features within a set of XPS print pipeline filters that are configured through a configuration plug-in that supports custom UI content and PrintTicket handling. - -The sample broadly consists of three components: a set of filters, a configuration plug-in for handling custom UI content, and a configuration plug-in for handling more advanced PrintTicket features. For more information, see [XPS Printing Features](https://docs.microsoft.com/windows-hardware/drivers/print/xps-printing-features). - -## Build the sample - -To build a driver solution using Windows Driver Kit (WDK) 10 and Visual Studio 2017, perform the following steps. - -1. Open the solution file in Visual Studio 2017. - -1. Add all non-binary files (usually located in the \\install directory of the sample) to the Package project: - - 1. In the **Solution Explorer**, expand the **package** project and right click **Driver Files** - - 1. Select **Add**, then click **Existing Item** - - 1. Navigate to the location to which you downloaded the sample, and select all the files in the **install** directory, or the equivalent set of non-binary files such as INFs, INIs, GPD, PPD files, etc. - - 1. Click **Add** - -1. Configure these files to be added into the driver package: - - 1. In the **Solution Explorer**, right click on the solution and choose **Add** > **New Project**. Choose **Driver Install Package** under Visual C++/Windows Driver/Package. - - 1. In the **Solution Explorer**, right click the **Driver Package** project and select **Properties**. - - 1. In the left pane, click **Configuration Properties** \> **Driver Install** \> **Package Files**. (If **Package Files** is not available, you may need to re-install the **Windows Driver Kit**.) - - 1. In the right pane, click **** and use the ellipsis button (...) to browse to the set of files that needs to be added to the driver package. All of the data files added in **Step 2.iii**, except the INF file, should be added. This configuration is per architecture, so this configuration must be repeated for each architecture that will be built. - - 1. Click **OK**. - -1. Add a reference to the driver package. - - 1. In the **Solution Explorer**, right click the **package** project and select **Add Reference**. - - 1. In the right pane, check the **Driver Package** created in step 3. - - 1. Click **OK**. - -1. Open the INF file and edit it to match the built output. - - 1. Open the INF file. - - 1. In the Version section, add a reference to a catalog file like this: CatalogFile=XpsDrvSmpl.cat. - - 1. In the SourceDisksFiles section, change the location of the DLL files you are building to =1. This indicates that there is no architecture specific directory in this driver. If you ship multiple architectures simultaneously, you will need to collate the driver INF manually. - -At this point, Visual Studio 2017 will be able to build a driver package and output the files to disk. In order to configure driver signing and deployment, see [Developing, Testing, and Deploying Drivers](https://docs.microsoft.com/windows-hardware/drivers/develop/). - -> [!NOTE] -> If you compile your sample driver with Microsoft Visual Studio version 10, or 11 with the \_DEBUG flag set, then you should not use CComVariant on the following two XPS Print Filter Pipeline properties: - -- XPS\_FP\_USER\_TOKEN - -- XPS\_FP\_PRINTER\_HANDLE - -There is a known issue with the current implementation of the Print Filter Pipeline, where the variant type for these two properties is set to VT\_BYREF. And as a result of this known issue, any filter binary that is compiled with the \_DEBUG flag set will experience the ATLASSERT() failure. This is because when you use the CComVariant, its destructor checks the returned value from the Clear() function, as shown: - -```cpp -~CComVariant() throw() -{ - HRESULT hr = Clear(); - ATLASSERT(SUCCEEDED(hr)); - (hr); -} -``` - -When you compile this sample driver with Visual Studio version 9, you don't experience this problem because the destructor for CComVariant doesn't perform this check on the returned value from the Clear() function. - -## Installation - -The sample has the following prerequisites: - -- Microsoft XPS Document Writer print driver and the XPS filter-pipeline infrastructure. - -- Microsoft MSXML 6.0 - -Install the driver through the **Add Printer Wizard** by selecting \\\install as the source for the driver install. - -## Design and Operation - -### Overview - -This sample can be used as a basis for implementing a driver based on the new XPS pipeline infrastructure. - -The Page Scaling filter is written by using the stream interface to attempt to demonstrate how to use the stream interface. It thus depends on a ZIP library to handle the PK archive structure. The sample does not include the code for the PK archive handling. - -Two interfaces are defined in *ipkarch.h* and *ipkfile.h* that need support from an additional PK archive handling module called pkarch.dll. Pkarch.dll is a file that is included in the [PKWare SDK](https://support.pkware.com/pages/viewpage.action?pageId=721433). If this module is not present, the page scaling filter sample will revert to merely copying the data from the read stream to the write stream. Developers who are using this sample can choose one of the following options: - -- Simplify the scaling filter to use the XPS interfaces (like the other four filters) - -- License the third-party zip library that is used in the sample - -- Modify the sample to use another ZIP library. For example, you can modify the sample to use the [Packaging API Reference](https://docs.microsoft.com/previous-versions/windows/desktop/opc/packaging-programming-reference) - -IPKArch defines an interface for initializing, controlling, and accessing the PK archive. IPKFile defines an interface that abstracts the details of a PK archive file header record from the XPS container handling. Access to the files within the archive is provided through a map between the file name and file objects that support the IPKFile interface. This allows the XPS processing code to retrieve file data by name (a convenience as the interaction between parts and relationships between parts is defined using the part name). - -### Print Pipeline Filters - -There are five filters that are split into two types: four use the XPS filter interface and one uses the stream filter interface. The XPS interface provides the filter writer with a logical view on an XPS document by presenting logical XPS document parts (XPS Document, Fixed Document Sequences, Fixed Documents, and Fixed Pages) to the filter in a known and defined order. The stream interface simply provides a stream that contains the XPS document--a zip archive. The filter writer is in this case required to handle the PK archive structure, decompression of the parts within the container, and the XPS Open Packaging conventions. - -The four filters that use the XPS interface provide support for the following: - -- The Watermark Filter is responsible for adding mark-up to Fixed Page content to express textual, bitmap, and vector-based watermarks. - -- The Booklet Filter is responsible for page re-ordering and padding page insertion to create booklets from the XPS document. Note that this filter re-uses the NUp filter to provide appropriate page transformation. - -- The NUp Filter is responsible for transforming and combining logical pages onto physical pages to provide multiple page per sheet support. - -- The Color Management Filter is responsible for constructing and applying color transforms to Fixed Page content. - -The stream interface filter provides Page Scaling support (that is, wrapping content with the appropriate transforms to scale from a source Fixed Page to the destination). - -### UI Plug-in - -The UI plug-in provides support for controlling features that are not supported by the Unidrv core UI. Three additional printer property pages are implemented that provide color management, watermarking, and general features. The UI plug-in also provides custom Devmode support for options that are not easily expressed in a GPD file (for example, the numeric values required to define custom page scaling options). - -### Print Ticket Provider Plug-in - -Unidrv provides support for mapping simple features and options from a GPD file to a Print Ticket by a "PrintSchemaKeywordMap" keyword in the GPD file. Many of the features that are supported by the sample filters require a more sophisticated mapping between the GPD description and the Print Schema definition. These features include features that are nested within features and control of numeric values. The Print Ticket provider plug-in provides this support by converting a number of GPD feature options to a single more complicated Print Ticket feature. For example, the Print Schema definition of PageScaling requires numeric values for custom page scaling options (offset and scale values) as well as a sub-feature defining the scaling offset option. This plug-in can take settings from a "flat" description of the scaling and offset alignment features in the GPD combined with custom DevMode values configured by the UI plug-in to generate an appropriate PrintTicket construct that conforms to the PrintSchema definition of PageScaling. - -The components of the XPSDrv sample enable a user or application to configure the filter pipeline to process an XPS container according to the supported filters. The XPS spool file that is passed to the filter pipeline broadly comprises two components: the document structure and page content as well as one or more Print Tickets that configure the print job at various levels. Job content will be defined either as output directly from a Windows Presentation Foundation (WPF) application or through a conversion from legacy GDI to XPS through the Microsoft XPS Document Writer (MXDW). PrintTicket settings can be controlled directly through the UI or through application settings in either DevMode or PrintTicket. - -To enable configuration of the driver, the sample uses a set of GPD files and a configuration plug-in. The configuration plug-in provides custom DevMode and custom UI support. This support enables the driver to store and configure driver specific settings that can be used as a source for configuring PrintTicket features. In order to provide the appropriate PrintTicket support, the driver makes use of a combination of the core Unidrv PrintTicket support and a PrintTicket provider plug-in to enable the generation of more sophisticated PrintTicket settings. In combination these allow an application or user to setup a PrintTicket ready for inclusion in an XPS document. - -With the PrintTicket in place and the document content supplied by either an application using WPF or a legacy application through MXDW, the filters that make up the filter pipeline for the sample driver act on the XPS document according to the settings specified in the PrintTicket. Each filter checks whether its functionality has been enabled and extracts any settings relevant to its function before processing the container appropriately. The order in which filters are applied is important to the eventual output; for example, a filter adding page content (like the watermark filter) can be placed anywhere in the pipeline, but its placement determines where the content is added. Configured to run before an NUp filter ensures page content is confined to the logical page; whereas, if it is run after an NUp filter, the watermark will be applied to the transformed pages. The filter ordering is controlled by the filter configuration file; this file is an XML document that details the order and interface type for each filter. - -### Common Filter Functionality - -Regardless of the type of interface that a filter uses to process the XPS document content, there are common requirements for all filters. These include filter initialization and shutdown and are provided as a base class from which either an XPS or stream interface filter can derive. - -### XPS Interface - -Four of the five filters make use of the XPS interface that is provided by the filter pipeline manager as XPS provider and consumer interfaces. The XPS provider interface supplies XPS parts to the filter on demand. When a part is requested from the provider, a generic interface pointer is returned. This interface is queried to identify its type: an XPS document, a Fixed Document Sequence, a Fixed Document or a Fixed Page. This functionality is common between filters that use the XPS interface and a base class XPS interface implementation (that derives from the common filter class described earlier) is provided that retrieves, identifies, and dispatches the part to the appropriate handler. When all parts have been processed, the base class calls a method to finalize the filter. To supply the filter-specific functionality, a filter derives from the base class and implements handlers for any of the part types it requires and/or the finalize method to complete its function. Additionally, the base class provides default implementations for the XPS part handlers (using these exclusively merely passes the document on through the XPS consumer interface) and a method for initializing the XPS interface. - -### Stream Interface - -One of the filters (page scaling) makes use of the stream interface that is provided by the filter pipeline manager as a read and write stream. This interface is a very basic interface that merely supplies the filter with a stream that contains the XPS document as a PK archive. To be able to use the stream interface to modify document content, the filter needs to be able to process the PK archive to retrieve all of the files contained within, decompress the data associated with these files, process the open packaging conventions (taking into account potentially interleaved data), and compress and send the data in a structure appropriate to both the open package and PK archive conventions. A class is provided that uses an XPS document processor for accessing the logical structure of the package and reporting the Fixed Page content to the filter. This class supports the necessary interfaces to initialize the IO streams, start the process of handling the data, and a default handler for processing Fixed Page content. The page scaling filter derives from this class and implements its own Fixed Page handler that is called by the XPS processor. - -### Watermark Filter - -The Watermark filter is intended to demonstrate adding presentation content to the Fixed Pages within an existing XPS container by using the XPS interface as the source of the XPS document. This added content acts as a watermark and is configured by the PrintTicket. The filter takes as input the PageWatermark public Print Schema feature with custom support for vector and bitmap watermark types and the Fixed Pages in an XPS document. This custom content is expressed as Private options to the existing PageWatermark definition. The output is the sequence of Fixed Pages and accompanying resources required for the watermark. - -The filter is configured by parsing an input PrintTicket by using DOM to extract the relevant features and options. If the functionality is enabled, the filter processes the document as required. The PrintTicket is constructed through the following algorithm to provide settings at the appropriate scope (Fixed Document Sequence, Fixed Document and Fixed Page): - -1. Validate and merge the print ticket from the FDS with the default PrintTicket converted from the default DevMode in the property bag. The resultant ticket will be the Job level ticket. - -1. Validate and merge the print ticket from the current FD with the Job level ticket from step 1. The resultant ticket will be the document level ticket. - -1. Validate and merge the print ticket from the current FP with the Doc level ticket from step 2. The resultant ticket will be the page level ticket. - -When a watermark is enabled in the PrintTicket, the filter creates a watermark of the appropriate type (text, raster, or vector). This is returned as a generic watermark interface that abstracts the watermark type from the filter. The filter then calls the watermark object to send any resources that it may require to the filter pipeline (the font for text, the bitmap for raster, and none for vector). All resources are added through a resource cache that enables the watermark object to ignore any problems with sending repeated resources (the cache checks if the resource is present and only sends it if it has not seen the resource before). With the resource in place, the filter instantiates a SAX handler passing the watermark object. The SAX handler is used to parse the Fixed Page, allowing the filter to control when it inserts the watermark into the Fixed Page; when underlay is required, the mark-up is inserted when the FixedPage start element is encountered and when overlay is required the mark-up is inserted when FixedPage end element is encountered. By passing the abstracted watermark object, the SAX handler can be re-used for any watermark as it merely requests appropriate mark-up from the watermark object and inserts it into the Fixed Page mark-up as appropriate. - -### Vector Mark-up - -XPS documents can contain a range of vector elements that contain color data that describes how the elements should be rendered on a specific device. The following elements support color data: - -- Color - -- Fill - -- Stroke - -When any of these elements are found in a fixed page, the SAX handler passes the associated color data to a color conversion object. This uses the following algorithm to convert the color: - -1. The XML mark-up is broken down into color channel values, color channel value types, color format, and any other color details contained in the color mark-up string. - -1. The resulting values are color transformed in conjunction with preferences defined in the PrintTicket. The result is a new set of color values. - -1. These new values are used to reconstructs a color reference containing the new color values. - -1. The newly constructed color reference is used in place of the original color reference, resulting in the transformed color output. - -### Bitmap Resources - -When a bitmap is referred to in a fixed page, the SAX handler passes the bitmap URI to a bitmap conversion method in the color converter object. - -The conversion process starts by creating a new color managed bitmap object that represents the bitmap along with a color profile manager. The color profile manager is initialized by the PrintTicket settings and is used to supply a suitable color transform based on those settings. - -After the color managed bitmap object is created, the object is passed to a resource caching class that manages which bitmaps are written out and ensures bitmaps are only written out once. A single bitmap can be referred to many times in an XPS container but the bitmap itself should have a color transformation applied only once and should be written out only once to avoid unnecessary processing overhead. The caching manager ensures this by creating a unique key generated from the bitmap URI and color profile that is then recorded against the URI. If the caching manager receives bitmap objects with an existing key, those bitmaps do not need re-processing and the stored URI is used merely to identify the color transformed bitmap. - -If a bitmap has not been handled yet, the caching manager calls a write data method in the color bitmap object to indicate that the bitmap should write itself out to the filter pipeline. The write process also includes the application of a color transform to the bitmap. The following steps occur to apply the transform: - -1. A stream is created to the bitmap itself and the bitmap is loaded into memory. - -1. A bitmap codec object is created that takes the bitmap and uses an appropriate codec to decompress the bitmap and present the bitmap data and values. - -1. The bitmap data is then converted by using a color transform supplied by the color profile management class. - -1. The bitmap codec object re-encodes the bitmap by using a matching codec to that used to decode the bitmap. - -1. The encoded bitmap is streamed back out to the container. - -### Booklet Filter - -The Booklet filter is intended to demonstrate how a filter can re-order the pages and add additional pages to a document to enable booklet binding using the XPS interface as the source of the XPS document. Page transformation is not applied by the filter but deferred to the NUp filter demonstrating filter re-use. The filter takes as input the JobBinding and DocumentBinding public Print Schema features (defined in the PrintTicket), and the sequence of pages in the fixed documents or fixed document sequence within the XPS document and outputs the fixed pages in an appropriate order to be printed as a booklet. Page content is not modified; however, an additional fixed page might be required to ensure the appropriate fixed page flow. - -The filter is configured by parsing an input PrintTicket by using DOM to extract the relevant features and options. If the functionality is enabled, the filter processes the document as required. Again the PrintTicket is constructed according to the algorithm that is documented in the watermark filter notes. - -The booklet filter maintains a list of references to the fixed page parts within an XPS document as they are presented to the filter. This list is used to output the correct page order and is reset and repopulated according to whether JobBinding or DocumentBinding is set. If JobBinding is enabled, all pages within the Fixed Documents that make up the Fixed Document Sequence are cached and the list is not flushed until the document has completed. If DocumentBinding is enabled, the filter caches all pages in a Fixed Document and flushes the list at the end of the Fixed Document. When the list is flushed, the pages are re-ordered and a padding page is added if the total page count is odd before being sent on to the filter pipeline. - -### NUp Filter - -The NUp filter is intended to demonstrate how a filter can transform vector mark-up within an XPS container by using the XPS interface as the source of the XPS document. The PrintTicket might contain preferences that the filter uses to apply a multi-up transformation to the containers fixed pages, resulting in a new set of pages that contain the original pages as child canvases. The filter takes as input the JobNUp, DocumentNUp, JobBinding, DocumentBinding, PageMediaSize, and PageOrientation public Print Schema features (defined in the PrintTicket) and the Fixed Pages that define the Fixed Document and Fixed Document Sequence. The output is a new sequence of Fixed Pages that contain the render-transformed source pages sent through the XPS interface to the filter pipeline. - -The filter is configured by parsing an input PrintTicket using DOM to extract the relevant features and options. If the functionality is enabled, the filter processes the document as required. Again the PrintTicket is constructed according to the algorithm that is documented in the watermark filter notes. - -Within the filter, SAX is used to parse the XPS container with each fixed page being read, amended, and inserted into a new fixed page as a canvas. The amendment of the source fixed page involves removing any wrapping mark-up that defines a fixed page and in place adding suitable mark-up to define a new canvas. The new canvas mark-up includes a transformation matrix that positions, rotates, and scales the canvas on the new fixed page. The transformation is provided by a supporting object that generates the transform according to the PrintTicket settings. Settings in the print ticket that are used include how many source pages should be stored as canvases in a single new fixed page (NUp count), the ordering of canvases on the new fixed page, and the target page size and orientation. - -New canvases are added to the new fixed page mark-up until the document contains the number of source fixed pages that are required in a single new fixed page or until there are no source pages left. When the new fixed page is full, it is written out to the pipeline and another fixed page is started ready for population with source pages. - -In addition to the NUp feature processing, the NUp filter is re-used to apply the 2-Up processing required for booklet printing. This is achieved by looking for a valid binding option in the PrintTicket and applying 2-Up as appropriate. - -## Page Scaling Filter - -The page scaling filter is intended to demonstrate how a filter can transform vector mark-up within a XPS container by using the stream interface as the source of the XPS document. The PrintTicket can contain page scaling preferences that the filter uses to amend page dimension values in each fixed page processed. - -Within the filter, SAX is used to parse the XPS container with each fixed page being read, amended, and written back out. The modification of the fixed page mark-up begins by modifying the fixed page dimensions to match the target page size specified in the print ticket for the current fixed page. Subsequently, the fixed page content is scaled to correctly fit the target scale by applying a canvas around the source content that includes a transformation matrix. The SAX handler is supported by a page scale class which manages the creation of a transformation matrix and the presentation of the matrix correctly formatted for use in the fixed page. - -## XPS Container Handling - -The stream filter is required to handle the Open Packaging conventions that are used by an XPS document. These conventions can be thought of as the document structure above that of the PK archive itself. Sources for a set of classes are provided that support processing of the XPS document in terms of the constituent files in the PK archive. This includes: - -- Initiating the document processing based on the root relationships part defined in the package. - -- Validation of the parts within the package against their content type and usage. - -- Processing of Fixed Document Sequence and all resources associated with it. - -- Processing of the Fixed Documents within the Fixed Document Sequence and all resources associated with them. - -- Processing of the Fixed Page parts with the Fixed Documents and all resources associated with them. - -- Passing Fixed Page content processing to a registered FP handler for modification. - -- Passing all parts on to a PK archive handling module with valid ordering. - -The XPS processor is not responsible for extracting or decompressing part data from the PK archive. This task is the responsibility of an additional module that implements an interface known to the XPS container handling code. - -## UI Plug-in details - -The UI Plug-in is intended to demonstrate how to extend the standard Unidrv UI to add additional property sheets and controls and to provide support for custom features that are not supported by the core Unidrv UI. Three new pages have been added that allow control of the sample filters: - -- Color--enables configuration of the color conversion filter. - -- Watermarks--enables a watermark to be selected and enable configuration of its properties for use in the watermark filter. - -- Features--includes controls to configure the page scaling, booklet, and NUp filters. In addition, the standard driver settings--duplex, intent, and page borders--can also be modified. - -Various UI control types have been implemented on these property pages to enable a user to modify settings in the driver. The UI supports the following control types: - -- Check-box - -- Combo-box - -- List-Box - -- Edit-Box - -- Edit number (with buddy up/down control) - -The settings that associated with each of these controls are stored as one the following types: - -- GPD options. These settings are defined in the sample driver GPD configuration file and are handled by the Unidrv core via the CPSUI interface. All GPD options that are managed from the UI plug-in are hidden from the standard Unidrv Treeview dialog box. -- OEM private DevMode. These settings are settings that cannot be represented in the GPD file format (for example, numerical values and strings). They are instead added to the DevMode at a private offset. - -The Unidrv UI Plug-in interface includes methods that allow additional property pages to be inserted into the drivers property sheet. In the sample, only additional document property pages are implemented because there are no device property pages required. A collection of property page objects are stored at the plug-in interface level, each of which is responsible for the three property pages (Color, Watermarks, and Features). Each property page object creates a Microsoft Windows property page from a dialog resource and handles all Windows Messages that are received through a common dialog procedure. A collection of UI control objects are stored in the property page, one for each Windows control on the page. - -When a property page receives a message for a control, it looks up the relevant control in the collection (by using the resource identifier) and calls the appropriate method in the control interface, given the Windows message. Each control object is responsible for handling its own initialization and any user input through the appropriate get and set functions. The sample get and set functions provide an interface to read and update the GPD options and OEM private DevMode. - -## PrintTicket Provider Plug-in - -The sample Print Ticket Provider plug-in is intended to demonstrate how to validate and map driver settings from a DevMode description to a Print Ticket description and back again. The driver allows configuration of custom settings through a custom user interface. These custom settings are represented as either GPD options or in the OEM private DevMode and are mapped to and from the Print Ticket using an XML schema. - -To support Print Ticket handling, the Unidrv UI Plug-in Print Ticket Provider Interface is utilized. The Unidrv UI Plug-in interface includes methods that allow mapping of DevMode to and from a Print Ticket Schema. A collection of feature conversion objects are stored at the plug-in interface level, each of which is responsible for the conversion of a specific feature (Color, Watermark, Booklet, Scaling, and NUp). Whenever the Unidrv core calls through the external interface of the plug-in to convert from DevMode to Print Ticket or Print Ticket to DevMode, the collection is iterated through calling each conversion object in turn; each then perform its own DevMode/Print Ticket mapping via the appropriate get and set functions. The sample get and set functions provide an interface to read and write the GPD options, OEM private DevMode, and Print Ticket keyword value pairs. diff --git a/print/XPSDrvSmpl/XPSDrvSmpl.sln b/print/XPSDrvSmpl/XPSDrvSmpl.sln deleted file mode 100644 index 38c60fc5..00000000 --- a/print/XPSDrvSmpl/XPSDrvSmpl.sln +++ /dev/null @@ -1,268 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2005 -MinimumVisualStudioVersion = 12.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{5A68CA37-F621-4113-B573-8A361135203B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debug", "Debug", "{3F637C27-BDFE-4466-838C-5FBDE4C5F2C1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{199CBE46-0460-42FA-AB80-DD3C89310F4A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{A51E3BEB-5868-445C-8F87-AC7D05C4EE2D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ui", "Ui", "{8D891397-002B-4AF1-929E-0515D8F2F5AB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{413B0724-5117-4BD6-99EF-D6B59859E1B3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Filters", "Filters", "{5234E3C1-1C0C-49A6-900E-EEC5815604BA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Xdcont", "Xdcont", "{A82FAF9C-BCCE-4569-9EB2-36DA4D239DA8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Watermark", "Watermark", "{5452CCB0-EF39-4699-A8E0-C86D595FC4DA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scaling", "Scaling", "{8C5A07F5-C9E0-430D-A908-2C1161C952ED}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nup", "Nup", "{8B19C579-DB40-4D8B-A605-165366FAB6CD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Color", "Color", "{D804D2D8-5ED5-42B3-A77D-1A46D3ACB727}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Booklet", "Booklet", "{3904D25E-E461-4A90-A544-E1C74A32086A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "Package\package.VcxProj", "{4A7303D2-92DB-4537-A380-24D334FC24FE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdsdbg", "src\debug\xdsdbg.vcxproj", "{E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdsmplcmn", "src\common\xdsmplcmn.vcxproj", "{42677515-C196-4C0F-99A2-F11E2FB55BF6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdsmplui", "src\ui\xdsmplui.vcxproj", "{7441D7F2-F509-4A47-9404-3EB8653AE037}" - ProjectSection(ProjectDependencies) = postProject - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdfltcmn", "src\filters\common\xdfltcmn.vcxproj", "{0F8262C1-75D8-4A92-BCB6-37A290891708}" - ProjectSection(ProjectDependencies) = postProject - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdcont", "src\filters\xdcont\xdcont.vcxproj", "{D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}" - ProjectSection(ProjectDependencies) = postProject - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - {0F8262C1-75D8-4A92-BCB6-37A290891708} = {0F8262C1-75D8-4A92-BCB6-37A290891708} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdwmark", "src\filters\watermark\xdwmark.vcxproj", "{E31D1C4F-8E0D-428A-8583-5159CE690B33}" - ProjectSection(ProjectDependencies) = postProject - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - {0F8262C1-75D8-4A92-BCB6-37A290891708} = {0F8262C1-75D8-4A92-BCB6-37A290891708} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdscale", "src\filters\scaling\xdscale.vcxproj", "{1893FA97-40A9-480F-BB77-279F959EAE6E}" - ProjectSection(ProjectDependencies) = postProject - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A} = {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A} - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - {0F8262C1-75D8-4A92-BCB6-37A290891708} = {0F8262C1-75D8-4A92-BCB6-37A290891708} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdnup", "src\filters\nup\xdnup.vcxproj", "{23BA577F-B171-4CEC-92E0-49EE44564366}" - ProjectSection(ProjectDependencies) = postProject - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - {0F8262C1-75D8-4A92-BCB6-37A290891708} = {0F8262C1-75D8-4A92-BCB6-37A290891708} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XDColMan", "src\filters\color\XDColMan.vcxproj", "{C9C14C99-103E-45CB-B1B4-2C165429E35C}" - ProjectSection(ProjectDependencies) = postProject - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - {0F8262C1-75D8-4A92-BCB6-37A290891708} = {0F8262C1-75D8-4A92-BCB6-37A290891708} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xdbook", "src\filters\booklet\xdbook.vcxproj", "{8D542B56-EB45-43B1-AAB8-417352F5BDE6}" - ProjectSection(ProjectDependencies) = postProject - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {42677515-C196-4C0F-99A2-F11E2FB55BF6} - {0F8262C1-75D8-4A92-BCB6-37A290891708} = {0F8262C1-75D8-4A92-BCB6-37A290891708} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Debug|ARM64.Build.0 = Debug|ARM64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Debug|Win32.Build.0 = Debug|Win32 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Debug|x64.ActiveCfg = Debug|x64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Debug|x64.Build.0 = Debug|x64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Release|ARM64.ActiveCfg = Release|ARM64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Release|ARM64.Build.0 = Release|ARM64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Release|ARM64.Deploy.0 = Release|ARM64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Release|Win32.ActiveCfg = Release|Win32 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Release|Win32.Build.0 = Release|Win32 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Release|x64.ActiveCfg = Release|x64 - {4A7303D2-92DB-4537-A380-24D334FC24FE}.Release|x64.Build.0 = Release|x64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Debug|ARM64.Build.0 = Debug|ARM64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Debug|Win32.ActiveCfg = Debug|Win32 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Debug|Win32.Build.0 = Debug|Win32 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Debug|x64.ActiveCfg = Debug|x64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Debug|x64.Build.0 = Debug|x64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Release|ARM64.ActiveCfg = Release|ARM64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Release|ARM64.Build.0 = Release|ARM64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Release|Win32.ActiveCfg = Release|Win32 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Release|Win32.Build.0 = Release|Win32 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Release|x64.ActiveCfg = Release|x64 - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98}.Release|x64.Build.0 = Release|x64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Debug|ARM64.Build.0 = Debug|ARM64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Debug|Win32.ActiveCfg = Debug|Win32 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Debug|Win32.Build.0 = Debug|Win32 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Debug|x64.ActiveCfg = Debug|x64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Debug|x64.Build.0 = Debug|x64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Release|ARM64.ActiveCfg = Release|ARM64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Release|ARM64.Build.0 = Release|ARM64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Release|Win32.ActiveCfg = Release|Win32 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Release|Win32.Build.0 = Release|Win32 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Release|x64.ActiveCfg = Release|x64 - {42677515-C196-4C0F-99A2-F11E2FB55BF6}.Release|x64.Build.0 = Release|x64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Debug|ARM64.Build.0 = Debug|ARM64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Debug|Win32.ActiveCfg = Debug|Win32 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Debug|Win32.Build.0 = Debug|Win32 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Debug|x64.ActiveCfg = Debug|x64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Debug|x64.Build.0 = Debug|x64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Release|ARM64.ActiveCfg = Release|ARM64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Release|ARM64.Build.0 = Release|ARM64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Release|Win32.ActiveCfg = Release|Win32 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Release|Win32.Build.0 = Release|Win32 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Release|x64.ActiveCfg = Release|x64 - {7441D7F2-F509-4A47-9404-3EB8653AE037}.Release|x64.Build.0 = Release|x64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Debug|ARM64.Build.0 = Debug|ARM64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Debug|Win32.ActiveCfg = Debug|Win32 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Debug|Win32.Build.0 = Debug|Win32 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Debug|x64.ActiveCfg = Debug|x64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Debug|x64.Build.0 = Debug|x64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Release|ARM64.ActiveCfg = Release|ARM64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Release|ARM64.Build.0 = Release|ARM64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Release|Win32.ActiveCfg = Release|Win32 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Release|Win32.Build.0 = Release|Win32 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Release|x64.ActiveCfg = Release|x64 - {0F8262C1-75D8-4A92-BCB6-37A290891708}.Release|x64.Build.0 = Release|x64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Debug|ARM64.Build.0 = Debug|ARM64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Debug|Win32.ActiveCfg = Debug|Win32 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Debug|Win32.Build.0 = Debug|Win32 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Debug|x64.ActiveCfg = Debug|x64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Debug|x64.Build.0 = Debug|x64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Release|ARM64.ActiveCfg = Release|ARM64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Release|ARM64.Build.0 = Release|ARM64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Release|Win32.ActiveCfg = Release|Win32 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Release|Win32.Build.0 = Release|Win32 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Release|x64.ActiveCfg = Release|x64 - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A}.Release|x64.Build.0 = Release|x64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Debug|ARM64.Build.0 = Debug|ARM64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Debug|Win32.ActiveCfg = Debug|Win32 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Debug|Win32.Build.0 = Debug|Win32 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Debug|x64.ActiveCfg = Debug|x64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Debug|x64.Build.0 = Debug|x64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Release|ARM64.ActiveCfg = Release|ARM64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Release|ARM64.Build.0 = Release|ARM64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Release|Win32.ActiveCfg = Release|Win32 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Release|Win32.Build.0 = Release|Win32 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Release|x64.ActiveCfg = Release|x64 - {E31D1C4F-8E0D-428A-8583-5159CE690B33}.Release|x64.Build.0 = Release|x64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Debug|ARM64.Build.0 = Debug|ARM64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Debug|Win32.ActiveCfg = Debug|Win32 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Debug|Win32.Build.0 = Debug|Win32 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Debug|x64.ActiveCfg = Debug|x64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Debug|x64.Build.0 = Debug|x64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Release|ARM64.ActiveCfg = Release|ARM64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Release|ARM64.Build.0 = Release|ARM64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Release|Win32.ActiveCfg = Release|Win32 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Release|Win32.Build.0 = Release|Win32 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Release|x64.ActiveCfg = Release|x64 - {1893FA97-40A9-480F-BB77-279F959EAE6E}.Release|x64.Build.0 = Release|x64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Debug|ARM64.Build.0 = Debug|ARM64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Debug|Win32.ActiveCfg = Debug|Win32 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Debug|Win32.Build.0 = Debug|Win32 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Debug|x64.ActiveCfg = Debug|x64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Debug|x64.Build.0 = Debug|x64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Release|ARM64.ActiveCfg = Release|ARM64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Release|ARM64.Build.0 = Release|ARM64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Release|Win32.ActiveCfg = Release|Win32 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Release|Win32.Build.0 = Release|Win32 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Release|x64.ActiveCfg = Release|x64 - {23BA577F-B171-4CEC-92E0-49EE44564366}.Release|x64.Build.0 = Release|x64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Debug|ARM64.Build.0 = Debug|ARM64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Debug|Win32.ActiveCfg = Debug|Win32 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Debug|Win32.Build.0 = Debug|Win32 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Debug|x64.ActiveCfg = Debug|x64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Debug|x64.Build.0 = Debug|x64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Release|ARM64.ActiveCfg = Release|ARM64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Release|ARM64.Build.0 = Release|ARM64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Release|Win32.ActiveCfg = Release|Win32 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Release|Win32.Build.0 = Release|Win32 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Release|x64.ActiveCfg = Release|x64 - {C9C14C99-103E-45CB-B1B4-2C165429E35C}.Release|x64.Build.0 = Release|x64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Debug|ARM64.Build.0 = Debug|ARM64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Debug|Win32.ActiveCfg = Debug|Win32 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Debug|Win32.Build.0 = Debug|Win32 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Debug|x64.ActiveCfg = Debug|x64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Debug|x64.Build.0 = Debug|x64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Release|ARM64.ActiveCfg = Release|ARM64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Release|ARM64.Build.0 = Release|ARM64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Release|Win32.ActiveCfg = Release|Win32 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Release|Win32.Build.0 = Release|Win32 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Release|x64.ActiveCfg = Release|x64 - {8D542B56-EB45-43B1-AAB8-417352F5BDE6}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {3F637C27-BDFE-4466-838C-5FBDE4C5F2C1} = {199CBE46-0460-42FA-AB80-DD3C89310F4A} - {A51E3BEB-5868-445C-8F87-AC7D05C4EE2D} = {199CBE46-0460-42FA-AB80-DD3C89310F4A} - {8D891397-002B-4AF1-929E-0515D8F2F5AB} = {199CBE46-0460-42FA-AB80-DD3C89310F4A} - {413B0724-5117-4BD6-99EF-D6B59859E1B3} = {5234E3C1-1C0C-49A6-900E-EEC5815604BA} - {5234E3C1-1C0C-49A6-900E-EEC5815604BA} = {199CBE46-0460-42FA-AB80-DD3C89310F4A} - {A82FAF9C-BCCE-4569-9EB2-36DA4D239DA8} = {5234E3C1-1C0C-49A6-900E-EEC5815604BA} - {5452CCB0-EF39-4699-A8E0-C86D595FC4DA} = {5234E3C1-1C0C-49A6-900E-EEC5815604BA} - {8C5A07F5-C9E0-430D-A908-2C1161C952ED} = {5234E3C1-1C0C-49A6-900E-EEC5815604BA} - {8B19C579-DB40-4D8B-A605-165366FAB6CD} = {5234E3C1-1C0C-49A6-900E-EEC5815604BA} - {D804D2D8-5ED5-42B3-A77D-1A46D3ACB727} = {5234E3C1-1C0C-49A6-900E-EEC5815604BA} - {3904D25E-E461-4A90-A544-E1C74A32086A} = {5234E3C1-1C0C-49A6-900E-EEC5815604BA} - {4A7303D2-92DB-4537-A380-24D334FC24FE} = {5A68CA37-F621-4113-B573-8A361135203B} - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} = {3F637C27-BDFE-4466-838C-5FBDE4C5F2C1} - {42677515-C196-4C0F-99A2-F11E2FB55BF6} = {A51E3BEB-5868-445C-8F87-AC7D05C4EE2D} - {7441D7F2-F509-4A47-9404-3EB8653AE037} = {8D891397-002B-4AF1-929E-0515D8F2F5AB} - {0F8262C1-75D8-4A92-BCB6-37A290891708} = {413B0724-5117-4BD6-99EF-D6B59859E1B3} - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A} = {A82FAF9C-BCCE-4569-9EB2-36DA4D239DA8} - {E31D1C4F-8E0D-428A-8583-5159CE690B33} = {5452CCB0-EF39-4699-A8E0-C86D595FC4DA} - {1893FA97-40A9-480F-BB77-279F959EAE6E} = {8C5A07F5-C9E0-430D-A908-2C1161C952ED} - {23BA577F-B171-4CEC-92E0-49EE44564366} = {8B19C579-DB40-4D8B-A605-165366FAB6CD} - {C9C14C99-103E-45CB-B1B4-2C165429E35C} = {D804D2D8-5ED5-42B3-A77D-1A46D3ACB727} - {8D542B56-EB45-43B1-AAB8-417352F5BDE6} = {3904D25E-E461-4A90-A544-E1C74A32086A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {54F58964-376A-47BC-A813-559EFB1AB281} - EndGlobalSection -EndGlobal diff --git a/print/XPSDrvSmpl/install/xdCMYKPrinter.icc b/print/XPSDrvSmpl/install/xdCMYKPrinter.icc deleted file mode 100644 index 59c55ae6..00000000 Binary files a/print/XPSDrvSmpl/install/xdCMYKPrinter.icc and /dev/null differ diff --git a/print/XPSDrvSmpl/install/xdbook.gpd b/print/XPSDrvSmpl/install/xdbook.gpd deleted file mode 100644 index 8083ec45..00000000 --- a/print/XPSDrvSmpl/install/xdbook.gpd +++ /dev/null @@ -1,87 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xdbook.gpd -*% -*% Abstract: -*% -*% XPSDrv filter feature sample driver Booklet specific GPD settings. -*% - -*%****************************************************************************** -*% JobBindAllDocuments -*%****************************************************************************** -*Feature: JobBindAllDocuments -{ - *rcNameID: =IDS_GPD_JOBBINDING - *DefaultOption: None - - *Option: None - { - *rcNameID: =IDS_GPD_NONE - } - - *Option: BindLeft - { - *rcNameID: =IDS_GPD_LTOR - } - - *Option: BindRight - { - *rcNameID: =IDS_GPD_RTOL - } - - *Option: BindTop - { - *rcNameID: =IDS_GPD_TTOB - } - - *Option: BindBottom - { - *rcNameID: =IDS_GPD_BTOT - } -} - -*%****************************************************************************** -*% DocumentBinding -*%****************************************************************************** -*Feature: DocumentBinding -{ - *rcNameID: =IDS_GPD_DOCBIND - *DefaultOption: None - - *Option: None - { - *rcNameID: =IDS_GPD_NONE - } - - *Option: BindLeft - { - *rcNameID: =IDS_GPD_LTOR - } - - *Option: BindRight - { - *rcNameID: =IDS_GPD_RTOL - } - - *Option: BindTop - { - *rcNameID: =IDS_GPD_TTOB - } - - *Option: BindBottom - { - *rcNameID: =IDS_GPD_BTOT - } -} - diff --git a/print/XPSDrvSmpl/install/xdcolman.gpd b/print/XPSDrvSmpl/install/xdcolman.gpd deleted file mode 100644 index ea84c964..00000000 --- a/print/XPSDrvSmpl/install/xdcolman.gpd +++ /dev/null @@ -1,106 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xdcolman.gpd -*% -*% Abstract: -*% -*% XPSDrv filter feature sample driver Color Management specific GPD settings. -*% - -*%****************************************************************************** -*% PageColorManagement -*%****************************************************************************** -*Feature: PageColorManagement -{ - *rcNameID: =IDS_GPD_PAGECOLMAN - *DefaultOption: None - *PrintSchemaKeywordMap: "PageColorManagement" - - *Option: None - { - *rcNameID: =IDS_GPD_NONE - *PrintSchemaKeywordMap: "None" - } - - *Option: Device - { - *rcNameID: =IDS_GPD_DEVICE - *PrintSchemaKeywordMap: "Device" - } - - *Option: Driver - { - *rcNameID: =IDS_GPD_DRIVER - *PrintSchemaKeywordMap: "Driver" - } - - *Option: System - { - *rcNameID: =IDS_GPD_SYSTEM - *PrintSchemaKeywordMap: "System" - } -} - -*%****************************************************************************** -*% PageSourceColorProfile -*%****************************************************************************** -*Feature: PageSourceColorProfile -{ - *rcNameID: =IDS_GPD_SRCCOLPROF - *DefaultOption: CMYK - - *Option: CMYK - { - *rcNameID: =IDS_GPD_CMYK - } - - *Option: scRGB - { - *rcNameID: =IDS_GPD_SCRGB - } -} - -*%****************************************************************************** -*% PageICMRenderingIntent -*%****************************************************************************** -*Feature: PageICMRenderingIntent -{ - *rcNameID: =IDS_GPD_PAGEICMINTENT - *DefaultOption: AbsoluteColorimetric - *PrintSchemaKeywordMap: "PageICMRenderingIntent" - - *Option: AbsoluteColorimetric - { - *rcNameID: =IDS_GPD_ABSCOLINTENT - *PrintSchemaKeywordMap: "AbsoluteColorimetric" - } - - *Option: RelativeColorimetric - { - *rcNameID: =IDS_GPD_RELCOLINTENT - *PrintSchemaKeywordMap: "RelativeColorimetric" - } - - *Option: Photographs - { - *rcNameID: =IDS_GPD_PHOTOINTENT - *PrintSchemaKeywordMap: "Photographs" - } - - *Option: BusinessGraphics - { - *rcNameID: =IDS_GPD_BIZINTENT - *PrintSchemaKeywordMap: "BusinessGraphics" - } -} - diff --git a/print/XPSDrvSmpl/install/xdnames.gpd b/print/XPSDrvSmpl/install/xdnames.gpd deleted file mode 100644 index 0a45a313..00000000 --- a/print/XPSDrvSmpl/install/xdnames.gpd +++ /dev/null @@ -1,151 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xdnames.gpd -*% -*% Abstract: -*% -*% XPSDrv filter feature sample driver GPD resource names. -*% - -*CodePage: 1252 *% Windows 3.1 US (ANSI) code page - -*Feature: RESDLL -{ - *Name: "resource dll files" - *ConcealFromUI?: TRUE - - *Option: UniresDLL - { - *Name: "unires.dll" - } - *Option: xdsmplui - { - *Name: "xdsmplui.dll" - } -} - -*Macros: StdFeatureNames -{ - IDS_GPD_1PPS: RESDLL.xdsmplui.2000 - IDS_GPD_2PPS: RESDLL.xdsmplui.2001 - IDS_GPD_4PPS: RESDLL.xdsmplui.2002 - IDS_GPD_6PPS: RESDLL.xdsmplui.2003 - IDS_GPD_8PPS: RESDLL.xdsmplui.2004 - IDS_GPD_9PPS: RESDLL.xdsmplui.2005 - IDS_GPD_16PPS: RESDLL.xdsmplui.2006 - IDS_GPD_RES1200: RESDLL.xdsmplui.2007 - IDS_GPD_RES600: RESDLL.xdsmplui.2008 - IDS_GPD_AUTOMATIC: RESDLL.xdsmplui.2009 - IDS_GPD_BORDERED: RESDLL.xdsmplui.2010 - IDS_GPD_BORDERLESS: RESDLL.xdsmplui.2011 - IDS_GPD_BTOT: RESDLL.xdsmplui.2012 - IDS_GPD_BTOTLTOR: RESDLL.xdsmplui.2013 - IDS_GPD_BTOTRTOL: RESDLL.xdsmplui.2014 - IDS_GPD_CMYK: RESDLL.xdsmplui.2015 - IDS_GPD_COLOR: RESDLL.xdsmplui.2016 - IDS_GPD_CONFIDENTIAL: RESDLL.xdsmplui.2017 - IDS_GPD_CUSTSQUARE: RESDLL.xdsmplui.2018 - IDS_GPD_CUSTOM: RESDLL.xdsmplui.2019 - IDS_GPD_SRCCOLPROF: RESDLL.xdsmplui.2020 - IDS_GPD_DEVICE: RESDLL.xdsmplui.2021 - IDS_GPD_DOCBIND: RESDLL.xdsmplui.2022 - IDS_GPD_PAGECOLMAN: RESDLL.xdsmplui.2023 - IDS_GPD_PAGEPHOTINTENT: RESDLL.xdsmplui.2024 - IDS_GPD_DOCDUPLEX: RESDLL.xdsmplui.2025 - IDS_GPD_DOCNUP: RESDLL.xdsmplui.2026 - IDS_GPD_DOCNUPPRESENTORDER: RESDLL.xdsmplui.2027 - IDS_GPD_DRAFT: RESDLL.xdsmplui.2028 - IDS_GPD_DRIVER: RESDLL.xdsmplui.2029 - IDS_GPD_DUPLEX: RESDLL.xdsmplui.2030 - IDS_GPD_FAX: RESDLL.xdsmplui.2031 - IDS_GPD_FITBLEED: RESDLL.xdsmplui.2032 - IDS_GPD_FITCONTENT: RESDLL.xdsmplui.2033 - IDS_GPD_FITPAGE: RESDLL.xdsmplui.2034 - IDS_GPD_GLOSSY: RESDLL.xdsmplui.2035 - IDS_GPD_GRAYSCALE: RESDLL.xdsmplui.2036 - IDS_GPD_HIGH: RESDLL.xdsmplui.2037 - IDS_GPD_HORIZONTAL: RESDLL.xdsmplui.2038 - IDS_GPD_JOBBINDING: RESDLL.xdsmplui.2039 - IDS_GPD_JOBNUPPRESENTORDER: RESDLL.xdsmplui.2040 - IDS_GPD_JOBNUP: RESDLL.xdsmplui.2041 - IDS_GPD_JOBPAGEORDER: RESDLL.xdsmplui.2042 - IDS_GPD_LANDSCAPE: RESDLL.xdsmplui.2043 - IDS_GPD_LTOR: RESDLL.xdsmplui.2044 - IDS_GPD_LTORBTOT: RESDLL.xdsmplui.2045 - IDS_GPD_LTORTTOB: RESDLL.xdsmplui.2046 - IDS_GPD_MEDIATYPE: RESDLL.xdsmplui.2047 - IDS_GPD_MONO: RESDLL.xdsmplui.2048 - IDS_GPD_NONE: RESDLL.xdsmplui.2049 - IDS_GPD_NORMAL: RESDLL.xdsmplui.2050 - IDS_GPD_OFF: RESDLL.xdsmplui.2051 - IDS_GPD_ON: RESDLL.xdsmplui.2052 - IDS_GPD_ORIENATION: RESDLL.xdsmplui.2053 - IDS_GPD_OVERLAYED: RESDLL.xdsmplui.2054 - IDS_GPD_PAGEBORDER: RESDLL.xdsmplui.2055 - IDS_GPD_PAGEQUALITY: RESDLL.xdsmplui.2056 - IDS_GPD_PAGESCALING: RESDLL.xdsmplui.2057 - IDS_GPD_PAPERSOURCE: RESDLL.xdsmplui.2058 - IDS_GPD_PHOTOGRAPHIC: RESDLL.xdsmplui.2059 - IDS_GPD_PORTRAIT: RESDLL.xdsmplui.2060 - IDS_GPD_RASTERIMAGE: RESDLL.xdsmplui.2061 - IDS_GPD_RESOLUTION: RESDLL.xdsmplui.2062 - IDS_GPD_REVERSELANDSCAPE: RESDLL.xdsmplui.2063 - IDS_GPD_REVERSE: RESDLL.xdsmplui.2064 - IDS_GPD_RTOL: RESDLL.xdsmplui.2065 - IDS_GPD_RTOLBTOT: RESDLL.xdsmplui.2066 - IDS_GPD_RTOLTTOB: RESDLL.xdsmplui.2067 - IDS_GPD_SCALEPAGETOPAGE: RESDLL.xdsmplui.2068 - IDS_GPD_SCRGB: RESDLL.xdsmplui.2069 - IDS_GPD_STANDARD: RESDLL.xdsmplui.2070 - IDS_GPD_TEXT: RESDLL.xdsmplui.2071 - IDS_GPD_TTOB: RESDLL.xdsmplui.2072 - IDS_GPD_TTOBLTOR: RESDLL.xdsmplui.2073 - IDS_GPD_TTOBRTOL: RESDLL.xdsmplui.2074 - IDS_GPD_TRANSPARENCY: RESDLL.xdsmplui.2075 - IDS_GPD_TRANSPARENT: RESDLL.xdsmplui.2076 - IDS_GPD_UNDERLAYED: RESDLL.xdsmplui.2077 - IDS_GPD_UPPER: RESDLL.xdsmplui.2078 - IDS_GPD_VECTORIMAGE: RESDLL.xdsmplui.2079 - IDS_GPD_VERTICAL: RESDLL.xdsmplui.2080 - IDS_GPD_WATERMARKLAYERING: RESDLL.xdsmplui.2081 - IDS_GPD_WATERMARKTEXT: RESDLL.xdsmplui.2082 - IDS_GPD_WATERMARKTYPE: RESDLL.xdsmplui.2083 - IDS_GPD_WATERMARKBITMAP: RESDLL.xdsmplui.2084 - IDS_GPD_WATERMARKGRAPHIC: RESDLL.xdsmplui.2087 - IDS_GPD_BEST: RESDLL.xdsmplui.2090 - IDS_GPD_PAGEICMINTENT: RESDLL.xdsmplui.2091 - IDS_GPD_ABSCOLINTENT: RESDLL.xdsmplui.2092 - IDS_GPD_RELCOLINTENT: RESDLL.xdsmplui.2093 - IDS_GPD_PHOTOINTENT: RESDLL.xdsmplui.2094 - IDS_GPD_BIZINTENT: RESDLL.xdsmplui.2095 - IDS_GPD_SYSTEM: RESDLL.xdsmplui.2096 - IDS_GPD_WATERMARKTEXTCOLOR: RESDLL.xdsmplui.2097 - IDS_GPD_RED: RESDLL.xdsmplui.2098 - IDS_GPD_GREEN: RESDLL.xdsmplui.2099 - IDS_GPD_BLUE: RESDLL.xdsmplui.2100 - IDS_GPD_MAGENTA: RESDLL.xdsmplui.2101 - IDS_GPD_CYAN: RESDLL.xdsmplui.2102 - IDS_GPD_YELLOW: RESDLL.xdsmplui.2103 - IDS_GPD_BLACK: RESDLL.xdsmplui.2104 - IDS_GPD_SCALE_ALIGN: RESDLL.xdsmplui.2105 - IDS_GPD_SCALE_ALIGN_BC: RESDLL.xdsmplui.2106 - IDS_GPD_SCALE_ALIGN_BL: RESDLL.xdsmplui.2107 - IDS_GPD_SCALE_ALIGN_BR: RESDLL.xdsmplui.2108 - IDS_GPD_SCALE_ALIGN_CC: RESDLL.xdsmplui.2109 - IDS_GPD_SCALE_ALIGN_LC: RESDLL.xdsmplui.2110 - IDS_GPD_SCALE_ALIGN_CR: RESDLL.xdsmplui.2111 - IDS_GPD_SCALE_ALIGN_CT: RESDLL.xdsmplui.2112 - IDS_GPD_SCALE_ALIGN_TL: RESDLL.xdsmplui.2113 - IDS_GPD_SCALE_ALIGN_TR: RESDLL.xdsmplui.2114 -} - diff --git a/print/XPSDrvSmpl/install/xdnup.gpd b/print/XPSDrvSmpl/install/xdnup.gpd deleted file mode 100644 index 2f846dae..00000000 --- a/print/XPSDrvSmpl/install/xdnup.gpd +++ /dev/null @@ -1,207 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xdnup.gpd -*% -*% Abstract: -*% -*% XPSDrv filter feature sample driver NUp specific GPD settings. -*% - -*%****************************************************************************** -*% JobNUpAllDocumentsContiguously -*%****************************************************************************** -*Feature: JobNUpAllDocumentsContiguously -{ - *rcNameID: =IDS_GPD_JOBNUP - *DefaultOption: 1 - *PrintSchemaKeywordMap: "JobNUpAllDocumentsContiguously" - - *Option: 1 - { - *rcNameID: =IDS_GPD_1PPS - } - - *Option: 2 - { - *rcNameID: =IDS_GPD_2PPS - } - - *Option: 4 - { - *rcNameID: =IDS_GPD_4PPS - } - - *Option: 6 - { - *rcNameID: =IDS_GPD_6PPS - } - - *Option: 8 - { - *rcNameID: =IDS_GPD_8PPS - } - - *Option: 9 - { - *rcNameID: =IDS_GPD_9PPS - } - - *Option: 16 - { - *rcNameID: =IDS_GPD_16PPS - } -} - -*%****************************************************************************** -*% JobNUpContiguouslyPresentationOrder -*%****************************************************************************** -*Feature: JobNUpContiguouslyPresentationOrder -{ - *rcNameID: =IDS_GPD_JOBNUPPRESENTORDER - *DefaultOption: RightBottom - - *Option: RightBottom - { - *rcNameID: =IDS_GPD_LTORTTOB - } - - *Option: BottomRight - { - *rcNameID: =IDS_GPD_TTOBLTOR - } - - *Option: LeftBottom - { - *rcNameID: =IDS_GPD_RTOLTTOB - } - - *Option: BottomLeft - { - *rcNameID: =IDS_GPD_TTOBRTOL - } - - *Option: RightTop - { - *rcNameID: =IDS_GPD_LTORBTOT - } - - *Option: TopRight - { - *rcNameID: =IDS_GPD_BTOTLTOR - } - - *Option: LeftTop - { - *rcNameID: =IDS_GPD_RTOLBTOT - } - - *Option: TopLeft - { - *rcNameID: =IDS_GPD_BTOTRTOL - } -} - -*%****************************************************************************** -*% DocumentNUp -*%****************************************************************************** -*Feature: DocumentNUp -{ - *rcNameID: =IDS_GPD_DOCNUP - *DefaultOption: 1 - *PrintSchemaKeywordMap: "DocumentNUp" - - *Option: 1 - { - *rcNameID: =IDS_GPD_1PPS - } - - *Option: 2 - { - *rcNameID: =IDS_GPD_2PPS - } - - *Option: 4 - { - *rcNameID: =IDS_GPD_4PPS - } - - *Option: 6 - { - *rcNameID: =IDS_GPD_6PPS - } - - *Option: 8 - { - *rcNameID: =IDS_GPD_8PPS - } - - *Option: 9 - { - *rcNameID: =IDS_GPD_9PPS - } - - *Option: 16 - { - *rcNameID: =IDS_GPD_16PPS - } -} - -*%****************************************************************************** -*% DocumentNUpPresentationOrder -*%****************************************************************************** -*Feature: DocumentNUpPresentationOrder -{ - *rcNameID: =IDS_GPD_DOCNUPPRESENTORDER - *DefaultOption: RightBottom - - *Option: RightBottom - { - *rcNameID: =IDS_GPD_LTORTTOB - } - - *Option: BottomRight - { - *rcNameID: =IDS_GPD_TTOBLTOR - } - - *Option: LeftBottom - { - *rcNameID: =IDS_GPD_RTOLTTOB - } - - *Option: BottomLeft - { - *rcNameID: =IDS_GPD_TTOBRTOL - } - - *Option: RightTop - { - *rcNameID: =IDS_GPD_LTORBTOT - } - - *Option: TopRight - { - *rcNameID: =IDS_GPD_BTOTLTOR - } - - *Option: LeftTop - { - *rcNameID: =IDS_GPD_RTOLBTOT - } - - *Option: TopLeft - { - *rcNameID: =IDS_GPD_BTOTRTOL - } -} - diff --git a/print/XPSDrvSmpl/install/xdpgscl.gpd b/print/XPSDrvSmpl/install/xdpgscl.gpd deleted file mode 100644 index bacef11c..00000000 --- a/print/XPSDrvSmpl/install/xdpgscl.gpd +++ /dev/null @@ -1,117 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xdpgscl.gpd -*% -*% Abstract: -*% -*% XPSDrv filter feature sample driver page scaling specific GPD settings. -*% - -*%****************************************************************************** -*% PageScaling -*%****************************************************************************** -*Feature: PageScaling -{ - *rcNameID: =IDS_GPD_PAGESCALING - *DefaultOption: None - - *Option: None - { - *rcNameID: =IDS_GPD_NONE - } - - *Option: Custom - { - *rcNameID: =IDS_GPD_CUSTOM - } - - *Option: CustomSquare - { - *rcNameID: =IDS_GPD_CUSTSQUARE - } - - *Option: FitApplicationBleedSizeToPageImageableSize - { - *rcNameID: =IDS_GPD_FITBLEED - } - - *Option: FitApplicationContentSizeToPageImageableSize - { - *rcNameID: =IDS_GPD_FITCONTENT - } - - *Option: FitApplicationMediaSizeToPageImageableSize - { - *rcNameID: =IDS_GPD_FITPAGE - } - - *Option: FitApplicationMediaSizeToPageMediaSize - { - *rcNameID: =IDS_GPD_SCALEPAGETOPAGE - } -} - -*%****************************************************************************** -*% ScaleOffsetAlignment -*%****************************************************************************** -*Feature: ScaleOffsetAlignment -{ - *rcNameID: =IDS_GPD_SCALE_ALIGN - *DefaultOption: Center - - *Option: BottomCenter - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_BC - } - - *Option: BottomLeft - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_BL - } - - *Option: BottomRight - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_BR - } - - *Option: Center - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_CC - } - - *Option: LeftCenter - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_LC - } - - *Option: RightCenter - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_CR - } - - *Option: TopCenter - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_CT - } - - *Option: TopLeft - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_TL - } - - *Option: TopRight - { - *rcNameID: =IDS_GPD_SCALE_ALIGN_TR - } -} - diff --git a/print/XPSDrvSmpl/install/xdsmpl-PipelineConfig.xml b/print/XPSDrvSmpl/install/xdsmpl-PipelineConfig.xml deleted file mode 100644 index b649032a..00000000 --- a/print/XPSDrvSmpl/install/xdsmpl-PipelineConfig.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/print/XPSDrvSmpl/install/xdsmpl.gpd b/print/XPSDrvSmpl/install/xdsmpl.gpd deleted file mode 100644 index 2ad72e6a..00000000 --- a/print/XPSDrvSmpl/install/xdsmpl.gpd +++ /dev/null @@ -1,467 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xdsmpl.gpd -*% -*% Abstract: -*% -*% XPSDrv filter feature sample driver main GPD file. -*% - -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*GPDFileName: "XDSmpl.gpd" -*Include: "msxpsinc.gpd" -*Include: "StdNames.gpd" -*Include: "xdnames.gpd" -*Include: "xdwmark.gpd" -*Include: "xdbook.gpd" -*Include: "xdcolman.gpd" -*Include: "xdnup.gpd" -*Include: "xdpgscl.gpd" -*ModelName: "XPSDrv Sample Driver" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 1 - -*%****************************************************************************** -*% PageMediaSize - Paper Size -*%****************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - - *Option: A3 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 9667 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(13460, 19440) - *PrintableOrigin: PAIR(284, 200) - *CursorOrigin: PAIR(284, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(13628, 19368) - *PrintableOrigin: PAIR(200, 236) - *CursorOrigin: PAIR(200, 19604) - } - } - } - - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9352, 13628) - *PrintableOrigin: PAIR(284, 200) - *CursorOrigin: PAIR(284, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(9520, 13556) - *PrintableOrigin: PAIR(200, 236) - *CursorOrigin: PAIR(200, 13792) - } - } - } - - *Option: B4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 6391 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(11572, 16796) - *PrintableOrigin: PAIR(284, 200) - *CursorOrigin: PAIR(284, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(11740, 16724) - *PrintableOrigin: PAIR(200, 236) - *CursorOrigin: PAIR(200, 16960) - } - } - } - - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - } - } - } - - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - } - } - } - - *Option: ENV_10 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(4348, 11000) - *PrintableOrigin: PAIR(300, 200) - *CursorOrigin: PAIR(300, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(4548, 10920) - *PrintableOrigin: PAIR(200, 240) - *CursorOrigin: PAIR(200, 11160) - } - } - } - - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - } - } - } - - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - } - } - } - - *Option: ENV_MONARCH - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(4048, 8600) - *PrintableOrigin: PAIR(300, 200) - *CursorOrigin: PAIR(300, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(4248, 8520) - *PrintableOrigin: PAIR(200, 240) - *CursorOrigin: PAIR(200, 8760) - } - } - } - - *Option: TABLOID - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(12000, 19200) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(400, 400) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(12000, 19200) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(400, 18000) - } - } - } -} - -*%****************************************************************************** -*% PageOrientation -*%****************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - } - - *Option: LANDSCAPE_CC270 - { - *rcNameID: =LANDSCAPE_DISPLAY - } -} - -*%****************************************************************************** -*% PageOutputColor -*%****************************************************************************** -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *DefaultOption: Color - - *Option: Mono - { - *rcNameID: =MONO_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 1 - *Color?: FALSE - } - - *Option: Grayscale - { - *rcNameID: =8BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 8 - *DrvBPP: 8 - *PaletteSize: 256 - *Color?: FALSE - } - - *Option: Color - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 - *PaletteSize: 1 - } -} - -*%****************************************************************************** -*% Resolution -*%****************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: DPI600 - - *Option: DPI600 - { - *Name: "600 x 600 " =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - } - - *Option: DPI1200 - { - *Name: "1200 x 1200 " =DOTS_PER_INCH - *DPI: PAIR(1200, 1200) - *TextDPI: PAIR(1200, 1200) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - } -} - -*%****************************************************************************** -*% Input Bin -*%****************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: UPPER - *ConcealFromUI?: TRUE - - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - } -} - -*%****************************************************************************** -*% DocumentDuplex -*%****************************************************************************** -*Feature: DocumentDuplex -{ - *rcNameID: =IDS_GPD_DOCDUPLEX - *DefaultOption: None - *PrintSchemaKeywordMap: "DocumentDuplex" - - *Option: None - { - *rcNameID: =IDS_GPD_NONE - *PrintSchemaKeywordMap: "OneSided" - } - - *Option: Horizontal - { - *rcNameID: =IDS_GPD_HORIZONTAL - *PrintSchemaKeywordMap: "TwoSidedLongEdge" - } - - *Option: Vertical - { - *rcNameID: =IDS_GPD_VERTICAL - *PrintSchemaKeywordMap: "TwoSidedShortEdge" - } -} - -*%****************************************************************************** -*% PagePhotoPrintingIntent -*%****************************************************************************** -*Feature: PagePhotoPrintingIntent -{ - *rcNameID: =IDS_GPD_PAGEPHOTINTENT - *DefaultOption: None - *PrintSchemaKeywordMap: "PagePhotoPrintingIntent" - - *Option: None - { - *rcNameID: =IDS_GPD_NONE - *PrintSchemaKeywordMap: "None" - } - - *Option: PhotoBest - { - *rcNameID: =IDS_GPD_BEST - *PrintSchemaKeywordMap: "PhotoBest" - } - - *Option: PhotoDraft - { - *rcNameID: =IDS_GPD_DRAFT - *PrintSchemaKeywordMap: "PhotoDraft" - } - - *Option: PhotoStandard - { - *rcNameID: =IDS_GPD_STANDARD - *PrintSchemaKeywordMap: "PhotoStandard" - } -} - -*%****************************************************************************** -*% PageBorderless -*%****************************************************************************** -*Feature: PageBorderless -{ - *rcNameID: =IDS_GPD_PAGEBORDER - *DefaultOption: Borderless - *PrintSchemaKeywordMap: "PageBorderless" - - *Option: None - { - *rcNameID: =IDS_GPD_BORDERED - *PrintSchemaKeywordMap: "None" - } - - *Option: Borderless - { - *rcNameID: =IDS_GPD_BORDERLESS - *PrintSchemaKeywordMap: "Borderless" - } -} - - -*%****************************************************************************** -*% Printer Memory -*%****************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 32768KB - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } -} - -*%****************************************************************************** -*% Cursor Commands -*%****************************************************************************** -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } - diff --git a/print/XPSDrvSmpl/install/xdsmpl.inf b/print/XPSDrvSmpl/install/xdsmpl.inf deleted file mode 100644 index e696a264..00000000 Binary files a/print/XPSDrvSmpl/install/xdsmpl.inf and /dev/null differ diff --git a/print/XPSDrvSmpl/install/xdsmpl.ini b/print/XPSDrvSmpl/install/xdsmpl.ini deleted file mode 100644 index d9e17f2c..00000000 --- a/print/XPSDrvSmpl/install/xdsmpl.ini +++ /dev/null @@ -1,22 +0,0 @@ -; -; Copyright (c) 2005 Microsoft Corporation -; -; All rights reserved. -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; File Name: -; -; xdsmpl.ini -; -; Abstract: -; -; XPSDrv sample driver configuration file for UI plug-in. -; - -[OEMFiles] -OEMConfigFile1=xdsmplui.DLL - diff --git a/print/XPSDrvSmpl/install/xdwmark.gpd b/print/XPSDrvSmpl/install/xdwmark.gpd deleted file mode 100644 index cf1802d8..00000000 --- a/print/XPSDrvSmpl/install/xdwmark.gpd +++ /dev/null @@ -1,67 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xdwmark.gpd -*% -*% Abstract: -*% -*% XPSDrv filter feature sample driver watermark specific GPD settings. -*% - -*%****************************************************************************** -*% PageWatermark -*%****************************************************************************** -*Feature: PageWatermarkType -{ - *rcNameID: =IDS_GPD_WATERMARKTYPE - *DefaultOption: None - - *Option: None - { - *rcNameID: =IDS_GPD_NONE - } - - *Option: Text - { - *rcNameID: =IDS_GPD_TEXT - } - - *Option: Raster - { - *rcNameID: =IDS_GPD_RASTERIMAGE - } - - *Option: Vector - { - *rcNameID: =IDS_GPD_VECTORIMAGE - } -} - -*%****************************************************************************** -*% PageWatermarkLayering -*%****************************************************************************** -*Feature: PageWatermarkLayering -{ - *rcNameID: =IDS_GPD_WATERMARKLAYERING - *DefaultOption: Overlay - - *Option: Overlay - { - *rcNameID: =IDS_GPD_OVERLAYED - } - - *Option: Underlay - { - *rcNameID: =IDS_GPD_UNDERLAYED - } -} - diff --git a/print/XPSDrvSmpl/install/xdwscRGB.icc b/print/XPSDrvSmpl/install/xdwscRGB.icc deleted file mode 100644 index b1e6845d..00000000 Binary files a/print/XPSDrvSmpl/install/xdwscRGB.icc and /dev/null differ diff --git a/print/XPSDrvSmpl/src/common/bkdata.h b/print/XPSDrvSmpl/src/common/bkdata.h deleted file mode 100644 index dae29cf2..00000000 --- a/print/XPSDrvSmpl/src/common/bkdata.h +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkdata.h - -Abstract: - - Booklet data structure definition. This provides a convenient description - of the PrintSchema JobBindAllDocuments and DcoumentBinding features. - ---*/ - -#pragma once - -#include "bkschema.h" - -namespace XDPrintSchema -{ - namespace Binding - { - struct BindingData - { - BindingData() : - bindFeature(JobBindAllDocuments), - bindOption(None), - bindGutter(0) - { - } - - EBinding bindFeature; - EBindingOption bindOption; - INT bindGutter; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/bkpchndlr.cpp b/print/XPSDrvSmpl/src/common/bkpchndlr.cpp deleted file mode 100644 index 1ce57acf..00000000 --- a/print/XPSDrvSmpl/src/common/bkpchndlr.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkpchndlr.cpp - -Abstract: - - Booklet PrintCapabilities handling implementation. The booklet PC handler - is used to set booklet settings in a PrintCapabilities document. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdexcept.h" -#include "bkpchndlr.h" -#include "globals.h" -#include "privatedefs.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::Binding::EBinding; -using XDPrintSchema::Binding::EBindingMin; -using XDPrintSchema::Binding::EBindingMax; -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::EBindingOptionMin; -using XDPrintSchema::Binding::EBindingOptionMax; -using XDPrintSchema::Binding::BIND_FEATURES; -using XDPrintSchema::Binding::BIND_OPTIONS; - -/*++ - -Routine Name: - - CBookPCHandler::CBookPCHandler - -Routine Description: - - CBookPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CBookPCHandler::CBookPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CBookPCHandler::~CBookPCHandler - -Routine Description: - - CBookPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookPCHandler::~CBookPCHandler() -{ -} - -/*++ - -Routine Name: - - CBookPCHandler::SetCapabilities - -Routine Description: - - This routine sets booklet capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - for (EBinding bindFeatures = EBindingMin; - bindFeatures < EBindingMax && SUCCEEDED(hr); - bindFeatures = static_cast(bindFeatures + 1)) - { - CComPtr pFeatureElement(NULL); - - if (SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(BIND_FEATURES[bindFeatures]), NULL, &pFeatureElement))) - { - PTDOMElementVector optionList; - - for (EBindingOption bindOption = EBindingOptionMin; - bindOption < EBindingOptionMax && SUCCEEDED(hr); - bindOption = static_cast(bindOption + 1)) - { - // - // Create the booklet options - // - CComPtr pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(BIND_OPTIONS[bindOption]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options into the booklet feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pFeatureElement->appendChild(*iterOptionList, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pFeatureElement, NULL); - } - } - - for (UINT cIndex = 0; cIndex < numof(bkParamDefIntegers); cIndex++) - { - CComPtr pParameterDef(NULL); - - if (SUCCEEDED(hr = CreateIntParameterDef(CComBSTR(bkParamDefIntegers[cIndex].property_name), // Paramater Name - bkParamDefIntegers[cIndex].is_public, // Is Print Schema keyword? - CComBSTR(bkParamDefIntegers[cIndex].display_name), // Display Text - bkParamDefIntegers[cIndex].default_value, // Default - bkParamDefIntegers[cIndex].min_length, // Min Length - bkParamDefIntegers[cIndex].max_length, // Max Length - bkParamDefIntegers[cIndex].multiple, // Multiple - CComBSTR(bkParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/bkpchndlr.h b/print/XPSDrvSmpl/src/common/bkpchndlr.h deleted file mode 100644 index 46d65138..00000000 --- a/print/XPSDrvSmpl/src/common/bkpchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkpchndlr.h - -Abstract: - - Booklet PrintCapabilities handling definition. The booklet PC handler - is used to set booklet settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "bkdata.h" - -class CBookPCHandler : public CPCHandler -{ -public: - CBookPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CBookPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/bkpthndlr.cpp b/print/XPSDrvSmpl/src/common/bkpthndlr.cpp deleted file mode 100644 index 46fb54b6..00000000 --- a/print/XPSDrvSmpl/src/common/bkpthndlr.cpp +++ /dev/null @@ -1,318 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkpthndlr.cpp - -Abstract: - - Booklet PrintTicket handling implementation. The booklet PT handler - is used to extract booklet settings from a PrintTicket and populate - the booklet data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "bkpthndlr.h" - -using XDPrintSchema::PRINTTICKET_NAME; - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::EBinding; -using XDPrintSchema::Binding::EBindingMin; -using XDPrintSchema::Binding::EBindingMax; -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::EBindingOptionMin; -using XDPrintSchema::Binding::EBindingOptionMax; -using XDPrintSchema::Binding::BIND_FEATURES; -using XDPrintSchema::Binding::BIND_OPTIONS; -using XDPrintSchema::Binding::BIND_PROP; -using XDPrintSchema::Binding::BIND_PROP_REF_SUFFIX; - -/*++ - -Routine Name: - - CBookPTHandler::CBookPTHandler - -Routine Description: - - CBookPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CBookPTHandler::CBookPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CBookPTHandler::~CBookPTHandler - -Routine Description: - - CBookPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookPTHandler::~CBookPTHandler() -{ -} - -/*++ - -Routine Name: - - CBookPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with binding data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pBindData - Pointer to the binding data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CBookPTHandler::GetData( - _Out_ BindingData* pBindData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBindData, E_POINTER))) - { - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax; - bindFeature = static_cast(bindFeature + 1)) - { - CComBSTR bstrBindOption; - CComBSTR bstrFeature(BIND_FEATURES[bindFeature]); - - if (SUCCEEDED(hr = GetFeatureOption(bstrFeature, &bstrBindOption))) - { - pBindData->bindFeature = bindFeature; - - // - // Identify the option - // - for (EBindingOption bindOption = EBindingOptionMin; - bindOption < EBindingOptionMax; - bindOption = static_cast(bindOption + 1)) - { - if (bstrBindOption == BIND_OPTIONS[bindOption]) - { - pBindData->bindOption = bindOption; - break; - } - } - - // - // Get the gutter value if one exists otherwise use a default - // - if (FAILED(GetScoredPropertyValue(bstrFeature, CComBSTR(BIND_PROP), &pBindData->bindGutter))) - { - pBindData->bindGutter = 0; - } - - break; - } - else if (hr != E_ELEMENT_NOT_FOUND) - { - // - // We have an error other than the element is not present - // so we break and let the result return - // - break; - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pBindData->bindFeature < EBindingMin || - pBindData->bindFeature >= EBindingMax || - pBindData->bindOption < EBindingOptionMin || - pBindData->bindOption >= EBindingOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CBookPTHandler::SetData - -Routine Description: - - This routine sets the binding data in the PrintTicket passed to the - class constructor. - -Arguments: - - pBindData - Pointer to the binding data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookPTHandler::SetData( - _In_ CONST BindingData* pBindData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBindData, E_POINTER))) - { - if (pBindData->bindFeature < EBindingMin || - pBindData->bindFeature >= EBindingMax || - pBindData->bindOption < EBindingOptionMin || - pBindData->bindOption >= EBindingOptionMax) - { - hr = E_INVALIDARG; - } - } - - // - // Delete any exsting NUp settings as JobNUpAllDocumentsContiguously and DocumentNUp are mutually exclusive - // - if (SUCCEEDED(hr) && - pBindData->bindOption != XDPrintSchema::Binding::None) - { - // - // Create the following elements - // Feature and Option - // Parameter Ref and Parameter Init - // ScoredProperty - // - // Then append the scored property to the option node and the feature - // and parameter init nodes to the root PrintTicket node. Note: the - // scored poperty is created passing the parameter ref so it is already - // appended - // - CComPtr pFeature(NULL); - CComPtr pOption(NULL); - CComPtr pParamRef(NULL); - CComPtr pParamInit(NULL); - CComPtr pScoredProp(NULL); - - CComBSTR bstrFeature(BIND_FEATURES[pBindData->bindFeature]); - - if (SUCCEEDED(DeleteFeature(bstrFeature))) - { - CComBSTR bstrPropName(BIND_PROP_REF_SUFFIX); - CComBSTR bstrParamRefName(bstrFeature); - bstrParamRefName += bstrPropName; - - if (SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeature, - CComBSTR(BIND_OPTIONS[pBindData->bindOption]), - &pFeature, - &pOption)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrParamRefName, pBindData->bindGutter, &pParamRef, &pParamInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(BIND_PROP), pParamRef, &pScoredProp)) && - SUCCEEDED(hr = pOption->appendChild(pScoredProp, NULL)) && - SUCCEEDED(hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pFeature))) - { - hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pParamInit); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookPTHandler::Delete - -Routine Description: - - This routine deletes the binding feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookPTHandler::Delete( - VOID - ) -{ - HRESULT hr = S_OK; - - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax && SUCCEEDED(hr); - bindFeature = static_cast(bindFeature + 1)) - { - hr = DeleteFeature(CComBSTR(BIND_FEATURES[bindFeature])); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/bkpthndlr.h b/print/XPSDrvSmpl/src/common/bkpthndlr.h deleted file mode 100644 index abd5ef9d..00000000 --- a/print/XPSDrvSmpl/src/common/bkpthndlr.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkpthndlr.h - -Abstract: - - Booklet PrintTicket handling definition. The booklet PT handler - is used to extract booklet settings from a PrintTicket and populate - the booklet data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "bkdata.h" - -class CBookPTHandler : public CPTHandler -{ -public: - CBookPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CBookPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::Binding::BindingData* pBindData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::Binding::BindingData* pBindData - ); - - HRESULT - Delete( - VOID - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/bkschema.cpp b/print/XPSDrvSmpl/src/common/bkschema.cpp deleted file mode 100644 index daa26254..00000000 --- a/print/XPSDrvSmpl/src/common/bkschema.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkschema.cpp - -Abstract: - - Binding (booklet) PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema JobBindAllDocuments and - DocumentBinding features. - ---*/ - -#include "precomp.h" -#include "bkschema.h" - -LPCWSTR XDPrintSchema::Binding::BIND_FEATURES[] = { - L"JobBindAllDocuments", - L"DocumentBinding" -}; - -LPCWSTR XDPrintSchema::Binding::BIND_OPTIONS[] = { - L"Bale", - L"BindBottom", - L"BindLeft", - L"BindRight", - L"BindTop", - L"Booklet", - L"EdgeStitchBottom", - L"EdgeStitchLeft", - L"EdgeStitchRight", - L"EdgeStitchTop", - L"Fold", - L"JogOffset", - L"Trim", - L"None" -}; - -LPCWSTR XDPrintSchema::Binding::BIND_PROP = L"BindingGutter"; -LPCWSTR XDPrintSchema::Binding::BIND_PROP_REF_SUFFIX = L"Gutter"; - diff --git a/print/XPSDrvSmpl/src/common/bkschema.h b/print/XPSDrvSmpl/src/common/bkschema.h deleted file mode 100644 index bcf68df2..00000000 --- a/print/XPSDrvSmpl/src/common/bkschema.h +++ /dev/null @@ -1,77 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkschema.h - -Abstract: - - Binding (booklet) PrintSchema definition. This defines the features, - options and enumerations that describe the PrintSchema JobBindAllDocuments and - DocumentBinding features within a XDPrintSchema::Binding namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // Binding elements described as Printschema keywords - // - namespace Binding - { - // - // Job and Document share identical options so we define two - // features within the Binding namespace. - // - enum EBinding - { - JobBindAllDocuments = 0, EBindingMin = 0, - DocumentBinding, - EBindingMax - }; - - extern LPCWSTR BIND_FEATURES[EBindingMax]; - - // - // Option names - // - enum EBindingOption - { - Bale = 0, EBindingOptionMin = 0, - BindBottom, - BindLeft, - BindRight, - BindTop, - Booklet, - EdgeStitchBottom, - EdgeStitchLeft, - EdgeStitchRight, - EdgeStitchTop, - Fold, - JogOffset, - Trim, - None, - EBindingOptionMax - }; - - extern LPCWSTR BIND_OPTIONS[EBindingOptionMax]; - - extern LPCWSTR BIND_PROP; - - extern LPCWSTR BIND_PROP_REF_SUFFIX; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmdata.h b/print/XPSDrvSmpl/src/common/cmdata.h deleted file mode 100644 index 7b2dcb7f..00000000 --- a/print/XPSDrvSmpl/src/common/cmdata.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmdata.h - -Abstract: - - PageColorManagement data structure definition. This provides a convenient - description of the PrintSchema PageColorManagement feature. - ---*/ - -#pragma once - -#include "cmschema.h" - -namespace XDPrintSchema -{ - namespace PageColorManagement - { - struct ColorManagementData - { - ColorManagementData() : - cmOption(None) - { - } - - EPCMOption cmOption; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmintentsdata.h b/print/XPSDrvSmpl/src/common/cmintentsdata.h deleted file mode 100644 index f9fa2c20..00000000 --- a/print/XPSDrvSmpl/src/common/cmintentsdata.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmintentsdata.h - -Abstract: - - PageICMRenderingIntent data structure definition. This provides a more - convenient description of the PrintSchema PageICMRenderingIntent feature. - ---*/ - -#pragma once - -#include "cmintentsschema.h" - -namespace XDPrintSchema -{ - namespace PageICMRenderingIntent - { - struct PageICMRenderingIntentData - { - PageICMRenderingIntentData() : - cmOption(AbsoluteColorimetric) - { - } - - EICMIntentOption cmOption; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmintentsschema.cpp b/print/XPSDrvSmpl/src/common/cmintentsschema.cpp deleted file mode 100644 index 1b68de7b..00000000 --- a/print/XPSDrvSmpl/src/common/cmintentsschema.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmintentsschema.cpp - -Abstract: - - PageICMRenderingIntent PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageICMRenderingIntent feature. - ---*/ - -#include "precomp.h" -#include "cmintentsschema.h" - -LPCWSTR XDPrintSchema::PageICMRenderingIntent::ICMINTENT_FEATURE = L"PageICMRenderingIntent"; - -LPCWSTR XDPrintSchema::PageICMRenderingIntent::ICMINTENT_OPTIONS[] = { - L"AbsoluteColorimetric", - L"RelativeColorimetric", - L"Photographs", - L"BusinessGraphics" -}; - diff --git a/print/XPSDrvSmpl/src/common/cmintentsschema.h b/print/XPSDrvSmpl/src/common/cmintentsschema.h deleted file mode 100644 index 73203876..00000000 --- a/print/XPSDrvSmpl/src/common/cmintentsschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmintentsschema.h - -Abstract: - - PageICMRenderingIntent PrintSchema definition. This defines the features, - options and enumerations that describe the PrintSchema PageICMRenderingIntent feature - within a XDPrintSchema::PageICMRenderingIntent namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageColorManagementIntents elements described as Printschema keywords - // - namespace PageICMRenderingIntent - { - // - // Feature name - // - extern LPCWSTR ICMINTENT_FEATURE; - - // - // Who specified the profile to use - // - enum EICMIntentOption - { - AbsoluteColorimetric = 0, EICMIntentOptionMin = 0, - RelativeColorimetric, - Photographs, - BusinessGraphics, - EICMIntentOptionMax - }; - - extern LPCWSTR ICMINTENT_OPTIONS[EICMIntentOptionMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmintpthndlr.cpp b/print/XPSDrvSmpl/src/common/cmintpthndlr.cpp deleted file mode 100644 index d23fffb6..00000000 --- a/print/XPSDrvSmpl/src/common/cmintpthndlr.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmintpthndlr.cpp - -Abstract: - - PageICMRenderingIntent PrintTicket handler implementation. Derived from - CPTHandler, this provides PageICMRenderingIntent specific Get and Set methods - acting on the PrintTicket (as a DOM document) passed. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "cmintpthndlr.h" - -using XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData; -using XDPrintSchema::PageICMRenderingIntent::EICMIntentOption; -using XDPrintSchema::PageICMRenderingIntent::EICMIntentOptionMin; -using XDPrintSchema::PageICMRenderingIntent::BusinessGraphics; -using XDPrintSchema::PageICMRenderingIntent::EICMIntentOptionMax; -using XDPrintSchema::PageICMRenderingIntent::ICMINTENT_FEATURE; -using XDPrintSchema::PageICMRenderingIntent::ICMINTENT_OPTIONS; - -/*++ - -Routine Name: - - CColorManageIntentsPTHandler::CColorManageIntentsPTHandler - -Routine Description: - - CColorManageIntentsPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CColorManageIntentsPTHandler::CColorManageIntentsPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CColorManageIntentsPTHandler::~CColorManageIntentsPTHandler - -Routine Description: - - CColorManageIntentsPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageIntentsPTHandler::~CColorManageIntentsPTHandler() -{ -} - -/*++ - -Routine Name: - - CColorManageIntentsPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with color intent data retrieved - from the PrintTicket passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color intent data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CColorManageIntentsPTHandler::GetData( - _Inout_ PageICMRenderingIntentData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComBSTR bstrCMOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(ICMINTENT_FEATURE), &bstrCMOption))) - { - // - // Get the profile type - // - for (EICMIntentOption cmOption = EICMIntentOptionMin; - cmOption < EICMIntentOptionMax; - cmOption = static_cast(cmOption + 1)) - { - if (bstrCMOption == ICMINTENT_OPTIONS[cmOption]) - { - pCmData->cmOption = cmOption; - break; - } - } - - if (SUCCEEDED(hr)) - { - if (pCmData->cmOption < EICMIntentOptionMin || - pCmData->cmOption >= EICMIntentOptionMax) - { - hr = E_FAIL; - } - } - } - else - { - pCmData->cmOption = BusinessGraphics; - hr = S_OK; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/cmintpthndlr.h b/print/XPSDrvSmpl/src/common/cmintpthndlr.h deleted file mode 100644 index 19e5b4bc..00000000 --- a/print/XPSDrvSmpl/src/common/cmintpthndlr.h +++ /dev/null @@ -1,43 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmintpthndlr.h - -Abstract: - - PageICMRenderingIntent PrintTicket handler definition. Derived from - CPTHandler, this provides PageICMRenderingIntent specific Get and Set methods - acting on the PrintTicket (as a DOM document) passed. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "cmintentsdata.h" - -class CColorManageIntentsPTHandler : public CPTHandler -{ -public: - CColorManageIntentsPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CColorManageIntentsPTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData* pCmData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmprofiledata.h b/print/XPSDrvSmpl/src/common/cmprofiledata.h deleted file mode 100644 index 29048ea3..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofiledata.h +++ /dev/null @@ -1,44 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmprofiledata.h - -Abstract: - - PageSourceColorProfileData data structure definition. This provides - a convenient description of the PrintSchema PageSourceColorProfileData - feature. - ---*/ - -#pragma once - -#include "cmprofileschema.h" - -namespace XDPrintSchema -{ - namespace PageSourceColorProfile - { - struct PageSourceColorProfileData - { - PageSourceColorProfileData() : - cmProfile(RGB) - { - } - - EProfileOption cmProfile; - CComBSTR cmProfileName; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmprofileschema.cpp b/print/XPSDrvSmpl/src/common/cmprofileschema.cpp deleted file mode 100644 index 5f74fa51..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofileschema.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmprofileschema.cpp - -Abstract: - - PageSourceColorProfile PrintSchema implementation. This implements the - features, options and enumerations that describe the PrintSchema - PageSourceColorProfile feature. - ---*/ - -#include "precomp.h" -#include "globals.h" -#include "privatedefs.h" -#include "cmprofileschema.h" - -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_FEATURE = L"PageSourceColorProfile"; - -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_OPTIONS[] = { - L"RGB", - L"CMYK" -}; - -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_URI_PROP = L"SourceColorProfileURI"; -LPCWSTR XDPrintSchema::PageSourceColorProfile::PROFILE_URI_REF = L"PageSourceColorProfileURI"; - -PRIVATE_DEF_STRINGS XDPrintSchema::PageSourceColorProfile::PROFILE_PARAM_DEF = { - "PageSourceColorProfileURI", - NULL, - "xdCMYKPrinter.icc", - 0, - 65536, - "characters" -}; - - - diff --git a/print/XPSDrvSmpl/src/common/cmprofileschema.h b/print/XPSDrvSmpl/src/common/cmprofileschema.h deleted file mode 100644 index 659d42c5..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofileschema.h +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmintentsschema.h - -Abstract: - - PageSourceColorProfile PrintSchema definition. This defines the features, - options and enumerations that describe the PrintSchema PageSourceColorProfile - feature within a XDPrintSchema::PageSourceColorProfile namespace. - - ---*/ - -#pragma once - -#include "schema.h" -#include "globals.h" -#include "privatedefs.h" - -namespace XDPrintSchema -{ - // - // PageColorManagement elements described as Printschema keywords - // - namespace PageSourceColorProfile - { - // - // Feature name - // - extern LPCWSTR PROFILE_FEATURE; - - // - // Who specified the profile to use - // - enum EProfileOption - { - RGB = 0, EProfileOptionMin = 0, - CMYK, - EProfileOptionMax - }; - - extern LPCWSTR PROFILE_OPTIONS[EProfileOptionMax]; - - extern LPCWSTR PROFILE_URI_PROP; - extern LPCWSTR PROFILE_URI_REF; - extern PRIVATE_DEF_STRINGS PROFILE_PARAM_DEF; - } -} - diff --git a/print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp b/print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp deleted file mode 100644 index a8f5bb9c..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpchndlr.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/*++ - -Copyright (c) 2008 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmprofpchndlr.cpp - -Abstract: - - PageSourceColorProfile PrintCapabilities handling implementation. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "ptquerybld.h" -#include "cmprofpchndlr.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::PageSourceColorProfile::PROFILE_FEATURE; -using XDPrintSchema::PageSourceColorProfile::PROFILE_OPTIONS; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_PROP; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_REF; -using XDPrintSchema::PageSourceColorProfile::PROFILE_PARAM_DEF; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMax; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMin; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -/*++ - -Routine Name: - - CColorManageProfilePCHandler::CColorManageProfilePCHandler - -Routine Description: - - CColorManageProfilePCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CColorManageProfilePCHandler::CColorManageProfilePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePCHandler::~CColorManageProfilePCHandler - -Routine Description: - - CColorManageProfilePCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageProfilePCHandler::~CColorManageProfilePCHandler() -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePCHandler::SetCapabilities - -Routine Description: - - This routine sets color profile capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManageProfilePCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr pPCRoot(NULL); - CComPtr pFeatureElement(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPCRoot)) && - SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(PROFILE_FEATURE), NULL, &pFeatureElement))) - { - for ( EProfileOption option = EProfileOptionMin; - option < EProfileOptionMax && SUCCEEDED(hr); - option = static_cast(option + 1)) - { - CComPtr pOptionElement(NULL); - CComPtr pScoredPropElement(NULL); - CComPtr pPropRefElement(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(PROFILE_OPTIONS[option]), NULL, &pOptionElement)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(PROFILE_URI_PROP), &pScoredPropElement)) && - SUCCEEDED(hr = CreateParameterRef(CComBSTR(PROFILE_URI_REF), &pPropRefElement)) && - SUCCEEDED(hr = pScoredPropElement->appendChild(pPropRefElement, NULL)) && - SUCCEEDED(hr = pOptionElement->appendChild(pScoredPropElement, NULL))) - { - hr = pFeatureElement->appendChild(pOptionElement, NULL); - } - } - - CComPtr pParameterDef(NULL); - - if (SUCCEEDED(hr = pPCRoot->appendChild(pFeatureElement, NULL)) && - SUCCEEDED(hr = CreateStringParameterDef( CComBSTR(PROFILE_PARAM_DEF.property_name), // Paramater Name - TRUE, // Is Print Schema Keyword? - CComBSTR(PROFILE_PARAM_DEF.display_name), // Display Text - CComBSTR(PROFILE_PARAM_DEF.default_value), // Default - PROFILE_PARAM_DEF.min_length, // Min Length - PROFILE_PARAM_DEF.max_length, // Max Length - CComBSTR(PROFILE_PARAM_DEF.unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPCRoot->appendChild(pParameterDef, NULL); - } - } - - - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - - return S_OK; -} diff --git a/print/XPSDrvSmpl/src/common/cmprofpchndlr.h b/print/XPSDrvSmpl/src/common/cmprofpchndlr.h deleted file mode 100644 index 059ca831..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpchndlr.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2008 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmprofpthndlr.h - -Abstract: - - PageSourceColorProfile PrintCapabilities handling definition. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "cmprofiledata.h" - -class CColorManageProfilePCHandler : public CPCHandler -{ -public: - - CColorManageProfilePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CColorManageProfilePCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp b/print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp deleted file mode 100644 index ee074fdb..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpthndlr.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmprofpthndlr.cpp - -Abstract: - - PageSourceColorProfile PrintTicket handling implementation. - The PageSourceColorProfile PT handler is used to extract - PageSourceColorProfile settings from a PrintTicket and populate - the PageSourceColorProfile data structure with the retrieved - settings. The class also defines a method for setting the feature in - the PrintTicket given the data structure. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "ptquerybld.h" -#include "cmprofpthndlr.h" - -using XDPrintSchema::SCHEMA_STRING; -using XDPrintSchema::PRINTTICKET_NAME; - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMin; -using XDPrintSchema::PageSourceColorProfile::EProfileOptionMax; -using XDPrintSchema::PageSourceColorProfile::PROFILE_FEATURE; -using XDPrintSchema::PageSourceColorProfile::PROFILE_OPTIONS; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_PROP; -using XDPrintSchema::PageSourceColorProfile::PROFILE_URI_REF; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::CColorManageProfilePTHandler - -Routine Description: - - CColorManageProfilePTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CColorManageProfilePTHandler::CColorManageProfilePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::~CColorManageProfilePTHandler - -Routine Description: - - CColorManageProfilePTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageProfilePTHandler::~CColorManageProfilePTHandler() -{ -} - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with color profile data - retrieved from the PrintTicket passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color profile data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CColorManageProfilePTHandler::GetData( - _Inout_ PageSourceColorProfileData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComBSTR option; - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(PROFILE_FEATURE), &option)) && - SUCCEEDED(GetScoredPropertyValue(CComBSTR(PROFILE_FEATURE), CComBSTR(PROFILE_URI_PROP), &pCmData->cmProfileName)) - ) - { - pCmData->cmProfile = CMYK; // default to CMYK - - for (EProfileOption cmOption = EProfileOptionMin; - cmOption < EProfileOptionMax; - cmOption = static_cast(cmOption + 1)) - { - if (option == CComBSTR(PROFILE_OPTIONS[cmOption])) - { - pCmData->cmProfile = cmOption; - } - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CColorManageProfilePTHandler::SetData - -Routine Description: - - This routine sets the color profile data in the PrintTicket - passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color profile data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManageProfilePTHandler::SetData( - _In_ CONST PageSourceColorProfileData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComPtr pFeature(NULL); - CComPtr pOption(NULL); - CComPtr pUriProperty(NULL); - CComPtr pRef(NULL); - CComPtr pInit(NULL); - - - CComBSTR bstrFeature(PROFILE_FEATURE); - - if (SUCCEEDED(hr = DeleteFeature(bstrFeature)) && - SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeature, CComBSTR(PROFILE_OPTIONS[pCmData->cmProfile]), &pFeature, &pOption)) && - SUCCEEDED(hr = CreateParamRefInitPair(CComBSTR(PROFILE_URI_REF), CComBSTR(SCHEMA_STRING), pCmData->cmProfileName, &pRef, &pInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(PROFILE_URI_PROP), pRef, &pUriProperty)) && - SUCCEEDED(hr = pOption->appendChild(pUriProperty, NULL)) && - SUCCEEDED(hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pInit))) - { - SUCCEEDED(hr = AppendToElement(CComBSTR(PRINTTICKET_NAME), pFeature)); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/cmprofpthndlr.h b/print/XPSDrvSmpl/src/common/cmprofpthndlr.h deleted file mode 100644 index fb002a45..00000000 --- a/print/XPSDrvSmpl/src/common/cmprofpthndlr.h +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmprofpthndlr.h - -Abstract: - - PageSourceColorProfile PrintTicket handling definition. - The PageSourceColorProfile PT handler is used to extract - PageSourceColorProfile settings from a PrintTicket and populate - the PageSourceColorProfile data structure with the retrieved - settings. The class also defines a method for setting the feature in - the PrintTicket given the data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "cmprofiledata.h" - -class CColorManageProfilePTHandler : public CPTHandler -{ -public: - CColorManageProfilePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CColorManageProfilePTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pCmData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pCmData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmpthndlr.cpp b/print/XPSDrvSmpl/src/common/cmpthndlr.cpp deleted file mode 100644 index cdd20311..00000000 --- a/print/XPSDrvSmpl/src/common/cmpthndlr.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmpthndlr.cpp - -Abstract: - - PageColorManagement PrintTicket handling implementation. The - PageColorManagement PT handler is used to extract booklet settings - from a PrintTicket and populate the PageColorManagement data - structure with the retrieved settings. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "cmpthndlr.h" - -using XDPrintSchema::PageColorManagement::ColorManagementData; -using XDPrintSchema::PageColorManagement::EPCMOption; -using XDPrintSchema::PageColorManagement::EPCMOptionMin; -using XDPrintSchema::PageColorManagement::EPCMOptionMax; -using XDPrintSchema::PageColorManagement::PCM_FEATURE; -using XDPrintSchema::PageColorManagement::PCM_OPTIONS; - -/*++ - -Routine Name: - - CColorManagePTHandler::CColorManagePTHandler - -Routine Description: - - CColorManagePTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CColorManagePTHandler::CColorManagePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CColorManagePTHandler::~CColorManagePTHandler - -Routine Description: - - CColorManagePTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManagePTHandler::~CColorManagePTHandler() -{ -} - -/*++ - -Routine Name: - - CColorManagePTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with color management data - retrieved from the PrintTicket passed to the class constructor. - -Arguments: - - pCmData - Pointer to the color management data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CColorManagePTHandler::GetData( - _Inout_ ColorManagementData* pCmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pCmData, E_POINTER))) - { - CComBSTR bstrCMOption; - - // - // Check whether to use driver or device color matching - // - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(PCM_FEATURE), &bstrCMOption))) - { - for (EPCMOption cmOpt = EPCMOptionMin; - cmOpt < EPCMOptionMax; - cmOpt = static_cast(cmOpt + 1)) - { - if (bstrCMOption == PCM_OPTIONS[cmOpt]) - { - pCmData->cmOption = cmOpt; - break; - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pCmData->cmOption < EPCMOptionMin || - pCmData->cmOption >= EPCMOptionMax) - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/cmpthndlr.h b/print/XPSDrvSmpl/src/common/cmpthndlr.h deleted file mode 100644 index 17faf30e..00000000 --- a/print/XPSDrvSmpl/src/common/cmpthndlr.h +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmpthndlr.h - -Abstract: - - PageColorManagement PrintTicket handling definition. The - PageColorManagement PT handler is used to extract booklet settings - from a PrintTicket and populate the PageColorManagement data - structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "cmdata.h" - -class CColorManagePTHandler : public CPTHandler -{ -public: - CColorManagePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CColorManagePTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageColorManagement::ColorManagementData* pCmData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/cmschema.cpp b/print/XPSDrvSmpl/src/common/cmschema.cpp deleted file mode 100644 index f047f8fa..00000000 --- a/print/XPSDrvSmpl/src/common/cmschema.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmschema.cpp - -Abstract: - - PageColorManagement PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageColorManagement feature. - ---*/ - -#include "precomp.h" -#include "cmschema.h" - -LPCWSTR XDPrintSchema::PageColorManagement::PCM_FEATURE = L"PageColorManagement"; - -LPCWSTR XDPrintSchema::PageColorManagement::PCM_OPTIONS[] = { - L"None", - L"Device", - L"Driver", - L"System" -}; - diff --git a/print/XPSDrvSmpl/src/common/cmschema.h b/print/XPSDrvSmpl/src/common/cmschema.h deleted file mode 100644 index 6f4a30a6..00000000 --- a/print/XPSDrvSmpl/src/common/cmschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmschema.h - -Abstract: - - PageColorManagement PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageColorManagement feature - within a XDPrintSchema::PageColorManagement namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageColorManagement elements described as Printschema keywords - // - namespace PageColorManagement - { - // - // Feature name - // - extern LPCWSTR PCM_FEATURE; - - // - // Option names - // - enum EPCMOption - { - None = 0, EPCMOptionMin = 0, - Device, - Driver, - System, - EPCMOptionMax - }; - - extern LPCWSTR PCM_OPTIONS[EPCMOptionMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/globals.cpp b/print/XPSDrvSmpl/src/common/globals.cpp deleted file mode 100644 index 28cf17a5..00000000 --- a/print/XPSDrvSmpl/src/common/globals.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - globals.cpp - -Abstract: - - Stores function implementations and variable instances global to the filter - module. This is shared between all filters. - ---*/ - -#include "precomp.h" -#include - -// -// Module's Instance handle from DLLEntry of process. -// -HINSTANCE g_hInstance = NULL; - -// -// Server lock count -// -LONG g_cServerLocks = 0; - -/*++ - -Routine Name: - - GetLastErrorAsHResult - -Routine Description: - - Converts the Win32 last error to an HRESULT - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -GetLastErrorAsHResult( - void - ) -{ - DWORD error = GetLastError(); - - return HRESULT_FROM_WIN32(error); -} - -/*++ - -Routine Name: - - GetLastErrorAsHResult - -Routine Description: - - Converts a GDI status error to an HRESULT - -Arguments: - - gdiPStatus - The GDI plus status value to be converted to an HRESULT - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -GetGDIStatusErrorAsHResult( - _In_ Status gdiPStatus - ) -{ - HRESULT hr = E_FAIL; - - switch (gdiPStatus) - { - case Ok: - { - hr = S_OK; - } - break; - - case GenericError: - { - hr = E_FAIL; - } - break; - - case InvalidParameter: - { - hr = E_INVALIDARG; - } - break; - - case OutOfMemory: - { - hr = E_OUTOFMEMORY; - } - break; - - case ObjectBusy: - { - hr = E_PENDING; - } - break; - - case InsufficientBuffer: - { - hr = E_OUTOFMEMORY; - } - break; - - case NotImplemented: - { - hr = E_NOTIMPL; - } - break; - - case Win32Error: - { - hr = GetLastErrorAsHResult(); - } - break; - - case FileNotFound: - { - hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); - } - break; - - case AccessDenied: - { - hr = HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); - } - break; - - // - // Default to E_FAIL - // - case UnknownImageFormat: - case FontFamilyNotFound: - case FontStyleNotFound: - case NotTrueTypeFont: - case UnsupportedGdiplusVersion: - case GdiplusNotInitialized: - case PropertyNotFound: - case PropertyNotSupported: - case ValueOverflow: - case Aborted: - case WrongState: - default: - break; - }; - - return hr; -} - -/*++ - -Routine Name: - - IsVista - -Routine Description: - - Checks if we are running under Vista - -Arguments: - - None - -Return Value: - - TRUE if we are under Vista - FALSE otherwise - ---*/ - -BOOL -IsVista( - VOID - ) -{ - BOOL bIsVista = FALSE; - bIsVista = IsWindowsVistaOrGreater(); - return bIsVista; -} - -/*++ - -Routine Name: - - GetUniqueNumber - -Routine Description: - - Returns a unique number. - -Arguments: - - None - -Return Value: - - A unique DWORD. - ---*/ - -DWORD -GetUniqueNumber( - VOID - ) -{ - static volatile DWORD number = 0; - - return InterlockedIncrement(&number); -} diff --git a/print/XPSDrvSmpl/src/common/globals.h b/print/XPSDrvSmpl/src/common/globals.h deleted file mode 100644 index e4992c03..00000000 --- a/print/XPSDrvSmpl/src/common/globals.h +++ /dev/null @@ -1,102 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - globals.cpp - -Abstract: - - Stores function definitions, variable declerations and pre-processor macros - global to the filter module. This is shared between all filters. - ---*/ - -#pragma once - -// -// Module's Instance handle from DLLEntry of process. -// -extern HINSTANCE g_hInstance; - -// -// Server lock count -// -extern LONG g_cServerLocks; - -// -// Global defines -// -#define CB_COPY_BUFFER 0x10000 -#define MAX_UISTRING_LEN 256 -#define OEM_SIGNATURE 'XDSM' -#define OEM_VERSION 0x00000001L - -// -// Conversion functions for Microns to 1/100th of Inch (and visa versa) -// -#define HUNDREDTH_OFINCH_TO_MICRON(x) MulDiv(x, 25400, 100) -#define MICRON_TO_HUNDREDTH_OFINCH(x) MulDiv(x, 100, 25400) - -// -// Macros for checking pointers and handles. -// -#define CHECK_POINTER(p, hr) ((p) == NULL ? hr : S_OK) -#define CHECK_HANDLE(h, hr) ((h) == NULL ? hr : S_OK) - -static const FLOAT kMaxByteAsFloat = 255.0f; -static const FLOAT kMaxWordAsFloat = 65535.0f; - -static const WORD kS2Dot13Neg = 0x8000; -static const WORD kS2Dot13One = 0x2000; -static const WORD kS2Dot13Min = 0xFFFF; -static const WORD kS2Dot13Max = 0x7FFF; - -static const FLOAT k96thInchAsMicrons = 264.58f; - -// -// countof macro -// -#ifndef countof -#define countof(ary) (sizeof(ary) / sizeof((ary)[0])) -#endif - -// -// Converts the Win32 last error to an HRESULT -// -HRESULT -GetLastErrorAsHResult( - void - ); - -// -// Converts a GDI status error to an HRESULT -// -HRESULT -GetGDIStatusErrorAsHResult( - _In_ Status gdiPStatus - ); - -// -// Check if we are running under Vista -// -BOOL -IsVista( - VOID - ); - -// -// Returns a unique number -// -DWORD -GetUniqueNumber( - VOID - ); diff --git a/print/XPSDrvSmpl/src/common/nupchndlr.cpp b/print/XPSDrvSmpl/src/common/nupchndlr.cpp deleted file mode 100644 index e2374eb9..00000000 --- a/print/XPSDrvSmpl/src/common/nupchndlr.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nuppchndlr.cpp - -Abstract: - - NUp PrintCapabilities handling implementation. The NUp PC handler - is used to set NUp settings in a PrintCapabilities. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdexcept.h" -#include "nupchndlr.h" -#include "ptquerybld.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::ENUpFeature; -using XDPrintSchema::NUp::ENUpFeatureMin; -using XDPrintSchema::NUp::DocumentNUp; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; -using XDPrintSchema::NUp::ENUpFeatureMax; -using XDPrintSchema::NUp::NUP_FEATURES; -using XDPrintSchema::NUp::NUP_PROP; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMin; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMax; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_FEATURE; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_OPTIONS; - -/*++ - -Routine Name: - - CNUpPCHandler::CNUpPCHandler - -Routine Description: - - CNUpPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CNUpPCHandler::CNUpPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CNUpPCHandler::~CNUpPCHandler - -Routine Description: - - CNUpPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPCHandler::~CNUpPCHandler() -{ -} - -/*++ - -Routine Name: - - CNUpPCHandler::SetCapabilities - -Routine Description: - - This routine sets NUp capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - for (ENUpFeature nupFeatures = ENUpFeatureMin; - nupFeatures < ENUpFeatureMax && SUCCEEDED(hr); - nupFeatures = static_cast(nupFeatures + 1)) - { - // - // Find the existing NUp feature node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComPtr pFeatureNode(NULL); - CComBSTR bstrFeatureQuery; - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, CComBSTR(NUP_FEATURES[nupFeatures]))) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrFeatureQuery)) && - SUCCEEDED(hr = GetNode(bstrFeatureQuery, &pFeatureNode)) && - hr != S_FALSE) - { - CComPtr pPresentationFeature(NULL); - - // - // Create the presentation feature options - // - if (SUCCEEDED(hr = CreateFeature(CComBSTR(NUP_DIRECTION_FEATURE), - NULL, - &pPresentationFeature))) - { - PTDOMElementVector optionList; - - for (ENUpDirectionOption presentationOption = ENUpDirectionOptionMin; - presentationOption < ENUpDirectionOptionMax && SUCCEEDED(hr); - presentationOption = static_cast(presentationOption + 1)) - { - // - // Create the presentation options property element - // - CComPtr pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(NUP_DIRECTION_OPTIONS[presentationOption]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options into the presentation feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pPresentationFeature->appendChild(*iterOptionList, NULL); - } - - // - // Add the presentation feature into the existing NUp feature - // - if (SUCCEEDED(hr)) - { - hr = pFeatureNode->appendChild(pPresentationFeature, NULL); - } - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/nupchndlr.h b/print/XPSDrvSmpl/src/common/nupchndlr.h deleted file mode 100644 index f829d739..00000000 --- a/print/XPSDrvSmpl/src/common/nupchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupchndlr.h - -Abstract: - - NUp PrintCapabilities handling definition. The NUp PC handler - is used to set NUp settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "nupdata.h" - -class CNUpPCHandler : public CPCHandler -{ -public: - CNUpPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CNUpPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/nupdata.h b/print/XPSDrvSmpl/src/common/nupdata.h deleted file mode 100644 index bf76500a..00000000 --- a/print/XPSDrvSmpl/src/common/nupdata.h +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupdata.h - -Abstract: - - NUp data structure definition. This provides a convenient description - of the PrintSchema JobNUpAllDocumentsContiguously and DocumentNUp features. - ---*/ - -#pragma once - -#include "nupschema.h" - -namespace XDPrintSchema -{ - namespace NUp - { - struct NUpData - { - NUpData() : - nUpFeature(JobNUpAllDocumentsContiguously), - cNUp(1), - nUpPresentDir(PresentationDirection::RightBottom) - { - } - - ENUpFeature nUpFeature; - INT cNUp; - PresentationDirection::ENUpDirectionOption nUpPresentDir; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/nupschema.cpp b/print/XPSDrvSmpl/src/common/nupschema.cpp deleted file mode 100644 index 7ae67391..00000000 --- a/print/XPSDrvSmpl/src/common/nupschema.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupschema.cpp - -Abstract: - - NUp PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema JobNUpAllDocumentsContiguously - and DocumentNUp features. - ---*/ - -#include "precomp.h" -#include "nupschema.h" - -LPCWSTR XDPrintSchema::NUp::NUP_FEATURES[] = { - L"JobNUpAllDocumentsContiguously", - L"DocumentNUp" -}; - -LPCWSTR XDPrintSchema::NUp::NUP_PROP = L"PagesPerSheet"; - -LPCWSTR XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_FEATURE = L"PresentationDirection"; - -LPCWSTR XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_OPTIONS[] = { - L"RightBottom", - L"BottomRight", - L"LeftBottom", - L"BottomLeft", - L"RightTop", - L"TopRight", - L"LeftTop", - L"TopLeft" -}; - diff --git a/print/XPSDrvSmpl/src/common/nupschema.h b/print/XPSDrvSmpl/src/common/nupschema.h deleted file mode 100644 index 4c10451d..00000000 --- a/print/XPSDrvSmpl/src/common/nupschema.h +++ /dev/null @@ -1,77 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupschema.h - -Abstract: - - NUp PrintSchema definition. This defines the features, options and - enumerations that describe the PrintSchema JobNUpAllDocumentsContiguously and DocumentNUp - features within a XDPrintSchema::NUp namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // NUp elements described as Printschema keywords - // - namespace NUp - { - // - // JobNUpAllDocumentsContiguously and DocumentNUp share identical options so we define two - // features within the NUp namespace. - // - enum ENUpFeature - { - JobNUpAllDocumentsContiguously = 0, ENUpFeatureMin = 0, - DocumentNUp, - ENUpFeatureMax - }; - - extern LPCWSTR NUP_FEATURES[ENUpFeatureMax]; - - extern LPCWSTR NUP_PROP; - - namespace PresentationDirection - { - // - // Feature name - // - extern LPCWSTR NUP_DIRECTION_FEATURE; - - // - // Option names - // - enum ENUpDirectionOption - { - RightBottom = 0, ENUpDirectionOptionMin = 0, - BottomRight, - LeftBottom, - BottomLeft, - RightTop, - TopRight, - LeftTop, - TopLeft, - ENUpDirectionOptionMax - }; - - extern LPCWSTR NUP_DIRECTION_OPTIONS[ENUpDirectionOptionMax]; - } - } -} - diff --git a/print/XPSDrvSmpl/src/common/nupthndlr.cpp b/print/XPSDrvSmpl/src/common/nupthndlr.cpp deleted file mode 100644 index be836bcc..00000000 --- a/print/XPSDrvSmpl/src/common/nupthndlr.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupthndlr.cpp - -Abstract: - - NUp PrintTicket handling implementation. The nup PT handler - is used to extract nup settings from a PrintTicket and populate - the nup properties class with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "nupthndlr.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::ENUpFeature; -using XDPrintSchema::NUp::ENUpFeatureMin; -using XDPrintSchema::NUp::ENUpFeatureMax; -using XDPrintSchema::NUp::NUP_FEATURES; -using XDPrintSchema::NUp::NUP_PROP; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMin; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMax; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_FEATURE; -using XDPrintSchema::NUp::PresentationDirection::NUP_DIRECTION_OPTIONS; - -/*++ - -Routine Name: - - CNUpPTHandler::CNUpPTHandler - -Routine Description: - - CNUpPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CNUpPTHandler::CNUpPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CNUpPTHandler::~CNUpPTHandler - -Routine Description: - - CNUpPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPTHandler::~CNUpPTHandler() -{ -} - -/*++ - -Routine Name: - - CNUpPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with NUp data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pNUpData - Pointer to the NUp data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CNUpPTHandler::GetData( - _Out_ NUpData* pNUpData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpData, E_POINTER))) - { - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax; - nUpFeature = static_cast(nUpFeature + 1)) - { - CComBSTR bstrPresentOption; - CComBSTR bstrFeature(NUP_FEATURES[nUpFeature]); - - if (SUCCEEDED(hr = FeaturePresent(bstrFeature, NULL)) && - SUCCEEDED(hr = GetSubFeatureOption(bstrFeature, - CComBSTR(NUP_DIRECTION_FEATURE), - &bstrPresentOption)) && - SUCCEEDED(hr = GetScoredPropertyValue(bstrFeature, CComBSTR(NUP_PROP), &pNUpData->cNUp))) - { - // - // We may be set to 1-up. If so treat as though the feature is not present - // - if (pNUpData->cNUp > 1) - { - pNUpData->nUpFeature = nUpFeature; - - // - // Convert the presentation direction string to our enumeration - // - for (ENUpDirectionOption presDir = ENUpDirectionOptionMin; - presDir < ENUpDirectionOptionMax; - presDir = static_cast(presDir + 1)) - { - if (bstrPresentOption == NUP_DIRECTION_OPTIONS[presDir]) - { - pNUpData->nUpPresentDir = presDir; - break; - } - } - - // - // We have found and initialised the feature - break out the feature loop - // - break; - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - else if (hr != E_ELEMENT_NOT_FOUND) - { - // - // We have an error other than the element is not present - // so we break and let the result return - // - break; - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pNUpData->nUpFeature < ENUpFeatureMin || - pNUpData->nUpFeature >= ENUpFeatureMax || - pNUpData->nUpPresentDir < ENUpDirectionOptionMin || - pNUpData->nUpPresentDir >= ENUpDirectionOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTHandler::SetData - -Routine Description: - - This routine sets the NUp data in the PrintTicket passed to the - class constructor. Note: The GPD handles the NUp count option and - scored properties so we only have to add the presentation direction - sub-feature. - -Arguments: - - pNUpData - Pointer to the NUp data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTHandler::SetData( - _In_ CONST NUpData* pNUpData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpData, E_POINTER))) - { - if (pNUpData->nUpFeature < ENUpFeatureMin || - pNUpData->nUpFeature >= ENUpFeatureMax || - pNUpData->nUpPresentDir < ENUpDirectionOptionMin || - pNUpData->nUpPresentDir >= ENUpDirectionOptionMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Check the appropriate NUp option is set in the PT - // - CComPtr pNUpFeature(NULL); - CComBSTR bstrFeature(NUP_FEATURES[pNUpData->nUpFeature]); - - if (SUCCEEDED(hr = FeaturePresent(bstrFeature, &pNUpFeature))) - { - // - // The NUp feature is present. Create the presentation direction sub-feature - // and ensure it is set in the PrintTicket. - // - CComPtr pPresDirFeature(NULL); - CComPtr pPresDirOption(NULL); - - if (SUCCEEDED(hr = DeleteFeature(CComBSTR(NUP_DIRECTION_FEATURE))) && - SUCCEEDED(hr = CreateFeatureOptionPair(CComBSTR(NUP_DIRECTION_FEATURE), - CComBSTR(NUP_DIRECTION_OPTIONS[pNUpData->nUpPresentDir]), - &pPresDirFeature, - &pPresDirOption))) - { - hr = pNUpFeature->appendChild(pPresDirFeature, NULL); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTHandler::Delete - -Routine Description: - - This routine deletes the NUp feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTHandler::Delete() -{ - HRESULT hr = S_OK; - - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax && SUCCEEDED(hr); - nUpFeature = static_cast(nUpFeature + 1)) - { - hr = DeleteFeature(CComBSTR(NUP_FEATURES[nUpFeature])); - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/common/nupthndlr.h b/print/XPSDrvSmpl/src/common/nupthndlr.h deleted file mode 100644 index eaeb22a6..00000000 --- a/print/XPSDrvSmpl/src/common/nupthndlr.h +++ /dev/null @@ -1,53 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupthndlr.h - -Abstract: - - NUp properties class implementation. The NUp properties class - is responsible for holding and controling NUp properties. - ---*/ - -#pragma once - - -#include "pthndlr.h" -#include "nupdata.h" - -class CNUpPTHandler : public CPTHandler -{ -public: - CNUpPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CNUpPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::NUp::NUpData* pNUpData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::NUp::NUpData* pNUpData - ); - - HRESULT - Delete( - VOID - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pchndlr.cpp b/print/XPSDrvSmpl/src/common/pchndlr.cpp deleted file mode 100644 index c480ac52..00000000 --- a/print/XPSDrvSmpl/src/common/pchndlr.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pchndlr.cpp - -Abstract: - - Base PrintCapabilities handler class implementation. This class provides common - PrintCapabilities handling functionality for any feature that requires - PrintCapabilities handling. A feature specific handler can derive from - this class to get feature unspecific XML handling functionality. - ---*/ - - -// -// Note on handling missing DOM nodes: -// -// Convert MSXML's S_FALSE to E_ELEMENT_NOT_FOUND. This allows clients to -// use the SUCCEEDED macro more effectively. -// -// E_ELEMENT_NOT_FOUND should not be propogated as an error to the -// filter pipeline or config module - treat as though the requested feature -// has not been enabled. -// - -#include "precomp.h" -#include "debug.h" -#include "xdstring.h" -#include "pchndlr.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; -using XDPrintSchema::PARAM_DEF_ELEMENT_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::SCHEMA_CONDITIONAL; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::DATATYPE_VALUE_NAME; -using XDPrintSchema::SCHEMA_QNAME; -using XDPrintSchema::DEFAULTVAL_VALUE_NAME; -using XDPrintSchema::SCHEMA_STRING; -using XDPrintSchema::MAX_VALUE_NAME; -using XDPrintSchema::MIN_VALUE_NAME; -using XDPrintSchema::MAX_LENGTH_NAME; -using XDPrintSchema::MIN_LENGTH_NAME; -using XDPrintSchema::MANDATORY_VALUE_NAME; -using XDPrintSchema::UNITTYPE_VALUE_NAME; -using XDPrintSchema::MULTIPLE_VALUE_NAME; -using XDPrintSchema::DISPLAYNAME_VALUE_NAME; -using XDPrintSchema::SCHEMA_DECIMAL; -using XDPrintSchema::FEATURE_ELEMENT_NAME; -using XDPrintSchema::PICKONE_VALUE_NAME; -using XDPrintSchema::SELECTIONTYPE_VALUE_NAME; -using XDPrintSchema::OPTION_ELEMENT_NAME; -using XDPrintSchema::PARAM_REF_ELEMENT_NAME; -using XDPrintSchema::FRAMEWORK_URI; -using XDPrintSchema::KEYWORDS_URI; - -/*++ - -Routine Name: - - CPCHandler::CPCHandler - -Routine Description: - - CPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - - Note: Base Class (CPSHandler) - Throws CXDException(HRESULT) on an error - ---*/ -CPCHandler::CPCHandler( - _In_ IXMLDOMDocument2 *pDOMDocument - ) : - CPSHandler(CComBSTR(PRINTCAPABILITIES_NAME), pDOMDocument) -{ -} - -/*++ - -Routine Name: - - CPCHandler::~CPCHandler - -Routine Description: - - CPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPCHandler::~CPCHandler() -{ -} - - -/*++ - -Routine Name: - - CPCHandler::CreateStringParameterDef - -Routine Description: - - Creates a String type ParameterDef Element. - -Arguments: - - bstrParamName - Keyword value name for the parameter - bstrDisplayName - Optional string containing a description of the parameter definition. - defaultValue - Default value of the parameter. - minLength - Minimium valid value. - maxLength - Maximium valid value. - multiple - value can be increased or decreased in multiples of. - bstrUnitType - String containing a description of the unit type of the parameter value. - ppParameterDef - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateStringParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST BSTR defaultValue, - _In_ CONST INT minLength, - _In_ CONST INT maxLength, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ) -{ - HRESULT hr = S_OK; - - // - // Create the parameterDef - // - CComBSTR bstrParameter(m_bstrFrameworkPrefix); - bstrParameter += PARAM_DEF_ELEMENT_NAME; - - // - // PageWatermarkSizeWidth and PageWatermarkSizeHeight are non-standard - // parameter names so need to be accessed using a user defined namespace - // - CComBSTR bstrParameterAttrib; - if (bIsPublicKeyword) - { - hr = bstrParameterAttrib.Append(m_bstrKeywordsPrefix); - } - else - { - hr = bstrParameterAttrib.Append(m_bstrUserKeywordsPrefix); - } - - if (SUCCEEDED(hr)) - { - bstrParameterAttrib += bstrParamName; - } - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrParameter, FRAMEWORK_URI, ppParameterDef); - } - - if(SUCCEEDED(hr)) - { - if(SUCCEEDED(hr = CreateXMLAttribute(*ppParameterDef, NAME_ATTRIBUTE_NAME, NULL, bstrParameterAttrib ))) - { - CComPtr pDataTypeProp(NULL); - CComPtr pDefValProp(NULL); - CComPtr pMaxLengthProp(NULL); - CComPtr pMinLengthProp(NULL); - CComPtr pMandatoryProp(NULL); - CComPtr pUnitTypeProp(NULL); - - CComBSTR bstrMandatory(m_bstrKeywordsPrefix); - bstrMandatory += SCHEMA_CONDITIONAL; - - CStringXDW cstrMaxLength; - cstrMaxLength.Format(L"%i", maxLength); - - CStringXDW cstrMinLength; - cstrMinLength.Format(L"%i", minLength); - - CComBSTR bstrStringType(m_bstrSchemaPrefix); - bstrStringType += SCHEMA_STRING; - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DATATYPE_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrStringType, &pDataTypeProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(DEFAULTVAL_VALUE_NAME), CComBSTR(SCHEMA_STRING), defaultValue, &pDefValProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MAX_LENGTH_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMaxLength), &pMaxLengthProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MIN_LENGTH_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMinLength), &pMinLengthProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MANDATORY_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrMandatory, &pMandatoryProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(UNITTYPE_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrUnitType, &pUnitTypeProp)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDataTypeProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDefValProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMaxLengthProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMinLengthProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMandatoryProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pUnitTypeProp, NULL))) - { - if (SUCCEEDED(hr) && - SysStringLen(bstrDisplayName) > 0) - { - CComPtr pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppParameterDef)->appendChild(pDisplayProp, NULL); - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateIntParameterDef - -Routine Description: - - Creates a Integer type ParameterDef Element. - -Arguments: - - bstrParamName - Keyword value name for the parameter - bstrDisplayName - Optional string containing a description of the parameter definition. - defaultValue - Default value of the parameter. - minValue - Minimium valid value. - maxLength - Maximium valid value. - multiple - value can be increased or decreased in multiples of. - bstrUnitType - String containing a description of the unit type of the parameter value. - ppParameterDef - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateIntParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST INT defaultValue, - _In_ CONST INT minValue, - _In_ CONST INT maxValue, - _In_ CONST INT multiple, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ) -{ - HRESULT hr = S_OK; - - // - // Create the parameterDef - // - CComBSTR bstrParameter(m_bstrFrameworkPrefix); - bstrParameter += PARAM_DEF_ELEMENT_NAME; - - CComBSTR bstrParameterAttrib; - if (bIsPublicKeyword) - { - hr = bstrParameterAttrib.Append(m_bstrKeywordsPrefix); - } - else - { - hr = bstrParameterAttrib.Append(m_bstrUserKeywordsPrefix); - } - - if (SUCCEEDED(hr)) - { - bstrParameterAttrib += bstrParamName; - } - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrParameter, FRAMEWORK_URI, ppParameterDef); - } - - if(SUCCEEDED(hr)) - { - if(SUCCEEDED(hr = CreateXMLAttribute(*ppParameterDef, NAME_ATTRIBUTE_NAME, NULL, bstrParameterAttrib ))) - { - CComPtr pDataTypeProp(NULL); - CComPtr pDefValProp(NULL); - CComPtr pMaxValueProp(NULL); - CComPtr pMinValueProp(NULL); - CComPtr pMandatoryProp(NULL); - CComPtr pUnitTypeProp(NULL); - CComPtr pMultipleProp(NULL); - - CStringXDW cstrMultiple; - cstrMultiple.Format(L"%i", multiple); - - CComBSTR bstrMandatory(m_bstrKeywordsPrefix); - bstrMandatory += SCHEMA_CONDITIONAL; - - CStringXDW cstrDefaultValue; - cstrDefaultValue.Format(L"%i", defaultValue); - - CStringXDW cstrMaxValue; - cstrMaxValue.Format(L"%i", maxValue); - - CStringXDW cstrMinValue; - cstrMinValue.Format(L"%i", minValue); - - CComBSTR bstrIntegerType(m_bstrSchemaPrefix); - bstrIntegerType += SCHEMA_INTEGER; - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DATATYPE_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrIntegerType, &pDataTypeProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(DEFAULTVAL_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrDefaultValue), &pDefValProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MAX_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMaxValue), &pMaxValueProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MIN_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMinValue), &pMinValueProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MANDATORY_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrMandatory, &pMandatoryProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(UNITTYPE_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrUnitType, &pUnitTypeProp)) && - SUCCEEDED(hr = CreateProperty(CComBSTR(MULTIPLE_VALUE_NAME), CComBSTR(SCHEMA_INTEGER), CComBSTR(cstrMultiple), &pMultipleProp)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDataTypeProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pDefValProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMaxValueProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMinValueProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMandatoryProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pUnitTypeProp, NULL)) && - SUCCEEDED(hr = (*ppParameterDef)->appendChild(pMultipleProp, NULL))) - { - if (SysStringLen(bstrDisplayName) > 0) - { - CComPtr pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppParameterDef)->appendChild(pDisplayProp, NULL); - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateFeature - -Routine Description: - - Creates a Feature Element. - -Arguments: - - bstrFeatureName - Keyword value name for the feature. - bstrDisplayName - Optional string containing a description of the feature. - ppFeatureElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateFeature( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ) -{ - HRESULT hr = S_OK; - - // - // Create the base feature node - // - CComBSTR bstrFeature(m_bstrFrameworkPrefix); - bstrFeature += FEATURE_ELEMENT_NAME; - - CComBSTR bstrFeatureAttrib(m_bstrKeywordsPrefix); - bstrFeatureAttrib += bstrFeatureName; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrFeature, FRAMEWORK_URI, ppFeatureElement); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(*ppFeatureElement, NAME_ATTRIBUTE_NAME, NULL, bstrFeatureAttrib ); - } - - // - // Append the Display Name property type - // - if (SUCCEEDED(hr) && - SysStringLen(bstrDisplayName) > 0) - { - CComPtr pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppFeatureElement)->appendChild(pDisplayProp, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateFeatureSelection - -Routine Description: - - Creates a Selection Feature Element. - -Arguments: - - bstrFeatureName - Keyword value name for the feature. - bstrDisplayName - Optional string containing a description of the feature. - ppFeatureElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateFeatureSelection( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CreateFeature(bstrFeatureName, bstrDisplayName, ppFeatureElement))) - { - // - // Append the property type - // - CComPtr pPropertyTypeElement(NULL); - - // - // Create the keyname - // - CComBSTR bstrPickOne(m_bstrKeywordsPrefix); - bstrPickOne += PICKONE_VALUE_NAME; - - if (SUCCEEDED(hr = CreateFWProperty(CComBSTR(SELECTIONTYPE_VALUE_NAME), CComBSTR(SCHEMA_QNAME), bstrPickOne, &pPropertyTypeElement))) - { - hr = (*ppFeatureElement)->appendChild(pPropertyTypeElement, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateOption - -Routine Description: - - Creates an Option Type Element. - -Arguments: - - bstrOptionName - Keyword value name for the option. - bstrDisplayName - Optional string containing a description of the feature. - ppOptionElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateOption( - _In_z_ CONST BSTR bstrOptionName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppOptionElement - ) -{ - HRESULT hr = S_OK; - - // - // Create the base feature node - // - CComBSTR bstrOption(m_bstrFrameworkPrefix); - bstrOption += OPTION_ELEMENT_NAME; - - CComBSTR bstrOptionAttrib(m_bstrKeywordsPrefix); - bstrOptionAttrib += bstrOptionName; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrOption, FRAMEWORK_URI, ppOptionElement); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(*ppOptionElement, NAME_ATTRIBUTE_NAME, NULL, bstrOptionAttrib ); - } - - // - // Append the Display Name property type - // - if (SUCCEEDED(hr) && - SysStringLen(bstrDisplayName) > 0) - { - CComPtr pDisplayProp(NULL); - - if (SUCCEEDED(hr = CreateProperty(CComBSTR(DISPLAYNAME_VALUE_NAME), CComBSTR(SCHEMA_STRING), bstrDisplayName, &pDisplayProp))) - { - hr = (*ppOptionElement)->appendChild(pDisplayProp, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPCHandler::CreateParameterRef - -Routine Description: - - Creates a Reference to a ParameterDef Element. - -Arguments: - - bstrParamRefName - Keyword value name for the parameter reference. - ppParamRefElement - Pointer to an IXMLDOMElement that recieves the new element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPCHandler::CreateParameterRef( - _In_z_ CONST BSTR bstrParamRefName, - _Outptr_ IXMLDOMElement** ppParamRefElement - ) -{ - HRESULT hr = S_OK; - - // - // Create the base feature node - // - CComBSTR bstrParameterRef(m_bstrFrameworkPrefix); - bstrParameterRef += PARAM_REF_ELEMENT_NAME; - - - // - // PageWatermarkSizeWidth and PageWatermarkSizeHeight are non-standard - // parameter names so need to be accessed using a user defined namespace - // - CComBSTR bstrParamRefAttrib; - if (wcscmp(bstrParamRefName, L"PageWatermarkSizeWidth") == 0 || - wcscmp(bstrParamRefName, L"PageWatermarkSizeHeight") == 0) - { - hr = bstrParamRefAttrib.Append(m_bstrUserKeywordsPrefix); - } - else - { - hr = bstrParamRefAttrib.Append(m_bstrKeywordsPrefix); - } - - if (SUCCEEDED(hr)) - { - bstrParamRefAttrib += bstrParamRefName; - } - - // - //Create the IXMLDOMNode for ParameterRef - // - CComPtr pParameterRefNode(NULL); - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrParameterRef, FRAMEWORK_URI, ppParamRefElement); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(*ppParamRefElement, NAME_ATTRIBUTE_NAME, NULL, bstrParamRefAttrib ); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pchndlr.h b/print/XPSDrvSmpl/src/common/pchndlr.h deleted file mode 100644 index df958354..00000000 --- a/print/XPSDrvSmpl/src/common/pchndlr.h +++ /dev/null @@ -1,91 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pchndlr.h - -Abstract: - - Base PrintCapabilities handler class definition. This class provides common - PrintCapabilities handling functionality for any feature that requires - PrintCapabilities handling. A feature specific handler can inherit from - this class to get feature unspecific XML handling functionality. - ---*/ - -#pragma once - -#include "schema.h" -#include "pshndlr.h" - -class CPCHandler : public CPSHandler -{ -public: - // - // Constructors and destructors - // - CPCHandler( - _In_ IXMLDOMDocument2 *pPrintCapabilities - ); - - virtual ~CPCHandler(); - -protected: - - HRESULT - CreateStringParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST BSTR bstrDefaultValue, - _In_ CONST INT minLength, - _In_ CONST INT maxLength, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ); - - HRESULT - CreateIntParameterDef( - _In_z_ CONST BSTR bstrParamName, - _In_ CONST BOOL bIsPublicKeyword, - _In_opt_z_ CONST BSTR bstrDisplayName, - _In_ CONST INT defaultValue, - _In_ CONST INT minValue, - _In_ CONST INT maxValue, - _In_ CONST INT multiple, - _In_z_ CONST BSTR bstrUnitType, - _Outptr_ IXMLDOMElement** ppParameterDef - ); - - HRESULT - CreateFeature( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ); - - HRESULT - CreateOption( - _In_z_ CONST BSTR bstrOptionName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppOptionElement - ); - - HRESULT - CreateFeatureSelection( - _In_z_ CONST BSTR bstrFeatureName, - _In_opt_z_ CONST BSTR bstrDisplayName, - _Outptr_ IXMLDOMElement** ppFeatureElement - ); - - HRESULT - CreateParameterRef( - _In_z_ CONST BSTR bstrParamRefName, - _Outptr_ IXMLDOMElement** ppParamRefElement - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pgscdata.h b/print/XPSDrvSmpl/src/common/pgscdata.h deleted file mode 100644 index 7a06ce24..00000000 --- a/print/XPSDrvSmpl/src/common/pgscdata.h +++ /dev/null @@ -1,52 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscdata.h - -Abstract: - - PageScaling data structure definition. This provides a convenient - description of the PrintSchema PageScaling feature. - ---*/ - -#pragma once - -#include "pgscschema.h" - -namespace XDPrintSchema -{ - namespace PageScaling - { - struct PageScalingData - { - PageScalingData() : - pgscOption(None), - offWidth(0), - offHeight(0), - scaleWidth(100), - scaleHeight(100), - offsetOption(OffsetAlignment::Center) - { - } - - EScaleOption pgscOption; - INT offWidth; - INT offHeight; - INT scaleWidth; - INT scaleHeight; - OffsetAlignment::EScaleOffsetOption offsetOption; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/pgscpchndlr.cpp b/print/XPSDrvSmpl/src/common/pgscpchndlr.cpp deleted file mode 100644 index 12883a69..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpchndlr.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscpchndlr.cpp - -Abstract: - - Pagescale PrintCapabilities handling implementation. The pagescale PC handler - is used to set page scaling settings in a PrintCapabilities. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "pgscpchndlr.h" -#include "privatedefs.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::ECustomScaleProps; -using XDPrintSchema::PageScaling::ECustomScalePropsMin; -using XDPrintSchema::PageScaling::ECustomScalePropsMax; -using XDPrintSchema::PageScaling::ECustomSquareScaleProps; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMin; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMax; -using XDPrintSchema::PageScaling::SCALE_FEATURE; -using XDPrintSchema::PageScaling::SCALE_OPTIONS; -using XDPrintSchema::PageScaling::CUST_SCALE_PROPS; -using XDPrintSchema::PageScaling::CUST_SQR_SCALE_PROPS; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMin; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMax; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_FEATURE; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_OPTIONS; - -/*++ - -Routine Name: - - CPageScalingPCHandler::CPageScalingPCHandler - -Routine Description: - - CPageScalingPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CPageScalingPCHandler::CPageScalingPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CPageScalingPCHandler::~CPageScalingPCHandler - -Routine Description: - - CPageScalingPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingPCHandler::~CPageScalingPCHandler() -{ -} - -/*++ - -Routine Name: - - CPageScalingPCHandler::SetCapabilities - -Routine Description: - - This routine sets page scaling capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - CComPtr pFeatureElement(NULL); - - if (SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(SCALE_FEATURE), NULL, &pFeatureElement))) - { - CComPtr pCustomOption(NULL); - - // - // Create the Custom Options - // - if (SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OPTIONS[Custom]), NULL, &pCustomOption))) - { - PTDOMElementVector propertList; - - for (ECustomScaleProps customProps = ECustomScalePropsMin; - customProps < ECustomScalePropsMax && SUCCEEDED(hr); - customProps = static_cast(customProps + 1)) - { - CComPtr pScoredProperty(NULL); - - // - // Create the scored property list - // - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SCALE_PROPS[customProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(SCALE_FEATURE); - bstrPRefName += CUST_SCALE_PROPS[customProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the custom option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pCustomOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pCustomOption, NULL); - } - } - - CComPtr pCustomSquareOption(NULL); - - // - // Create the Custom Square - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OPTIONS[CustomSquare]), NULL, &pCustomSquareOption))) - { - PTDOMElementVector propertList; - - for (ECustomSquareScaleProps customSquareProps = ECustomSquareScalePropsMin; - customSquareProps < ECustomSquareScalePropsMax && SUCCEEDED(hr); - customSquareProps = static_cast(customSquareProps + 1)) - { - CComPtr pScoredProperty(NULL); - - // - // Create the scored property list - // - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SQR_SCALE_PROPS[customSquareProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(SCALE_FEATURE); - bstrPRefName += CUST_SQR_SCALE_PROPS[customSquareProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the custom square option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pCustomSquareOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pCustomSquareOption, NULL); - } - } - - // - // Create the remaining scaling options: Fit To ... - // - for (EScaleOption fitToOptions = FitBleedToImageable; - fitToOptions <= FitMediaToMedia && SUCCEEDED(hr); - fitToOptions = static_cast(fitToOptions + 1)) - { - CComPtr pFitToOption(NULL); - - // - // Create the fit to page option - // - if (SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OPTIONS[fitToOptions]), NULL, &pFitToOption))) - { - hr = pFeatureElement->appendChild(pFitToOption, NULL); - } - } - - // - // Create the offset options - // - if (SUCCEEDED(hr)) - { - CComPtr pOffsetFeature(NULL); - if (SUCCEEDED(hr = CreateFeature(CComBSTR(SCALE_OFFSET_FEATURE), - NULL, - &pOffsetFeature))) - { - PTDOMElementVector optionList; - - for (EScaleOffsetOption offsetOption = EScaleOffsetOptionMin; - offsetOption < EScaleOffsetOptionMax && SUCCEEDED(hr); - offsetOption = static_cast(offsetOption + 1)) - { - CComPtr pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(SCALE_OFFSET_OPTIONS[offsetOption]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options to the offset feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pOffsetFeature->appendChild(*iterOptionList, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pOffsetFeature, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pFeatureElement, NULL); - } - } - - for (UINT cIndex = 0; cIndex < numof(pgscParamDefIntegers); cIndex++) - { - CComPtr pParameterDef(NULL); - - if (SUCCEEDED(hr = CreateIntParameterDef(CComBSTR(pgscParamDefIntegers[cIndex].property_name), // Paramater Name - pgscParamDefIntegers[cIndex].is_public, // Is Print Schema Keyword? - CComBSTR(pgscParamDefIntegers[cIndex].display_name), // Display Text - pgscParamDefIntegers[cIndex].default_value, // Default - pgscParamDefIntegers[cIndex].min_length, // Min Length - pgscParamDefIntegers[cIndex].max_length, // Max Length - pgscParamDefIntegers[cIndex].multiple, // Multiple - CComBSTR(pgscParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - - diff --git a/print/XPSDrvSmpl/src/common/pgscpchndlr.h b/print/XPSDrvSmpl/src/common/pgscpchndlr.h deleted file mode 100644 index 3d30583f..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscpchndlr.h - -Abstract: - - Page Scaling PrintCapabilities handling definition. The page scaling PC handler - is used to set page scaling settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "pgscdata.h" - -class CPageScalingPCHandler : public CPCHandler -{ -public: - CPageScalingPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CPageScalingPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/pgscpthndlr.cpp b/print/XPSDrvSmpl/src/common/pgscpthndlr.cpp deleted file mode 100644 index beffe034..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpthndlr.cpp +++ /dev/null @@ -1,479 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscpthndlr.cpp - -Abstract: - - PageScaling PrintTicket handler implementation. Derived from CPTHandler, - this provides PageScaling specific Get and Set methods acting on the - PrintTicket (as a DOM document) passed. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "pgscpthndlr.h" - -using XDPrintSchema::PRINTTICKET_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::EScaleOptionMin; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitContentToImageable; -using XDPrintSchema::PageScaling::FitMediaToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; -using XDPrintSchema::PageScaling::None; -using XDPrintSchema::PageScaling::EScaleOptionMax; -using XDPrintSchema::PageScaling::ECustomScaleProps; -using XDPrintSchema::PageScaling::ECustomScalePropsMin; -using XDPrintSchema::PageScaling::CstOffsetWidth; -using XDPrintSchema::PageScaling::CstOffsetHeight; -using XDPrintSchema::PageScaling::CstScaleWidth; -using XDPrintSchema::PageScaling::CstScaleHeight; -using XDPrintSchema::PageScaling::ECustomScalePropsMax; -using XDPrintSchema::PageScaling::ECustomSquareScaleProps; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMin; -using XDPrintSchema::PageScaling::CstSqOffsetWidth; -using XDPrintSchema::PageScaling::CstSqOffsetHeight; -using XDPrintSchema::PageScaling::CstSqScale; -using XDPrintSchema::PageScaling::ECustomSquareScalePropsMax; -using XDPrintSchema::PageScaling::SCALE_FEATURE; -using XDPrintSchema::PageScaling::SCALE_OPTIONS; -using XDPrintSchema::PageScaling::CUST_SCALE_PROPS; -using XDPrintSchema::PageScaling::CUST_SQR_SCALE_PROPS; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMin; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOptionMax; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_FEATURE; -using XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_OPTIONS; - -/*++ - -Routine Name: - - CPageScalingPTHandler::CPageScalingPTHandler - -Routine Description: - - CPageScalingPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CPageScalingPTHandler::CPageScalingPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::~CPageScalingPTHandler - -Routine Description: - - CPageScalingPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingPTHandler::~CPageScalingPTHandler() -{ -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page scaling data - retrieved from the PrintTicket passed to the class constructor. - -Arguments: - - pPageScaleData - Pointer to the page scaling data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CPageScalingPTHandler::GetData( - _Out_ PageScalingData* pPageScaleData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageScaleData, E_POINTER))) - { - CComBSTR bstrPgScOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(SCALE_FEATURE), &bstrPgScOption))) - { - if (bstrPgScOption == SCALE_OPTIONS[Custom]) - { - pPageScaleData->pgscOption = Custom; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstOffsetWidth]), - &pPageScaleData->offWidth)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstOffsetHeight]), - &pPageScaleData->offHeight)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstScaleWidth]), - &pPageScaleData->scaleWidth))) - { - hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SCALE_PROPS[CstScaleHeight]), - &pPageScaleData->scaleHeight); - } - } - else if (bstrPgScOption == SCALE_OPTIONS[CustomSquare]) - { - pPageScaleData->pgscOption = CustomSquare; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SQR_SCALE_PROPS[CstSqOffsetWidth]), - &pPageScaleData->offWidth)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SQR_SCALE_PROPS[CstSqOffsetHeight]), - &pPageScaleData->offHeight)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(SCALE_FEATURE), - CComBSTR(CUST_SQR_SCALE_PROPS[CstSqScale]), - &pPageScaleData->scaleWidth))) - { - pPageScaleData->scaleHeight = pPageScaleData->scaleWidth; - } - } - else if (bstrPgScOption == SCALE_OPTIONS[None]) - { - // - // No scaling - return as if no element is present - // - hr = E_ELEMENT_NOT_FOUND; - } - else - { - // - // Identify the option - // - for (EScaleOption pgScOption = FitBleedToImageable; - pgScOption < EScaleOptionMax; - pgScOption = static_cast(pgScOption + 1)) - { - if (bstrPgScOption == SCALE_OPTIONS[pgScOption]) - { - pPageScaleData->pgscOption = pgScOption; - - // - // Get the offset alignment - // - CComBSTR bstrOffsetAlignment; - - hr = GetSubFeatureOption(CComBSTR(SCALE_FEATURE), - CComBSTR(SCALE_OFFSET_FEATURE), - &bstrOffsetAlignment); - - // - // Identify the Alignment - // - for (EScaleOffsetOption offOption = EScaleOffsetOptionMin; - offOption < EScaleOffsetOptionMax; - offOption = static_cast(offOption + 1)) - { - if (bstrOffsetAlignment == SCALE_OFFSET_OPTIONS[offOption]) - { - pPageScaleData->offsetOption = offOption; - - break; - } - } - - break; - } - } - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pPageScaleData->pgscOption < EScaleOptionMin || - pPageScaleData->pgscOption >= EScaleOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::SetData - -Routine Description: - - This routine sets the page scaling data in the PrintTicket passed to the - class constructor. - -Arguments: - - pPageScaleData - Pointer to the page scale data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingPTHandler::SetData( - _In_ CONST PageScalingData* pPageScaleData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageScaleData, E_POINTER))) - { - if (pPageScaleData->pgscOption < EScaleOptionMin || - pPageScaleData->pgscOption >= EScaleOptionMax || - pPageScaleData->offsetOption < EScaleOffsetOptionMin || - pPageScaleData->offsetOption >= EScaleOffsetOptionMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Remove any existing page scaling feature node - // - CComPtr pFeature(NULL); - CComPtr pOption(NULL); - - CComBSTR bstrFeature(SCALE_FEATURE); - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - - if (SUCCEEDED(hr = DeleteFeature(bstrFeature)) && - pPageScaleData->pgscOption != None && - SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeature, &pFeature, &pOption))) - { - // - // Retrieve the PrintTicket root - // - CComPtr pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTTICKET_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - // - // Append the feature node to the PrintTicket root element - // - hr = pPTRoot->appendChild(pFeature, NULL); - } - - // - // Set the option value - // - bstrAttribName += SCALE_OPTIONS[pPageScaleData->pgscOption]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateXMLAttribute(pOption, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ))) - { - switch (pPageScaleData->pgscOption) - { - case Custom: - { - // - // Create the width offset, height offset, width scale and height scale - // parameter ref/init pairs. Create the relevant scored properties passing the - // paramater refs. Append the scored properties to the option element and the - // paramter init values to the PrintTicket element - // - CONST INT* pValue = &pPageScaleData->offWidth; - for (ECustomScaleProps props = ECustomScalePropsMin; - props < ECustomScalePropsMax && SUCCEEDED(hr); - props = static_cast(props + 1), pValue++) - { - CComPtr pParamRef(NULL); - CComPtr pParamInit(NULL); - CComPtr pScoredProp(NULL); - - CComBSTR bstrParamRefName(SCALE_FEATURE); - bstrParamRefName += CUST_SCALE_PROPS[props]; - - if (SUCCEEDED(hr = CreateParamRefInitPair(bstrParamRefName, - *pValue, - &pParamRef,&pParamInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SCALE_PROPS[props]), - pParamRef, - &pScoredProp)) && - SUCCEEDED(hr = pOption->appendChild(pScoredProp, NULL))) - { - hr = pPTRoot->appendChild(pParamInit, NULL); - } - } - } - break; - - case CustomSquare: - { - // - // Create the width offset, height offset and scale parameter ref/init pairs. - // Create the relevant scored properties passing the paramater refs. Append - // the scored properties to the option element and the paramter init values - // to the PrintTicket element. - // - CONST INT* pValue = &pPageScaleData->offWidth; - for (ECustomSquareScaleProps props = ECustomSquareScalePropsMin; - props < ECustomSquareScalePropsMax && SUCCEEDED(hr); - props = static_cast(props + 1), pValue++) - { - CComPtr pParamRef(NULL); - CComPtr pParamInit(NULL); - CComPtr pScoredProp(NULL); - - CComBSTR bstrParamRefName(SCALE_FEATURE); - bstrParamRefName += CUST_SQR_SCALE_PROPS[props]; - - if (SUCCEEDED(hr = CreateParamRefInitPair(bstrParamRefName, - *pValue, - &pParamRef, - &pParamInit)) && - SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CUST_SQR_SCALE_PROPS[props]), - pParamRef, - &pScoredProp)) && - SUCCEEDED(hr = pOption->appendChild(pScoredProp, NULL))) - { - hr = pPTRoot->appendChild(pParamInit, NULL); - } - } - } - break; - - case FitBleedToImageable: - case FitContentToImageable: - case FitMediaToImageable: - case FitMediaToMedia: - { - // - // Create the ScaleOffsetAlignement feature and append to the option node - // - CComPtr pSubFeature(NULL); - CComPtr pSubOption(NULL); - - CComBSTR bstrOffsetFeature(SCALE_OFFSET_FEATURE); - CComBSTR bstrOffsetOption(SCALE_OFFSET_OPTIONS[pPageScaleData->offsetOption]); - - if (SUCCEEDED(hr = CreateFeatureOptionPair(bstrOffsetFeature, - bstrOffsetOption, - &pSubFeature, - &pSubOption))) - { - hr = pFeature->appendChild(pSubFeature, NULL); - } - } - break; - - case None: - default: - { - } - break; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingPTHandler::Delete - -Routine Description: - - This routine deletes the page scaling feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingPTHandler::Delete( - VOID - ) -{ - // - // Remove any existing page scaling feature node - // - HRESULT hr = DeleteFeature(CComBSTR(SCALE_FEATURE)); - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pgscpthndlr.h b/print/XPSDrvSmpl/src/common/pgscpthndlr.h deleted file mode 100644 index 08c52e7d..00000000 --- a/print/XPSDrvSmpl/src/common/pgscpthndlr.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscpthndlr.h - -Abstract: - - PageScaling PrintTicket handling definition. The PageScaling PT handler - is used to extract PageScaling settings from a PrintTicket and populate - the PageScaling data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "pgscdata.h" - -class CPageScalingPTHandler : public CPTHandler -{ -public: - CPageScalingPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CPageScalingPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::PageScaling::PageScalingData* pPageScaleData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData* pPageScaleData - ); - - HRESULT - Delete( - void - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pgscschema.cpp b/print/XPSDrvSmpl/src/common/pgscschema.cpp deleted file mode 100644 index a8ada487..00000000 --- a/print/XPSDrvSmpl/src/common/pgscschema.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscschema.cpp - -Abstract: - - PageScaling PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageScaling feature. - ---*/ - -#include "precomp.h" -#include "pgscschema.h" - -LPCWSTR XDPrintSchema::PageScaling::SCALE_FEATURE = L"PageScaling"; - -LPCWSTR XDPrintSchema::PageScaling::SCALE_OPTIONS[EScaleOptionMax] = { - L"Custom", - L"CustomSquare", - L"FitApplicationBleedSizeToPageImageableSize", - L"FitApplicationContentSizeToPageImageableSize", - L"FitApplicationMediaSizeToPageImageableSize", - L"FitApplicationMediaSizeToPageMediaSize", - L"None" -}; - -LPCWSTR XDPrintSchema::PageScaling::CUST_SCALE_PROPS[] = { - L"OffsetWidth", - L"OffsetHeight", - L"ScaleWidth", - L"ScaleHeight" -}; - -LPCWSTR XDPrintSchema::PageScaling::CUST_SQR_SCALE_PROPS[] = { - L"OffsetWidth", - L"OffsetHeight", - L"Scale" -}; - -LPCWSTR XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_FEATURE = L"ScaleOffsetAlignment"; - -LPCWSTR XDPrintSchema::PageScaling::OffsetAlignment::SCALE_OFFSET_OPTIONS[] = { - L"BottomCenter", - L"BottomLeft", - L"BottomRight", - L"Center", - L"LeftCenter", - L"RightCenter", - L"TopCenter", - L"TopLeft", - L"TopRight" -}; - diff --git a/print/XPSDrvSmpl/src/common/pgscschema.h b/print/XPSDrvSmpl/src/common/pgscschema.h deleted file mode 100644 index d30c9c92..00000000 --- a/print/XPSDrvSmpl/src/common/pgscschema.h +++ /dev/null @@ -1,112 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscschema.h - -Abstract: - - PageScaling PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageScaling feature within - a XDPrintSchema::PageScaling namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageScaling elements described as Printschema keywords - // - namespace PageScaling - { - // - // The feature name - // - extern LPCWSTR SCALE_FEATURE; - - // - // Option names - // - enum EScaleOption - { - Custom = 0, EScaleOptionMin = 0, - CustomSquare, - FitBleedToImageable, - FitContentToImageable, - FitMediaToImageable, - FitMediaToMedia, - None, - EScaleOptionMax - }; - - extern LPCWSTR SCALE_OPTIONS[EScaleOptionMax]; - - // - // Custom scaling properties - // - enum ECustomScaleProps - { - CstOffsetWidth = 0, ECustomScalePropsMin = 0, - CstOffsetHeight, - CstScaleWidth, - CstScaleHeight, - ECustomScalePropsMax - }; - - extern LPCWSTR CUST_SCALE_PROPS[ECustomScalePropsMax]; - - // - // Custom square scaling properties - // - enum ECustomSquareScaleProps - { - CstSqOffsetWidth = 0, ECustomSquareScalePropsMin = 0, - CstSqOffsetHeight, - CstSqScale, - ECustomSquareScalePropsMax - }; - - extern LPCWSTR CUST_SQR_SCALE_PROPS[ECustomSquareScalePropsMax]; - - namespace OffsetAlignment - { - // - // The feature name - // - extern LPCWSTR SCALE_OFFSET_FEATURE; - - // - // Option names - // - enum EScaleOffsetOption - { - BottomCenter = 0, EScaleOffsetOptionMin = 0, - BottomLeft, - BottomRight, - Center, - LeftCenter, - RightCenter, - TopCenter, - TopLeft, - TopRight, - EScaleOffsetOptionMax - }; - - extern LPCWSTR SCALE_OFFSET_OPTIONS[EScaleOffsetOptionMax]; - } - } -} - diff --git a/print/XPSDrvSmpl/src/common/pimagedata.h b/print/XPSDrvSmpl/src/common/pimagedata.h deleted file mode 100644 index fc9a36c7..00000000 --- a/print/XPSDrvSmpl/src/common/pimagedata.h +++ /dev/null @@ -1,52 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pimagedata.h - -Abstract: - - PageImageableSize data structure definition. This provides a convenient - description of the PrintSchema PageImageableSize feature. - ---*/ - -#pragma once - -#include "pimageschema.h" - -namespace XDPrintSchema -{ - namespace PageImageableSize - { - struct PageImageableData - { - PageImageableData() : - imageableSizeWidth(0), - imageableSizeHeight(0), - originWidth(0), - originHeight(0), - extentWidth(0), - extentHeight(0) - { - } - - INT imageableSizeWidth; - INT imageableSizeHeight; - INT originWidth; - INT originHeight; - INT extentWidth; - INT extentHeight; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/pimagepthndlr.cpp b/print/XPSDrvSmpl/src/common/pimagepthndlr.cpp deleted file mode 100644 index 23013810..00000000 --- a/print/XPSDrvSmpl/src/common/pimagepthndlr.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pimagepthndlr.cpp - -Abstract: - - This class is responsible for retrieving the PageImageableSize properties from a - PrintCapabilities document. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "ptquerybld.h" -#include "pimagepthndlr.h" - -using XDPrintSchema::PageImageableSize::PageImageableData; -using XDPrintSchema::PageImageableSize::ImageableSizeWidth; -using XDPrintSchema::PageImageableSize::ImageableSizeHeight; -using XDPrintSchema::PageImageableSize::ImageableArea; -using XDPrintSchema::PageImageableSize::EPageImageablePropsMax; -using XDPrintSchema::PageImageableSize::OriginWidth; -using XDPrintSchema::PageImageableSize::OriginHeight; -using XDPrintSchema::PageImageableSize::ExtentWidth; -using XDPrintSchema::PageImageableSize::ExtentHeight; -using XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPERTY; -using XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS; -using XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS_AREA; - -/*++ - -Routine Name: - - CPageImageablePCHandler::CPageImageablePCHandler - -Routine Description: - - CPageImageablePCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CPageImageablePCHandler::CPageImageablePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CPageImageablePCHandler::~CPageImageablePCHandler - -Routine Description: - - CPageImageablePCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageImageablePCHandler::~CPageImageablePCHandler() -{ -} - -/*++ - -Routine Name: - - CPageImageablePCHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page imageable size - data retrieved from the PrintCapabilities passed to the class constructor. - -Arguments: - - pPageImageableData - Pointer to the page imageable size data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintCapabilities - E_* - On error - ---*/ -HRESULT -CPageImageablePCHandler::GetData( - _Inout_ PageImageableData* pPageImageableData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageImageableData, E_POINTER))) - { - CComBSTR bstrQuery; - CPTQueryBuilder queryImageableArea(m_bstrFrameworkPrefix); - - if (SUCCEEDED(hr = queryImageableArea.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPERTY))) && - SUCCEEDED(hr = queryImageableArea.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNode(bstrQuery))) - { - CPTQueryBuilder queryImageableSizeWidth(queryImageableArea); - CPTQueryBuilder queryImageableSizeHeight(queryImageableArea); - - if (SUCCEEDED(hr = queryImageableSizeWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableSizeWidth]))) && - SUCCEEDED(hr = queryImageableSizeHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableSizeHeight]))) && - SUCCEEDED(hr = queryImageableSizeWidth.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->imageableSizeWidth)) && - SUCCEEDED(hr = queryImageableSizeHeight.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->imageableSizeHeight))) - { - CPTQueryBuilder queryOriginWidth(queryImageableArea); - CPTQueryBuilder queryOriginHeight(queryImageableArea); - CPTQueryBuilder queryExtentWidth(queryImageableArea); - CPTQueryBuilder queryExtentHeight(queryImageableArea); - - if (SUCCEEDED(hr = queryOriginWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryOriginWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[OriginWidth]))) && - SUCCEEDED(hr = queryOriginHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryOriginHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[OriginHeight]))) && - SUCCEEDED(hr = queryExtentWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryExtentWidth.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[ExtentWidth]))) && - SUCCEEDED(hr = queryExtentHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS[ImageableArea]))) && - SUCCEEDED(hr = queryExtentHeight.AddProperty(m_bstrKeywordsPrefix, CComBSTR(PAGE_IMAGEABLE_PROPS_AREA[ExtentHeight]))) && - SUCCEEDED(hr = queryOriginWidth.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->originWidth)) && - SUCCEEDED(hr = queryOriginHeight.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->originHeight)) && - SUCCEEDED(hr = queryExtentWidth.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &pPageImageableData->extentWidth)) && - SUCCEEDED(hr = queryExtentHeight.GetQuery(&bstrQuery))) - { - hr = QueryNodeValue(bstrQuery, &pPageImageableData->extentHeight); - } - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pimagepthndlr.h b/print/XPSDrvSmpl/src/common/pimagepthndlr.h deleted file mode 100644 index 99d5025e..00000000 --- a/print/XPSDrvSmpl/src/common/pimagepthndlr.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pimagepthndlr.h - -Abstract: - - This class is responsible for retrieving the PageImageableSize properties from a - PrintCapabilities document. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "pimagedata.h" - -class CPageImageablePCHandler : public CPCHandler -{ -public: - CPageImageablePCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CPageImageablePCHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageImageableSize::PageImageableData* pPageImageableData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/pimageschema.cpp b/print/XPSDrvSmpl/src/common/pimageschema.cpp deleted file mode 100644 index bd9dd484..00000000 --- a/print/XPSDrvSmpl/src/common/pimageschema.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pimageschema.cpp - -Abstract: - - PageImageableSize PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageImageableSize feature. - ---*/ - -#include "precomp.h" -#include "pimageschema.h" - -LPCWSTR XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPERTY = L"PageImageableSize"; - -LPCWSTR XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS[] = { - L"ImageableSizeWidth", - L"ImageableSizeHeight", - L"ImageableArea" -}; - -LPCWSTR XDPrintSchema::PageImageableSize::PAGE_IMAGEABLE_PROPS_AREA[] = { - L"OriginWidth", - L"OriginHeight", - L"ExtentWidth", - L"ExtentHeight" -}; - diff --git a/print/XPSDrvSmpl/src/common/pimageschema.h b/print/XPSDrvSmpl/src/common/pimageschema.h deleted file mode 100644 index 760b1d2b..00000000 --- a/print/XPSDrvSmpl/src/common/pimageschema.h +++ /dev/null @@ -1,62 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pimageschema.h - -Abstract: - - PageImageableSize PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageImageableSize feature within - a XDPrintSchema::PageImageableSize namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageImageSize elements described as Printschema keywords - // - namespace PageImageableSize - { - // - // The property name - // - extern LPCWSTR PAGE_IMAGEABLE_PROPERTY; - - enum EPageImageableProps - { - ImageableSizeWidth = 0, EPageImageablePropsMin = 0, - ImageableSizeHeight, - ImageableArea, - EPageImageablePropsMax - }; - - extern LPCWSTR PAGE_IMAGEABLE_PROPS[EPageImageablePropsMax]; - - enum EPageImageablePropsArea - { - OriginWidth = 0, EPageImageablePropsAreaMin = 0, - OriginHeight, - ExtentWidth, - ExtentHeight, - EPageImageablePropsAreaMax - }; - - extern LPCWSTR PAGE_IMAGEABLE_PROPS_AREA[EPageImageablePropsAreaMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/porientdata.h b/print/XPSDrvSmpl/src/common/porientdata.h deleted file mode 100644 index 4e3a181d..00000000 --- a/print/XPSDrvSmpl/src/common/porientdata.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - porientdata.h - -Abstract: - - PageOrientation data structure definition. This provides a convenient - description of the PrintSchema PageOrientation feature. - ---*/ - -#pragma once - -#include "porientschema.h" - -namespace XDPrintSchema -{ - namespace PageOrientation - { - struct PageOrientationData - { - PageOrientationData() : - orientation(Landscape) - { - } - - EOrientationOption orientation; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/porientpthndlr.cpp b/print/XPSDrvSmpl/src/common/porientpthndlr.cpp deleted file mode 100644 index 52e3e7ed..00000000 --- a/print/XPSDrvSmpl/src/common/porientpthndlr.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - porientpthndlr.cpp - -Abstract: - - PageOrientation PrintTicket handler implementation. Derived from CPTHandler, - this provides a PageOrientation specific Get methods acting on the passed in - PrintTicket (as a DOM document). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "porientpthndlr.h" - -using XDPrintSchema::PageOrientation::PageOrientationData; -using XDPrintSchema::PageOrientation::EOrientationOption; -using XDPrintSchema::PageOrientation::EOrientationOptionMin; -using XDPrintSchema::PageOrientation::EOrientationOptionMax; -using XDPrintSchema::PageOrientation::ORIENTATION_FEATURE; -using XDPrintSchema::PageOrientation::ORIENTATION_OPTIONS; - -/*++ - -Routine Name: - - CPageOrientationPTHandler::CPageOrientationPTHandler - -Routine Description: - - CPageOrientationPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CPageOrientationPTHandler::CPageOrientationPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CPageOrientationPTHandler::~CPageOrientationPTHandler - -Routine Description: - - CPageOrientationPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageOrientationPTHandler::~CPageOrientationPTHandler() -{ -} - -/*++ - -Routine Name: - - CPageOrientationPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page orientation data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pPageOrientationData - Pointer to the page orientation data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CPageOrientationPTHandler::GetData( - _Inout_ PageOrientationData* pPageOrientationData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageOrientationData, E_POINTER))) - { - CComBSTR bstrPOOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(ORIENTATION_FEATURE), &bstrPOOption))) - { - for (EOrientationOption poOpt = EOrientationOptionMin; - poOpt < EOrientationOptionMax; - poOpt = static_cast(poOpt + 1)) - { - if (bstrPOOption == ORIENTATION_OPTIONS[poOpt]) - { - pPageOrientationData->orientation = poOpt; - break; - } - } - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pPageOrientationData->orientation < EOrientationOptionMin || - pPageOrientationData->orientation >= EOrientationOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/porientpthndlr.h b/print/XPSDrvSmpl/src/common/porientpthndlr.h deleted file mode 100644 index 138bbc0c..00000000 --- a/print/XPSDrvSmpl/src/common/porientpthndlr.h +++ /dev/null @@ -1,45 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - porientpthndlr.h - -Abstract: - - PageOrientation PrintTicket handling definition. The PageOrientation PT handler - is used to extract PageOrientation settings from a PrintTicket and populate - the PageOrientation data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "porientdata.h" - -class CPageOrientationPTHandler : public CPTHandler -{ -public: - CPageOrientationPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CPageOrientationPTHandler(); - - HRESULT - GetData( - _Inout_ XDPrintSchema::PageOrientation::PageOrientationData* pPageOrientationData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/porientschema.cpp b/print/XPSDrvSmpl/src/common/porientschema.cpp deleted file mode 100644 index 524001c1..00000000 --- a/print/XPSDrvSmpl/src/common/porientschema.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - porientschema.cpp - -Abstract: - - PageOrientation PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageOrientation feature. - ---*/ - -#include "precomp.h" -#include "porientschema.h" - -LPCWSTR XDPrintSchema::PageOrientation::ORIENTATION_FEATURE = L"PageOrientation"; - -LPCWSTR XDPrintSchema::PageOrientation::ORIENTATION_OPTIONS[EOrientationOptionMax] = { - L"Landscape", - L"Portrait", - L"ReverseLandscape", - L"ReversePortrait" -}; - diff --git a/print/XPSDrvSmpl/src/common/porientschema.h b/print/XPSDrvSmpl/src/common/porientschema.h deleted file mode 100644 index 2fdca11c..00000000 --- a/print/XPSDrvSmpl/src/common/porientschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - porientschema.h - -Abstract: - - PageOrientation PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageOrientation feature within - a XDPrintSchema::PageOrientation namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageOrientation elements described as Printschema keywords - // - namespace PageOrientation - { - // - // The feature name - // - extern LPCWSTR ORIENTATION_FEATURE; - - // - // Paper orientation options - // - enum EOrientationOption - { - Landscape = 0, EOrientationOptionMin = 0, - Portrait, - ReverseLandscape, - ReversePortrait, - EOrientationOptionMax - }; - - extern LPCWSTR ORIENTATION_OPTIONS[EOrientationOptionMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/precomp.h b/print/XPSDrvSmpl/src/common/precomp.h deleted file mode 100644 index d871a9fd..00000000 --- a/print/XPSDrvSmpl/src/common/precomp.h +++ /dev/null @@ -1,102 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - precomp.h - -Abstract: - - Precompiled header for all filters - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include -#include - -// -// COM includes -// -#include -#include - -// -// ATL Includes -// -#include - - -#pragma warning (push) -#pragma warning (disable:4458) -// -// GDIPlus includes -// -#include -#pragma warning (pop) - -// -// MSXML includes -// -#include - -// -// WCS Includes -// -#include - -// -// Filter pipeline includes -// -#include -#include -#include -#include - -// -// Standard library includes -// -#include -#include -#include -#include -#include - -// -// Commonly used namespaces -// -using namespace std; -using namespace Gdiplus; - -// -// String safe includes - included last to prevent build warnings -// -#include - -#include "common.ver" diff --git a/print/XPSDrvSmpl/src/common/precompsrc.cpp b/print/XPSDrvSmpl/src/common/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/common/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/common/privatedefs.h b/print/XPSDrvSmpl/src/common/privatedefs.h deleted file mode 100644 index 0c8cb96d..00000000 --- a/print/XPSDrvSmpl/src/common/privatedefs.h +++ /dev/null @@ -1,300 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - privatedefs.h - -Abstract: - - Definitions for private PrintTicket/PrintCapabilities properties for watermark and page scaling features. - ---*/ - -#pragma once - -// -// Macro to return the number of elements in an array -// -#define numof(n) (sizeof(n) / sizeof(n[0])) - -// -// Structure definition for the Private Parameter Defs (Integer Type) -// -typedef struct _PRIVATE_DEF_INTS -{ - PCSTR property_name; - BOOL is_public; - PCSTR display_name; - INT default_value; - INT min_length; - INT max_length; - INT multiple; - PCSTR unit_type; -}PRIVATE_DEF_INTEGERS; - -// -// Structure definition for the Private Parameter Defs (String Type) -// -typedef struct _PRIVATE_DEF_STRS -{ - PCSTR property_name; - PCSTR display_name; - PCSTR default_value; - INT min_length; - INT max_length; - PCSTR unit_type; -}PRIVATE_DEF_STRINGS; - -// -// Structure definition for the Private Parameter Defs (Decimal Type) -// -typedef struct _PRIVATE_DEF_DECS -{ - PCSTR property_name; - PCSTR display_name; - REAL default_value; - REAL min_length; - REAL max_length; - REAL multiple; - PCSTR unit_type; -}PRIVATE_DEF_DECIMALS; - -// -// Table of values for private integer watermark properties. -// -CONST PRIVATE_DEF_INTEGERS wmParamDefIntegers[] = -{ - { - "PageWatermarkTextAngle", - TRUE, - NULL, - 0, - 0, - 360, - 1, - "Degrees" - }, - { - "PageWatermarkOriginWidth", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkOriginHeight", - TRUE, - NULL, - HUNDREDTH_OFINCH_TO_MICRON(100), - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkSizeWidth", - FALSE, - NULL, - HUNDREDTH_OFINCH_TO_MICRON(100), - 0, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkSizeHeight", - FALSE, - NULL, - HUNDREDTH_OFINCH_TO_MICRON(100), - 0, - INT_MAX, - 1, - "Microns" - }, - { - "PageWatermarkTextFontSize", - TRUE, - NULL, - 72, - 1, - INT_MAX, - 1, - "Points Per Inch" - }, - { - "PageWatermarkTextColor", - TRUE, - NULL, - (INT) 0xFFFF0000, - 0, - (INT) 0xFFFFFFFF, - 1, - "sRGB" - }, - { - "PageWatermarkTransparency", - TRUE, - NULL, - 50, - 0, - 100, - 1, - "Transparency" - }, -}; - -// -// enum lookup into above table -// -enum eWMParamDefIntegers -{ - ePageWatermarkAngle = 0, - ePageWatermarkOriginWidth, - ePageWatermarkOriginHeight, - ePageWatermarkSizeWidth, - ePageWatermarkSizeHeight, - ePageWatermarkTextFontSize, - ePageWatermarkTextColor, - ePageWatermarkTransparency, -}; - -// -// Table of values for private string watermark properties. -// -CONST PRIVATE_DEF_STRINGS wmParamDefStrings[] = -{ - { - "PageWatermarkTextText", - NULL, - "CONFIDENTIAL", - 0, - 20, - "characters" - } -}; - -// -// enum lookup into above table -// -enum eWMParamDefStrings -{ - ePageWatermarkTextText = 0 -}; - -// -// Table of values for private integer page scaling properties. -// -CONST PRIVATE_DEF_INTEGERS pgscParamDefIntegers[] = -{ - { - "PageScalingScaleWidth", - TRUE, - NULL, - 100, - 1, - 1000, - 1, - "Percent" - }, - { - "PageScalingScaleHeight", - TRUE, - NULL, - 100, - 1, - 1000, - 1, - "Percent" - }, - { - "PageScalingScale", - TRUE, - NULL, - 100, - 1, - 1000, - 1, - "Percent" - }, - { - "PageScalingOffsetWidth", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, - { - "PageScalingOffsetHeight", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 1, - "Microns" - }, -}; - -// -// enum lookup into above table -// -enum ePGSCParamDefIntegers -{ - ePageScalingScaleWidth = 0, - ePageScalingScaleHeight, - ePageScalingScale, - ePageScalingOffsetWidth, - ePageScalingOffsetHeight, -}; - -// -// Table of values for private integer booklet gutter properties. -// -CONST PRIVATE_DEF_INTEGERS bkParamDefIntegers[] = -{ - { - "JobBindAllDocumentsGutter", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 0, - "Microns" - }, - { - "DocumentBindingGutter", - TRUE, - NULL, - 0, - -INT_MAX, - INT_MAX, - 0, - "Microns" - } -}; - -// -// enum lookup into above table -// -enum eBindingParamDefIntegers -{ - eJobBindAllDocumentsGutter = 0, - eDocumentBindingGutter, -}; - diff --git a/print/XPSDrvSmpl/src/common/pshndlr.cpp b/print/XPSDrvSmpl/src/common/pshndlr.cpp deleted file mode 100644 index 90acda70..00000000 --- a/print/XPSDrvSmpl/src/common/pshndlr.cpp +++ /dev/null @@ -1,1836 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pshndlr.cpp - -Abstract: - - Base PrintSchema Document handler class implementation. - This class provides common PrintTicket / PrintCapabilities handling functionality. - A class can derive from this base class to get PrintTicket/PrintCapabilities - unspecific XML handling functionality. - - Note: The PrintSchema handler code is only intended to work with the sdtandard - public PrintSchema keywords. - ---*/ - - -// -// Note on handling missing DOM nodes: -// -// Convert MSXML's S_FALSE to E_ELEMENT_NOT_FOUND. This allows clients to -// use the SUCCEEDED macro more effectively. -// -// E_ELEMENT_NOT_FOUND should not be propogated as an error to the -// filter pipeline or config module - treat as though the requested feature -// has not been enabled. -// - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pshndlr.h" - -using XDPrintSchema::FRAMEWORK_URI; -using XDPrintSchema::KEYWORDS_URI; -using XDPrintSchema::SCHEMA_INST_URI; -using XDPrintSchema::SCHEMA_DEF_URI; -using XDPrintSchema::PROPERTY_ELEMENT_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::VALUE_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_TYPE; -using XDPrintSchema::SCORED_PROP_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_STRING; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::SCHEMA_DECIMAL; -using XDPrintSchema::PARAM_REF_ELEMENT_NAME; -using XDPrintSchema::PARAM_INIT_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_INST_URI; - -static LPCWSTR szSelectNS = L"SelectionNamespaces"; -static LPCWSTR szTmpNS = L"psf"; -static LPCWSTR szNSSelection = L"xmlns:%s='%s'"; -static LPCWSTR szSelectLang = L"SelectionLanguage"; -static LPCWSTR szLangSection = L"XPath"; - -static LPCWSTR szPTRootQuery = L"//%s:%s"; - -/*++ - -Routine Name: - - CPSHandler::CPSHandler - -Routine Description: - - CPSHandler class constructor - -Arguments: - - pDOMDocument - Pointer to the DOM document representation of the PrintTicket/PrintCapabilities - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CPSHandler::CPSHandler( - _In_z_ BSTR bstrDocumentType, - _In_ IXMLDOMDocument2 *pPrintDocument - ) : - m_bstrDocumentType(bstrDocumentType), - m_pPrintDocument(pPrintDocument) -{ - ASSERTMSG(m_pPrintDocument != NULL, "NULL PrintDocument passed to PS manager.\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPrintDocument, E_PENDING))) - { - try - { - // - // Make sure XPath selection language is set - // - if (SUCCEEDED(hr = m_pPrintDocument->setProperty(CComBSTR(szSelectLang), CComVariant(szLangSection)))) - { - // - // Construct the alias namespace string - // - CStringXDW cstrNamespaces; - cstrNamespaces.Format(szNSSelection, szTmpNS, FRAMEWORK_URI); - - // - // Specify an alias PrintSchema namespace prefix to allow us to find the real ones - // - if (SUCCEEDED(hr = m_pPrintDocument->setProperty(CComBSTR(szSelectNS), CComVariant(cstrNamespaces)))) - { - if (SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(FRAMEWORK_URI), &m_bstrFrameworkPrefix)) && - SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(KEYWORDS_URI), &m_bstrKeywordsPrefix)) && - SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(SCHEMA_INST_URI), &m_bstrSchemaInstPrefix)) && - SUCCEEDED(hr = GetPrefixFromURI(CComBSTR(SCHEMA_DEF_URI), &m_bstrSchemaPrefix))) - { - CStringXDW cstrNSUserPrefix(L"ns0000:"); - m_bstrUserKeywordsPrefix.Empty(); - m_bstrUserKeywordsPrefix.Attach(cstrNSUserPrefix.AllocSysString()); - - // - // Restore the original namespace prefix for the PrintSchema framework - // - CComBSTR bstrOrgNamespaces; - CStringXDW cstrNSPrefix(m_bstrFrameworkPrefix); - - INT iIndex = cstrNSPrefix.Find(L":"); - if (iIndex != -1 && - cstrNSPrefix.Delete(iIndex, 1) > 0) - { - CStringXDW cstrOrgNamespaces; - cstrOrgNamespaces.Format(szNSSelection, static_cast(cstrNSPrefix), FRAMEWORK_URI); - - hr = m_pPrintDocument->setProperty(CComBSTR(szSelectNS), CComVariant(cstrOrgNamespaces)); - } - else - { - RIP("Could not create namespace prefix correctly\n"); - hr = E_FAIL; - } - } - } - else - { - ERR("Failed to set SelectionNamespaces.\n"); - } - } - else - { - RIP("Failed to set SelectionLanguage.\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CPSHandler::~CPSHandler - -Routine Description: - - CPSHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPSHandler::~CPSHandler() -{ -} - -/*++ - -Routine Name: - - CPSHandler::DeleteNode - -Routine Description: - - This routine deletes the given node from the PrintDocument - -Arguments: - - pNode - Pointer to the DOM node to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::DeleteNode( - _In_ IXMLDOMNode* pNode - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNode, E_POINTER))) - { - CComPtr pParentNode(NULL); - CComPtr pDeletedNode(NULL); - - if (SUCCEEDED(hr = pNode->get_parentNode(&pParentNode)) && - hr != S_FALSE && - SUCCEEDED(hr = pParentNode->removeChild(pNode, &pDeletedNode)) && - pDeletedNode == NULL) - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetNode - -Routine Description: - - This routine retrieves a node given an XPath query - -Arguments: - - bstrNodeQuery - The XPath query for a node - ppNode - Pointer to an IXMLDOMNode pointer that recieves the node retrieved - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetNode( - _In_z_ BSTR bstrNodeQuery, - _Outptr_ IXMLDOMNode** ppNode - ) -{ - // - // We should have the PrintDocment in place - // - ASSERTMSG(m_pPrintDocument != NULL, "NULL PS detected whilst retrieving node.\n"); - - // - // Method which takes a query string and returns the first node that matches - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppNode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPrintDocument, E_PENDING))) - { - *ppNode = NULL; - if (SysStringLen(bstrNodeQuery) == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Get the node from the PrintDocument - // - hr = m_pPrintDocument->selectSingleNode(bstrNodeQuery, ppNode); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::DeletePrivateFeatures - -Routine Description: - - This routine finds and deletes features with values defined in the - private namespace passed in - -Arguments: - - bstrPrivateNS - the private namespace - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::DeletePrivateFeatures( - _In_z_ BSTR bstrPrivateNS - ) -{ - HRESULT hr = S_OK; - - if (SysStringLen(bstrPrivateNS) > 0) - { - CComBSTR bstrNSPrefix; - if (SUCCEEDED(hr = GetPrefixFromURI(bstrPrivateNS, &bstrNSPrefix))) - { - // - // Find all root feature elements in the namespace - // - CComPtr pNodeList(NULL); - - CComBSTR bstrFeatureQuery(L"//"); - bstrFeatureQuery += m_bstrFrameworkPrefix; - bstrFeatureQuery += L"Feature"; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pPrintDocument->selectNodes(bstrFeatureQuery, &pNodeList)) && - SUCCEEDED(hr = pNodeList->reset())) - { - // - // Delete all the feature with name attributes using the private namespace - // - CComPtr pDeleteNode(NULL); - - while (SUCCEEDED(hr) && - SUCCEEDED(hr = pNodeList->nextNode(&pDeleteNode)) && - hr != S_FALSE) - { - CComPtr pDeleteNodeAtts(NULL); - CComPtr pNameNode(NULL); - CComVariant varNameValue; - - if (SUCCEEDED(hr = pDeleteNode->get_attributes(&pDeleteNodeAtts)) && - hr != S_FALSE && - SUCCEEDED(hr = pDeleteNodeAtts->getNamedItem(CComBSTR(L"name"), &pNameNode)) && - hr != S_FALSE && - SUCCEEDED(hr = pNameNode->get_nodeValue(&varNameValue)) && - hr != S_FALSE) - { - try - { - CStringXDW cstrNameValue(varNameValue.bstrVal); - - if (cstrNameValue.Find(bstrNSPrefix) == 0) - { - hr = DeleteNode(pDeleteNode); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - pDeleteNode = NULL; - } - } - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateProperty - -Routine Description: - - This routine creates a property element of the given name. Note: this - method only creates the property element; it is up to the caller to - set the property value - -Arguments: - - bstrPropName - The name of the property - ppPropElement - Pointer to a IXMLDOMElement pointer that recieves the newly created Property element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - *ppPropElement = NULL; - - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += PROPERTY_ELEMENT_NAME; - - CComBSTR bstrAttribName(szTmpNS); - bstrAttribName += L":"; - bstrAttribName += bstrPropName; - - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, ppPropElement); - - if (SUCCEEDED(hr)) - { - if (*ppPropElement != NULL) - { - hr = CreateXMLAttribute(*ppPropElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateProperty - -Routine Description: - - This routine creates a property element of the given name. - -Arguments: - - bstrPropName - The name of the property to be created - bstrType - The type of the property value (integer, string etc.) - bstrValue - The value of the property - ppPropElement - Pointer to an IXMLDOMElement pointer that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the scored property and value node - // - if (SUCCEEDED(hr = CreateProperty(bstrPropName, ppPropElement))) - { - CComPtr pValue(NULL); - - CComBSTR bstrValueElement(m_bstrFrameworkPrefix); - bstrValueElement += VALUE_ELEMENT_NAME; - - CComBSTR bstrTypeAttribName(m_bstrSchemaInstPrefix); - bstrTypeAttribName += SCHEMA_TYPE; - - CComBSTR bstrTypeAttribValue(m_bstrSchemaPrefix); - bstrTypeAttribValue += bstrType; - - hr = CreateXMLElement(bstrValueElement, FRAMEWORK_URI, &pValue); - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrTypeAttribName, SCHEMA_INST_URI, bstrTypeAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = (*ppPropElement)->appendChild(pValue, NULL); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateFWProperty - -Routine Description: - - This routine creates a property element of the given name. Note: this - method only creates the property element; it is up to the caller to - set the property value - -Arguments: - - bstrPropName - The name of the property - ppPropElement - Pointer to a IXMLDOMElement pointer that recieves the newly created Property element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - *ppPropElement = NULL; - - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += PROPERTY_ELEMENT_NAME; - - CComBSTR bstrAttribName(m_bstrFrameworkPrefix); - bstrAttribName += bstrPropName; - - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, ppPropElement); - - if (SUCCEEDED(hr)) - { - if (*ppPropElement != NULL) - { - hr = CreateXMLAttribute(*ppPropElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateFWProperty - -Routine Description: - - This routine creates a property element of the given name. - -Arguments: - - bstrPropName - The name of the property to be created - bstrType - The type of the property value (integer, string etc.) - bstrValue - The value of the property - ppPropElement - Pointer to an IXMLDOMElement pointer that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the scored property and value node - // - if (SUCCEEDED(hr = CreateFWProperty(bstrPropName, ppPropElement))) - { - CComPtr pValue(NULL); - - CComBSTR bstrValueElement(m_bstrFrameworkPrefix); - bstrValueElement += VALUE_ELEMENT_NAME; - - CComBSTR bstrTypeAttribName(m_bstrSchemaInstPrefix); - bstrTypeAttribName += SCHEMA_TYPE; - - CComBSTR bstrTypeAttribValue(m_bstrSchemaPrefix); - bstrTypeAttribValue += bstrType; - - hr = CreateXMLElement(bstrValueElement, FRAMEWORK_URI, &pValue); - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrTypeAttribName, SCHEMA_INST_URI, bstrTypeAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = (*ppPropElement)->appendChild(pValue, NULL); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property. Note: this does not intialise - the scored property value - this is the responsibility of the caller - -Arguments: - - bstrPropName - The name of the property element to be created - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - *ppScoredPropElement = NULL; - - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += SCORED_PROP_ELEMENT_NAME; - - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += bstrPropName; - - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, ppScoredPropElement); - - if (SUCCEEDED(hr)) - { - if (*ppScoredPropElement != NULL) - { - hr = CreateXMLAttribute(*ppScoredPropElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property. - -Arguments: - - bstrPropName - The name of the property element to be created - bstrType - The type of the value to be created (integer, string etc.) - bstrValue - The value to be set as a string - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the scored property and value node - // - if (SUCCEEDED(hr = CreateScoredProperty(bstrPropName, ppScoredPropElement))) - { - CComPtr pValue(NULL); - - CComBSTR bstrValueElement(m_bstrFrameworkPrefix); - bstrValueElement += VALUE_ELEMENT_NAME; - - CComBSTR bstrTypeAttribName(m_bstrSchemaInstPrefix); - bstrTypeAttribName += SCHEMA_TYPE; - - CComBSTR bstrTypeAttribValue(m_bstrSchemaPrefix); - bstrTypeAttribValue += bstrType; - - hr = CreateXMLElement(bstrValueElement, FRAMEWORK_URI, &pValue); - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrTypeAttribName, SCHEMA_INST_URI, bstrTypeAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = (*ppScoredPropElement)->appendChild(pValue, NULL); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property of type string. - -Arguments: - - bstrPropName - The name of the property element to be created - bstrValue - The string value to be set - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) > 0 && - SysStringLen(bstrValue) > 0) - { - // - // Create the scored property and value node - // - hr = CreateScoredProperty(bstrPropName, CComBSTR(SCHEMA_STRING), bstrValue, ppScoredPropElement); - } - else - { - hr = E_INVALIDARG; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property of type INT. - -Arguments: - - bstrPropName - The name of the property element to be created - intValue - The INT value to be set - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Construct the value string - // - CStringXDW cstrValue; - cstrValue.Format(L"%i", intValue); - - // - // Create the scored property and value node - // - hr = CreateScoredProperty(bstrPropName, - CComBSTR(SCHEMA_INTEGER), - CComBSTR(cstrValue.AllocSysString()), - ppScoredPropElement); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property of type REAL. - -Arguments: - - bstrPropName - The name of the property element to be created - realValue - The REAL value to be set - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST REAL realValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Construct the value string - // - CStringXDW cstrValue; - cstrValue.Format(L"%.2f", realValue); - - // - // Create the scored property and value node - // - hr = CreateScoredProperty(bstrPropName, - CComBSTR(SCHEMA_DECIMAL), - CComBSTR(cstrValue.AllocSysString()), - ppScoredPropElement); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNode - -Routine Description: - - This routine checks for the existence of a node given the XPath - query passed in - -Arguments: - - bstrQuery - The XPath query defining the node or nodes to be located - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNode( - _In_z_ BSTR bstrQuery - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SysStringLen(bstrQuery) > 0) - { - CComPtr pNode(NULL); - - hr = GetNode(bstrQuery, &pNode); - } - else - { - hr = E_INVALIDARG; - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNodeValue - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "value" attribute as a string. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pbstrOption - Pointer to a BSTR to recieve the value string - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - *pbstrValue = NULL; - - if (SysStringLen(bstrQuery) > 0) - { - hr = GetNodeValue(bstrQuery, pbstrValue); - } - else - { - hr = E_INVALIDARG; - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNodeValue - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "value" attribute as an INT. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pValue - Pointer to an INT to recieve the value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ INT* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &bstrValue))) - { - *pValue = static_cast(_wtoi(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::QueryNodeValue - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "value" attribute as a REAL. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pValue - Pointer to a REAL to recieve the value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ REAL* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = QueryNodeValue(bstrQuery, &bstrValue))) - { - *pValue = static_cast(_wtof(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetNodeValue - -Routine Description: - - This routine retrieves the value of a node given the XPath query to the node - -Arguments: - - bstrNodeQuery - The XPath query for the node from which the value should be retrieved - pbstrValue - Pointer to ta BSTR that recieves the value of the node - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - -Note: - - The annotation for pbstrValue is intended to express that the BSTR may - be NULL when S_FALSE is returned, but not when S_OK is returned. - - In any case, when a failure HRESULT is returned, all out parameter - annotations are ignored. - ---*/ -HRESULT -CPSHandler::GetNodeValue( - _In_z_ BSTR bstrNodeQuery, - _Inout_ _At_(*pbstrValue, _Pre_maybenull_) - _When_(return == S_FALSE, _At_(*pbstrValue, _Post_maybenull_)) - _When_(return != S_FALSE, _At_(*pbstrValue, _Post_valid_)) - BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - CComPtr pFeatureNode(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - SysFreeString(*pbstrValue); - *pbstrValue = NULL; - if (SysStringLen(bstrNodeQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetNode(bstrNodeQuery, &pFeatureNode)) && - hr != S_FALSE) - { - // - // Scored properties can either be defined as "Value" or "ParameterRef" - // Find out which of these applies to this property and handle accordingly - // - CComBSTR bstrValue(m_bstrFrameworkPrefix); - bstrValue += VALUE_ELEMENT_NAME; - - CComBSTR bstrParamRef(m_bstrFrameworkPrefix); - bstrParamRef += PARAM_REF_ELEMENT_NAME; - - CComVariant varValue; - - CComPtr pPropertyNode(NULL); - if (SUCCEEDED(hr = pFeatureNode->selectSingleNode(bstrValue, &pPropertyNode)) && - hr != S_FALSE) - { - // - // Value node. Just retrieve the node value - // - hr = pPropertyNode->get_nodeTypedValue(&varValue); - } - else if (SUCCEEDED(hr = pFeatureNode->selectSingleNode(bstrParamRef, &pPropertyNode)) && - hr != S_FALSE) - { - // - // Property defined by parameter ref. Retrieve the name and look up the value - // from the parameter init elements - // - CComPtr pParamInitList(NULL); - CComBSTR bstrParamRefValue; - - if (SUCCEEDED(hr = GetAttributeValue(pPropertyNode, CComBSTR(NAME_ATTRIBUTE_NAME), &bstrParamRefValue)) && - hr != S_FALSE && - SUCCEEDED(hr = GetNodes(CComBSTR(PARAM_INIT_ELEMENT_NAME), &pParamInitList)) && - hr != S_FALSE) - { - CComBSTR bstrParamInit; - CComPtr pInitNode(NULL); - - hr = pParamInitList->reset(); - - while (SUCCEEDED(hr) && - hr != S_FALSE) - { - if (SUCCEEDED(hr = pParamInitList->nextNode(&pInitNode)) && hr != S_FALSE && pInitNode != NULL) - { - hr = GetAttributeValue(pInitNode, CComBSTR(NAME_ATTRIBUTE_NAME), &bstrParamInit); - if (SUCCEEDED(hr) && bstrParamInit == bstrParamRefValue) - { - hr = pInitNode->get_nodeTypedValue(&varValue); - break; - } - } - - - // - // Release the node and name before getting the next - // - pInitNode = NULL; - bstrParamInit.Empty(); - } - } - } - - if (SUCCEEDED(hr) && - hr != S_FALSE && - SysStringLen(varValue.bstrVal) > 0) - { - *pbstrValue = ::SysAllocString(varValue.bstrVal); - - if (*pbstrValue == NULL) - { - hr = E_OUTOFMEMORY; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetAttributeValue - -Routine Description: - - This routine retrieves the value of a named attribute as a string from a DOM node - -Arguments: - - pNode - Pointer to the DOM node to retrieve the attribute value from - bstrAttribName - The name of the attribute - pbstrResult - Pointer to a BSTR that recieves the attribute value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetAttributeValue( - _In_ CONST IXMLDOMNode* pNode, - _In_z_ BSTR bstrAttribName, - _Outptr_result_maybenull_ BSTR* pbstrResult - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrResult, E_POINTER))) - { - if (SysStringLen(bstrAttribName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - *pbstrResult = NULL; - - // - // Map the associated attributes and get the string result - // - CComPtr pIXMLDOMNamedNodeMap(NULL); - CComPtr pSubNode(NULL); - - if (SUCCEEDED(hr = const_cast(pNode)->get_attributes(&pIXMLDOMNamedNodeMap)) && - hr != S_FALSE && - SUCCEEDED(hr = pIXMLDOMNamedNodeMap->getNamedItem(bstrAttribName, &pSubNode)) && - hr != S_FALSE) - { - hr = pSubNode->get_text(pbstrResult); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetNodes - -Routine Description: - - This routine returns a list of all the nodes in the PrintTicket with the - specified element name - -Arguments: - - ppParamInit - Pointer to an IXMLDOMNodeList pointer that recieves the node list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetNodes( - _In_ BSTR bstrElementName, - _Outptr_ IXMLDOMNodeList** ppNodeList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppNodeList, E_POINTER))) - { - if (SysStringLen(bstrElementName) > 0) - { - *ppNodeList = NULL; - - // - // Retrieve all psf:ParameterInit nodes in the PrintTicket - // - CComBSTR bstrParamInitQuery(L"//"); - bstrParamInitQuery += m_bstrFrameworkPrefix; - bstrParamInitQuery += bstrElementName; - - hr = m_pPrintDocument->selectNodes(bstrParamInitQuery, ppNodeList); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::CreateScoredProperty - -Routine Description: - - This routine creates a scored property using the value node passed in. - -Arguments: - - bstrPropName - The name of the property element to be created - pValueNode - Pointer to the IXMLDOMNode that represents the scored property value - ppScoredPropElement - Pointer to an IXMLDOMElement that recieves the new element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ IXMLDOMNode* pValueNode, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters then create the scored property and value node - // - if (SUCCEEDED(hr = CHECK_POINTER(pValueNode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppScoredPropElement, E_POINTER))) - { - if (SysStringLen(bstrPropName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateScoredProperty(bstrPropName, ppScoredPropElement))) - { - hr = (*ppScoredPropElement)->appendChild(pValueNode, NULL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPSHandler::GetPrefixFromURI - -Routine Description: - - Obtains the Prefix associated with a Namespace URI from an XML PrintSchema Document. - -Arguments: - - bstrNamespaceURI - Namespace URI to be used in look-up. - bstrNamespacePrefix - Namespace Prefix to be returned. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPSHandler::GetPrefixFromURI( - _In_z_ BSTR bstrNamespaceURI, - _Outptr_result_maybenull_ BSTR* bstrNamespacePrefix - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(bstrNamespacePrefix, E_POINTER))) - { - if (SysStringLen(bstrNamespaceURI) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - *bstrNamespacePrefix = NULL; - - try - { - // - // Construct the Root Query string - // - CStringXDW cstrRootQuery; - cstrRootQuery.Format(szPTRootQuery, szTmpNS, static_cast(m_bstrDocumentType)); - - // - // Find the PrintSchema element so we can retrieve the private namespace prefix - // - CComPtr pPTNode(NULL); - CComPtr pPTAtts(NULL); - - if (SUCCEEDED(hr = GetNode(CComBSTR(cstrRootQuery), &pPTNode)) && - hr != S_FALSE && - SUCCEEDED(hr = pPTNode->get_attributes(&pPTAtts)) && - SUCCEEDED(hr = pPTAtts->reset())) - { - // - // Iterate over all attributes and match the node value against - // the namespace URI - // - BOOL bMatched = FALSE; - CComPtr pAttNode(NULL); - - while (SUCCEEDED(hr) && - !bMatched && - SUCCEEDED(hr = pPTAtts->nextNode(&pAttNode)) && - hr != S_FALSE) - { - CComVariant varValue; - - if (SUCCEEDED(hr = pAttNode->get_nodeValue(&varValue))) - { - if (CComBSTR(varValue.bstrVal) == bstrNamespaceURI) - { - bMatched = TRUE; - } - } - - if (!bMatched) - { - // - // No match - free the attribute node before retrieving the next - // - pAttNode = NULL; - } - } - - if (SUCCEEDED(hr) && - bMatched) - { - // - // If we match then get the node name and strip xmlns: to derive - // the private namespace prefix - // - CStringXDW cstrNSPrefix; - CComBSTR bstrNodeName; - - if (SUCCEEDED(hr = pAttNode->get_nodeName(&bstrNodeName))) - { - cstrNSPrefix = bstrNodeName; - CStringXDW cstrXMLNS(L"xmlns:"); - - if (cstrNSPrefix.Find(cstrXMLNS) != 0 || - cstrNSPrefix.Delete(0, cstrXMLNS.GetLength()) <= 0) - { - ERR("Could not create private namespace prefix correctly\n"); - - hr = E_FAIL; - } - else - { - cstrNSPrefix += L":"; - - SysFreeString(*bstrNamespacePrefix); - *bstrNamespacePrefix = cstrNSPrefix.AllocSysString(); - } - } - } - } - else - { - ERR("Failed to find the PC root element.\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -HRESULT -CPSHandler::CreateXMLAttribute( - _Inout_ IXMLDOMElement *pTarget, - _In_ PCWSTR pszName, - _In_opt_ PCWSTR pszTargetURI, - _In_ PCWSTR pszValue - ) -/*++ - -Routine Description: - - This routine adds a new attribute to the given XML element. The URI - parameter must be present, but may be an empty string. - - If this routine fails, the document being constructed should be - considered invalid, and be thrown out in its entirity. - - The newly created attribute will be appended to the list of attributes on the element - -Arguments: - - pTarget - the element to which the attribute is to be added - pszName - the name of the attribtue - pszTargetURI - the URI in which the attribute should reside - pszValue - the value to put in the attribute - -Returns: - - S_OK on success, else - E_* on failure - ---*/ -{ - HRESULT hr = S_OK; - CComPtr pCurrentAttr; - CComPtr pCurrentNode; - - if( !( pTarget && pszName && pszValue ) ) - { - hr = E_INVALIDARG; - } - - if(SUCCEEDED(hr)) - { - VARIANT type; - VariantInit( &type ); - V_VT(&type) = VT_I4; - V_I4(&type) = NODE_ATTRIBUTE; - - hr = m_pPrintDocument->createNode(type, const_cast(pszName), const_cast(pszTargetURI), &pCurrentNode); - - VariantClear( &type ); - } - - if( SUCCEEDED(hr) ) - { - hr = pCurrentNode->QueryInterface( IID_IXMLDOMAttribute, (void**)&pCurrentAttr ); - } - - if( SUCCEEDED(hr) ) - { - VARIANT attrVal; - BSTR bstrValue = SysAllocString(pszValue); - - if( bstrValue ) - { - VariantInit(&attrVal); - V_VT(&attrVal) = VT_BSTR; - V_BSTR(&attrVal) = bstrValue; - hr = pCurrentAttr->put_value(attrVal); - - if( SUCCEEDED(hr) ) - { - hr = VariantClear(&attrVal); - } - else - { - VariantClear(&attrVal); - } - } - else - { - hr = E_OUTOFMEMORY; - } - } - - if( SUCCEEDED(hr) ) - { - hr = pTarget->setAttributeNode( pCurrentAttr, NULL ); - } - - return hr; -} - -HRESULT -CPSHandler::CreateXMLElement( - _In_ PCWSTR pszName, - _In_ PCWSTR pszTargetURI, - _Out_opt_ IXMLDOMElement **ppEl - ) -/*++ - -Routine Description: - - Create a new DOM element using the given QName and URI. Implemented using DOMDocument->CreateNode. - -Arguments: - - pszName - The QName of the element to be created - pszTargetUri - The namespace in which the created element lives. The - caller does not have control over the prefix... just the URI - ppEl - If the caller needs a pointer to the newly created node, this should - be a non-null - -Return Value: - - S_OK on success, - E_* on failure. Common values that would be expected - include E_OUTOFMEMORY, and E_INVALIDARG. - ---*/ -{ - HRESULT hr = S_OK; - CComPtr pCurrentNode; - - if( !( pszName && pszTargetURI ) ) - { - hr = E_INVALIDARG; - } - - if(SUCCEEDED(hr)) - { - VARIANT type; - VariantInit( &type ); - V_VT(&type) = VT_I4; - V_I4(&type) = NODE_ELEMENT; - hr = m_pPrintDocument->createNode( type, const_cast(pszName), const_cast(pszTargetURI), &pCurrentNode ); - VariantClear( &type ); - } - - // - // Only give the client back the new value element if we succeed. - // - if( SUCCEEDED(hr) && ppEl ) - { - hr = pCurrentNode->QueryInterface( IID_IXMLDOMElement, (void**)ppEl ); - } - - return hr; -} diff --git a/print/XPSDrvSmpl/src/common/pshndlr.h b/print/XPSDrvSmpl/src/common/pshndlr.h deleted file mode 100644 index 22d76863..00000000 --- a/print/XPSDrvSmpl/src/common/pshndlr.h +++ /dev/null @@ -1,218 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pshndlr.h - -Abstract: - - Base PrintSchema Document handler class definition. - This class provides common PrintTicket / PrintCapabilities handling functionality. - A class can derive from this base class to get PrintTicket/PrintCapabilities - unspecific XML handling functionality. - - Note: The PrintSchema handler code is only intended to work with the sdtandard - public PrintSchema keywords. - ---*/ - -#pragma once - -#include "schema.h" - -typedef vector< CComPtr > PTDOMElementVector; - -class CPSHandler -{ -public: - // - // Constructors and destructors - // - CPSHandler( - _In_z_ BSTR bstrDocumentType, - _In_ IXMLDOMDocument2 *pPrintDocument - ); - - virtual ~CPSHandler(); - -public: - HRESULT - DeleteNode( - _In_ IXMLDOMNode* pNode - ); - - HRESULT - DeletePrivateFeatures( - _In_z_ BSTR bstrPrivateNS - ); - -protected: - HRESULT - QueryNode( - _In_z_ BSTR bstrQuery - ); - - HRESULT - QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Outptr_ BSTR* pbstrValue - ); - - HRESULT - QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ REAL* pValue - ); - - HRESULT - QueryNodeValue( - _In_z_ BSTR bstrQuery, - _Out_ INT* pValue - ); - - HRESULT - GetNodeValue( - _In_z_ BSTR bstrNodeQuery, - _Inout_ _At_(*pbstrValue, _Pre_maybenull_) - _When_(return == S_FALSE, _At_(*pbstrValue, _Post_maybenull_)) - _When_(return != S_FALSE, _At_(*pbstrValue, _Post_valid_)) - BSTR* pbstrValue - ); - - HRESULT - GetAttributeValue( - _In_ CONST IXMLDOMNode* pNode, - _In_z_ BSTR bstrAttribName, - _Outptr_result_maybenull_ BSTR* pbstrResult - ); - - HRESULT - GetNodes( - _In_ BSTR bstrElementName, - _Outptr_ IXMLDOMNodeList** ppNodeList - ); - - HRESULT - CreateProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateFWProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ CONST REAL realValue, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - CreateScoredProperty( - _In_ CONST BSTR bstrPropName, - _In_ IXMLDOMNode* pValueNode, - _Outptr_ IXMLDOMElement** ppScoredPropElement - ); - - HRESULT - GetNode( - _In_z_ BSTR bstrNodeQuery, - _Outptr_ IXMLDOMNode** ppNode - ); - - HRESULT - CreateXMLAttribute( - _Inout_ IXMLDOMElement *pTarget, - _In_ PCWSTR pszName, - _In_opt_ PCWSTR pszTargetURI, - _In_ PCWSTR pszValue - ); - - HRESULT - CreateXMLElement( - _In_ PCWSTR pszName, - _In_ PCWSTR pszTargetURI, - _Out_opt_ IXMLDOMElement **ppEl - ); - -private: - - HRESULT - GetPrefixFromURI( - _In_z_ BSTR bstrNSURI, - _Outptr_result_maybenull_ BSTR* bstrNSPrefix - ); - -protected: - // - // Document and Type - // - CComPtr m_pPrintDocument; - CComBSTR m_bstrDocumentType; - - // - // W3 namespace prefixes - // - CComBSTR m_bstrSchemaPrefix; - CComBSTR m_bstrSchemaInstPrefix; - - // - // Namespace abbreviations - // - CComBSTR m_bstrFrameworkPrefix; - CComBSTR m_bstrKeywordsPrefix; - CComBSTR m_bstrUserKeywordsPrefix; -}; - diff --git a/print/XPSDrvSmpl/src/common/psizedata.h b/print/XPSDrvSmpl/src/common/psizedata.h deleted file mode 100644 index aad375a4..00000000 --- a/print/XPSDrvSmpl/src/common/psizedata.h +++ /dev/null @@ -1,44 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - psizedata.h - -Abstract: - - PageMediaSize data structure definition. This provides a convenient - description of the PrintSchema PageMediaSize feature. - ---*/ - -#pragma once - -#include "psizeschema.h" - -namespace XDPrintSchema -{ - namespace PageMediaSize - { - struct PageMediaSizeData - { - PageMediaSizeData() : - pageWidth(215900), - pageHeight(279400) - { - } - - INT pageWidth; - INT pageHeight; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/psizepthndlr.cpp b/print/XPSDrvSmpl/src/common/psizepthndlr.cpp deleted file mode 100644 index 893c16df..00000000 --- a/print/XPSDrvSmpl/src/common/psizepthndlr.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - psizepthndlr.cpp - -Abstract: - - PageMediaSize PrintTicket handler implementation. Derived from CPTHandler, - this provides PageMediaSize specific Get method acting on the passed in - PrintTicket (as a DOM document). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "psizepthndlr.h" - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; -using XDPrintSchema::PageMediaSize::MediaSizeHeight; -using XDPrintSchema::PageMediaSize::MediaSizeWidth; -using XDPrintSchema::PageMediaSize::PAGESIZE_FEATURE; -using XDPrintSchema::PageMediaSize::PAGESIZE_PROPS; - -/*++ - -Routine Name: - - CPageSizePTHandler::CPageSizePTHandler - -Routine Description: - - CPageSizePTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CPageSizePTHandler::CPageSizePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CPageSizePTHandler::~CPageSizePTHandler - -Routine Description: - - CPageSizePTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageSizePTHandler::~CPageSizePTHandler() -{ -} - -/*++ - -Routine Name: - - CPageSizePTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with page size data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pPageMediaSizeData - Pointer to the page size data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CPageSizePTHandler::GetData( - _Out_ PageMediaSizeData* pPageMediaSizeData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageMediaSizeData, E_POINTER))) - { - CComBSTR bstrPageSizeOption; - - // - // We don't actually need the pages size option name, just the dimensions - // - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(PAGESIZE_FEATURE), &bstrPageSizeOption)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(PAGESIZE_FEATURE), - CComBSTR(PAGESIZE_PROPS[MediaSizeWidth]), - &pPageMediaSizeData->pageWidth))) - { - hr = GetScoredPropertyValue(CComBSTR(PAGESIZE_FEATURE), - CComBSTR(PAGESIZE_PROPS[MediaSizeHeight]), - &pPageMediaSizeData->pageHeight); - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/psizepthndlr.h b/print/XPSDrvSmpl/src/common/psizepthndlr.h deleted file mode 100644 index 68e77fdb..00000000 --- a/print/XPSDrvSmpl/src/common/psizepthndlr.h +++ /dev/null @@ -1,45 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - psizepthndlr.h - -Abstract: - - PageMediaSize PrintTicket handling definition. The PageMediaSize PT handler - is used to extract PageMediaSize settings from a PrintTicket and populate - the PageMediaSize data structure with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "psizedata.h" - -class CPageSizePTHandler : public CPTHandler -{ -public: - CPageSizePTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CPageSizePTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::PageMediaSize::PageMediaSizeData* pPageMediaSizeData - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/psizeschema.cpp b/print/XPSDrvSmpl/src/common/psizeschema.cpp deleted file mode 100644 index 448ccb2c..00000000 --- a/print/XPSDrvSmpl/src/common/psizeschema.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - psizeschema.cpp - -Abstract: - - PageMediaSize PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageMediaSize feature. - ---*/ - -#include "precomp.h" -#include "psizeschema.h" - -LPCWSTR XDPrintSchema::PageMediaSize::PAGESIZE_FEATURE = L"PageMediaSize"; - -LPCWSTR XDPrintSchema::PageMediaSize::PAGESIZE_PROPS[] = { - L"MediaSizeWidth", - L"MediaSizeHeight" -}; - diff --git a/print/XPSDrvSmpl/src/common/psizeschema.h b/print/XPSDrvSmpl/src/common/psizeschema.h deleted file mode 100644 index 253846c7..00000000 --- a/print/XPSDrvSmpl/src/common/psizeschema.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - psizeschema.h - -Abstract: - - PageMediaSize PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageMediaSize feature within - a XDPrintSchema::PageMediaSize namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageMediaSize elements described as Printschema keywords - // - namespace PageMediaSize - { - // - // The feature name - // - extern LPCWSTR PAGESIZE_FEATURE; - - // - // We don't actually ever use the page size option names so they are - // omitted for brevity as there are many of them. - // - - enum EPageSizeProps - { - MediaSizeWidth = 0, EPageSizePropsMin = 0, - MediaSizeHeight, - EPageSizePropsMax - }; - - extern LPCWSTR PAGESIZE_PROPS[EPageSizePropsMax]; - } -} - diff --git a/print/XPSDrvSmpl/src/common/pthndlr.cpp b/print/XPSDrvSmpl/src/common/pthndlr.cpp deleted file mode 100644 index 61158c1f..00000000 --- a/print/XPSDrvSmpl/src/common/pthndlr.cpp +++ /dev/null @@ -1,1385 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pthndlr.cpp - -Abstract: - - Base PrintTicket handler class implementation. This class provides common - PrintTicket handling functionality for any filter that requires print - ticket handling. A feature specific handler can derive from - this class to get feature unspecific XML handling functionality. - ---*/ - - -// -// Note on handling missing DOM nodes: -// -// Convert MSXML's S_FALSE to E_ELEMENT_NOT_FOUND. This allows clients to -// use the SUCCEEDED macro more effectively. -// -// E_ELEMENT_NOT_FOUND should not be propogated as an error to the -// filter pipeline or config module - treat as though the requested feature -// has not been enabled. -// - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pthndlr.h" -#include "ptquerybld.h" - -using XDPrintSchema::PRINTTICKET_NAME; -using XDPrintSchema::PARAM_INIT_ELEMENT_NAME; -using XDPrintSchema::PARAM_REF_ELEMENT_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::VALUE_ELEMENT_NAME; -using XDPrintSchema::SCHEMA_TYPE; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::FEATURE_ELEMENT_NAME; -using XDPrintSchema::OPTION_ELEMENT_NAME; -using XDPrintSchema::FRAMEWORK_URI; -using XDPrintSchema::SCHEMA_INST_URI; - -/*++ - -Routine Name: - - CPTHandler::CPTHandler - -Routine Description: - - CPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - - Note: Base Class (CPSHandler) - Throws CXDException(HRESULT) on an error - ---*/ -CPTHandler::CPTHandler( - _In_ IXMLDOMDocument2 *pDOMDocument - ) : - CPSHandler(CComBSTR(PRINTTICKET_NAME), pDOMDocument) -{ -} - -/*++ - -Routine Name: - - CPTHandler::~CPTHandler - -Routine Description: - - CPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTHandler::~CPTHandler() -{ -} - -/*++ - -Routine Name: - - CPTHandler::DeleteFeature - -Routine Description: - - This routine finds and deletes the named feature - -Arguments: - - bstrFeature - the feature name to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteFeature( - _In_z_ BSTR bstrFeature - ) -{ - HRESULT hr = S_OK; - - if (SysStringLen(bstrFeature) > 0) - { - // - // Find the feature node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr pFeatureNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery))) - { - // - // Keep querying and deleting till all instances of the feature are - // removed - generally this should be a single instance - // - while (SUCCEEDED(hr) && - SUCCEEDED(hr = GetNode(bstrQuery, &pFeatureNode)) && - hr != S_FALSE) - { - // - // Delete the feature node and all children, then locate and delete - // all orphaned parameter init nodes - // - if (SUCCEEDED(hr = DeleteNode(pFeatureNode))) - { - // - // We need to delete all orphaned paramater init elements. Construct a - // list of parameter ref nodes and parameter init nodes and delete parameter - // init nodes that do not have a corresponding reference. - // - CComPtr pInitList(NULL); - CComPtr pRefList(NULL); - - if (SUCCEEDED(hr = GetNodes(CComBSTR(PARAM_INIT_ELEMENT_NAME), &pInitList)) && - hr != S_FALSE && - SUCCEEDED(hr = GetNodes(CComBSTR(PARAM_REF_ELEMENT_NAME), &pRefList)) && - hr != S_FALSE) - { - hr = DeleteParamInitOrphans(pRefList, pInitList); - } - } - - // - // Release the feature node for the next pass - // - pFeatureNode = NULL; - } - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::DeleteParamInitOrphans - -Routine Description: - - When a feature is deleted it may orphan a set of parameter init nodes. - This routine takes a list of parameter init nodes and a list of parameter - ref nodes and deletes the init nodes with no corresponding ref node. - -Arguments: - - pRefList - pointer to a node list containined the ref nodes - pInitList - pointer to a node list containined the init nodes - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteParamInitOrphans( - _In_ IXMLDOMNodeList* pRefList, - _Inout_ IXMLDOMNodeList* pInitList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pRefList, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pInitList, E_POINTER))) - { - LONG cRefNodes = 0; - - if (SUCCEEDED(hr = pRefList->get_length(&cRefNodes)) && - cRefNodes == 0) - { - // - // There are no ref nodes - delete all init nodes - // - hr = DeleteNodeList(pInitList); - } - else - { - // - // Iterate over init list and search for a corresponding ref node - // - LONG cInitNodes = 0; - hr = pInitList->get_length(&cInitNodes); - - for (LONG cInitNode = 0; cInitNode < cInitNodes && SUCCEEDED(hr); cInitNode++) - { - CComPtr pInitNode(NULL); - CComBSTR bstrInitName; - - if (SUCCEEDED(hr = pInitList->get_item(cInitNode, &pInitNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pInitNode, - CComBSTR(NAME_ATTRIBUTE_NAME), - &bstrInitName)) && - hr != S_FALSE && - SUCCEEDED(hr = pRefList->reset())) - { - // - // Iterate over the ref list tring to match - // - BOOL bMatched = FALSE; - - for (LONG cRefNode = 0; cRefNode < cRefNodes && SUCCEEDED(hr) && !bMatched; cRefNode++) - { - CComPtr pRefNode(NULL); - CComBSTR bstrRefName; - if (SUCCEEDED(hr = pRefList->get_item(cRefNode, &pRefNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pRefNode, - CComBSTR(NAME_ATTRIBUTE_NAME), - &bstrRefName)) && - hr != S_FALSE) - { - if (bstrRefName == bstrInitName) - { - bMatched = TRUE; - } - } - } - - if (!bMatched) - { - // - // There were no matches - delete the init node - // - hr = DeleteNode(pInitNode); - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPTHandler::DeleteNodeList - -Routine Description: - - This routine deletes all nodes in a node list - -Arguments: - - pNodeList - the node list containing the nodes to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteNodeList( - _Inout_ IXMLDOMNodeList* pNodeList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNodeList, E_POINTER))) - { - LONG cNodes = 0; - - hr = pNodeList->get_length(&cNodes); - - for (LONG cNode = 0; cNode < cNodes && SUCCEEDED(hr); cNode++) - { - CComPtr pNode(NULL); - if (SUCCEEDED(hr = pNodeList->get_item(cNode, &pNode)) && - hr != S_FALSE) - { - hr = DeleteNode(pNode); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::DeleteProperty - -Routine Description: - - This routine finds and deletes the named property - -Arguments: - - bstrProperty - the property name to be deleted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::DeleteProperty( - _In_z_ BSTR bstrProperty - ) -{ - HRESULT hr = S_OK; - - if (SysStringLen(bstrProperty) > 0) - { - // - // Find the property node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr pPropertyNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddProperty(m_bstrFrameworkPrefix, bstrProperty)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = GetNode(bstrQuery, &pPropertyNode)) && - hr != S_FALSE) - { - // - // Delete the property node and all children - // - hr = DeleteNode(pPropertyNode); - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::QueryNodeOption - -Routine Description: - - This routine locates the node specified by the XPath query passed in and - returns the value of the "name" attribute as a string. The PrintSchema - keyword prefix is stripped from the result. - -Arguments: - - bstrQuery - The XPath query locating the node to retrieve the value for - pbstrOption - Pointer to a BSTR to recieve the option string - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::QueryNodeOption( - _In_z_ BSTR bstrQuery, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOption, E_POINTER))) - { - *pbstrOption = NULL; - - if (SysStringLen(bstrQuery) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // Given a bare PrintSchema query, retrieve the selected option - // - if (SUCCEEDED(hr)) - { - CComPtr pQueryNode(NULL); - - if (SUCCEEDED(hr = GetNode(bstrQuery, &pQueryNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pQueryNode, CComBSTR(NAME_ATTRIBUTE_NAME), pbstrOption)) && - hr != S_FALSE) - { - hr = StripKeywordNamespace(pbstrOption); - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::FeaturePresent - -Routine Description: - - This routine checks if the named feature is present in the PrintTicket - and optionally returns that node - -Arguments: - - bstrFeature - The feature name to be located - ppFeatureNode - optional paramter that recieves the node - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::FeaturePresent( - _In_z_ BSTR bstrFeature, - _Outptr_opt_ IXMLDOMNode** ppFeatureNode - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SysStringLen(bstrFeature) > 0) - { - // - // Find the feature node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr pFeatureNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery))) - { - if (ppFeatureNode == NULL) - { - hr = GetNode(bstrQuery, &pFeatureNode); - } - else - { - hr = GetNode(bstrQuery, ppFeatureNode); - } - } - } - else - { - hr = E_INVALIDARG; - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetFeatureOption - -Routine Description: - - This routine retrieves the option set for the named feature passed in. - -Arguments: - - bstrFeature - The feature name to retrieve the option for - pbstrOption - Pointer to a BSTR to recieve the option - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::GetFeatureOption( - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOption, E_POINTER))) - { - if (SysStringLen(bstrFeature) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // Given a bare PrintSchema feature name, retrieve the selected option - // - if (SUCCEEDED(hr)) - { - // - // Find the feature option node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr pOptionNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.AddOption(m_bstrKeywordsPrefix)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = GetNode(bstrQuery, &pOptionNode)) && - hr != S_FALSE) - { - // - // If this is a shorthand option then the option is stored in the "name" attribute - // - hr = GetAttributeValue(pOptionNode, CComBSTR(NAME_ATTRIBUTE_NAME), pbstrOption); - - if (hr == S_FALSE) - { - // - // This might be a longhand option in which case the node we have retrieved - // is pointing at a scored property the value of which is the option - // - CComVariant varValue; - if (SUCCEEDED(hr = pOptionNode->get_nodeTypedValue(&varValue)) && - hr != S_FALSE) - { - *pbstrOption = ::SysAllocString(varValue.bstrVal); - - if (*pbstrOption == NULL) - { - hr = E_OUTOFMEMORY; - } - } - } - - if (SUCCEEDED(hr) && - hr != S_FALSE) - { - hr = StripKeywordNamespace(pbstrOption); - } - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetSubFeatureOption - -Routine Description: - - This routine retrieves the current option for a sub feature. The routine - finds the named parent feature, then the sub-feature and retrieves the - option that is set. - -Arguments: - - bstrParentFeature - The parent feature name - bstrFeature - The sub-feature name - pbstrOption - Pointer to a BSTR to recieve the option - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - If node does not exist - E_* - On error - ---*/ -HRESULT -CPTHandler::GetSubFeatureOption( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOption, E_POINTER))) - { - *pbstrOption = NULL; - - if (SysStringLen(bstrFeature) <= 0 || - SysStringLen(bstrParentFeature) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // Given a bare PrintSchema feature name, retrieve the selected option - // - if (SUCCEEDED(hr)) - { - // - // Find the sub feature option node - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - CComPtr pFeatureNode(NULL); - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrParentFeature)) && - SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrFeature)) && - SUCCEEDED(hr = propertyQuery.AddOption(m_bstrKeywordsPrefix)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery)) && - SUCCEEDED(hr = GetNode(bstrQuery, &pFeatureNode)) && - hr != S_FALSE && - SUCCEEDED(hr = GetAttributeValue(pFeatureNode, CComBSTR(NAME_ATTRIBUTE_NAME), pbstrOption)) && - hr != S_FALSE) - { - hr = StripKeywordNamespace(pbstrOption); - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetScoredPropertyValue - -Routine Description: - - This routine retrieves the scored property value as a string for a given feature. - -Arguments: - - bstrParentFeature - The parent feature name - bstrProperty - The scored property name - pbstrValue - Pointer to a BSTR to recieve the scored property value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Outptr_result_maybenull_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - // - // Validate input parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - *pbstrValue = NULL; - - if (SysStringLen(bstrProperty) <= 0 || - SysStringLen(bstrParentFeature) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Get the scored property value - // - CPTQueryBuilder propertyQuery(m_bstrFrameworkPrefix); - CComBSTR bstrQuery; - - if (SUCCEEDED(hr = propertyQuery.AddFeature(m_bstrKeywordsPrefix, bstrParentFeature)) && - SUCCEEDED(hr = propertyQuery.AddScoredProperty(m_bstrKeywordsPrefix, bstrProperty)) && - SUCCEEDED(hr = propertyQuery.GetQuery(&bstrQuery))) - { - hr = GetNodeValue(bstrQuery, pbstrValue); - } - } - - if (hr == S_FALSE) - { - hr = E_ELEMENT_NOT_FOUND; - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetScoredPropertyValue - -Routine Description: - - This routine retrieves the integer value of a scored property from a named - feature - -Arguments: - - bstrParentFeature - The name of the parent feature - bstrProperty - The name of the scored property to retrieve the value of - pValue - Pointer to an INT that recieves the property value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ INT* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrParentFeature) <= 0 || - SysStringLen(bstrProperty) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetScoredPropertyValue(bstrParentFeature, bstrProperty, &bstrValue))) - { - *pValue = static_cast(_wtoi(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::GetScoredPropertyValue - -Routine Description: - - This routine retrieves the REAL value of a scored property from a named - feature - -Arguments: - - bstrParentFeature - The name of the parent feature - bstrProperty - The name of the scored property to retrieve the value of - pValue - Pointer to a REAL that recieves the property value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ REAL* pValue - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrValue; - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (SysStringLen(bstrParentFeature) <= 0 || - SysStringLen(bstrProperty) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetScoredPropertyValue(bstrParentFeature, bstrProperty, &bstrValue))) - { - *pValue = static_cast(_wtof(bstrValue)); - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::StripKeywordNamespace - -Routine Description: - - This routine strips the PrintSchema keyword namespace prefix from a value - -Arguments: - - pbstrValue - Pointer to the value string to have the prefix stripped - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::StripKeywordNamespace( - _Inout_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (SysStringLen(*pbstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrStrippedName(*pbstrValue); - - INT cchStringStart = cstrStrippedName.Find(m_bstrKeywordsPrefix); - size_t cchKWPrefix = 0; - if (cchStringStart != -1 && - SUCCEEDED(hr = StringCchLength(m_bstrKeywordsPrefix, STRSAFE_MAX_CCH, &cchKWPrefix))) - { - cstrStrippedName.Delete(cchStringStart, static_cast(cchKWPrefix)); - SysFreeString(*pbstrValue); - *pbstrValue = cstrStrippedName.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateParamRefInitPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to the ParameterRef and - the ParameterInit that describe a ScoredProperty value. - -Arguments: - - bstrParam - The name of the property - bstrType - The type of the value (string, integer etc.) - bstrValue - The value of the property - ppParamRef - Pointer to a IXMLDOMElement pointer that recives the new ParameterRef - ppParamInit - Pointer to a IXMLDOMElement pointer that recives the new ParameterInit - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppParamRef, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppParamInit, E_POINTER))) - { - *ppParamRef = NULL; - *ppParamInit = NULL; - - if (SysStringLen(bstrParam) <= 0 || - SysStringLen(bstrType) <= 0 || - SysStringLen(bstrValue) <= 0) - { - hr = E_INVALIDARG; - } - } - - CComPtr pParamInit(NULL); - CComPtr pParamRef(NULL); - - if (SUCCEEDED(hr)) - { - CComBSTR bstrPRefName; - if (wcscmp(bstrParam, L"PageWatermarkSizeWidth") == 0 || - wcscmp(bstrParam, L"PageWatermarkSizeHeight") == 0) - { - bstrPRefName += m_bstrUserKeywordsPrefix; - } - else - { - bstrPRefName += m_bstrKeywordsPrefix; - } - - bstrPRefName += bstrParam; - - // - // Create the parameter ref element - // - CComBSTR bstrTagName(m_bstrFrameworkPrefix); - bstrTagName += PARAM_REF_ELEMENT_NAME; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, &pParamRef); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(pParamRef, NAME_ATTRIBUTE_NAME, NULL, bstrPRefName ); - } - - // - // Create the parameter init element - // - bstrTagName.Empty(); - bstrTagName += m_bstrFrameworkPrefix; - bstrTagName += PARAM_INIT_ELEMENT_NAME; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, &pParamInit); - } - - if (SUCCEEDED(hr)) - { - hr = CreateXMLAttribute(pParamInit, NAME_ATTRIBUTE_NAME, NULL, bstrPRefName ); - } - - // - // Create the parameter init value and add to the parameter init element - // - CComPtr pValue(NULL); - - bstrTagName.Empty(); - bstrTagName += m_bstrFrameworkPrefix; - bstrTagName += VALUE_ELEMENT_NAME; - - CComBSTR bstrAttrib(m_bstrSchemaInstPrefix); - bstrAttrib += SCHEMA_TYPE; - - CComBSTR bstrAttribValue(m_bstrSchemaPrefix); - bstrAttribValue += bstrType; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrTagName, FRAMEWORK_URI, &pValue); - } - - if (SUCCEEDED(hr)) - { - if( SUCCEEDED(hr = CreateXMLAttribute(pValue, bstrAttrib, SCHEMA_INST_URI, bstrAttribValue )) && - SUCCEEDED(hr = pValue->put_text(bstrValue))) - { - hr = pParamInit->appendChild(pValue, NULL); - } - } - } - - if (SUCCEEDED(hr)) - { - // - // Assign the outgoing element pointers - detach from CComPtr to release ownership - // - *ppParamRef = pParamRef.Detach(); - *ppParamInit = pParamInit.Detach(); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateParamRefInitPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to the ParameterRef and - the ParameterInit that describe a ScoredProperty value. This overload is INT specific - -Arguments: - - bstrParam - The name of the property - intValue - The integer value of the scored property - ppParamRef - Pointer to a IXMLDOMElement pointer that recives the new ParameterRef - ppParamInit - Pointer to a IXMLDOMElement pointer that recives the new ParameterInit - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppParamRef, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppParamInit, E_POINTER))) - { - if (SysStringLen(bstrParam) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrValue; - cstrValue.Format(L"%i", intValue); - - hr = CreateParamRefInitPair(bstrParam, - CComBSTR(SCHEMA_INTEGER), - CComBSTR(cstrValue.AllocSysString()), - ppParamRef, - ppParamInit); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateFeatureOptionPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to Feature and Option. - Note this method does not intialise the option element, it merely creates an Option - node appended to the Feature element. It is up to the caller to set the option value. - -Arguments: - - bstrFeatureName - The name of the feature - ppFeatureElement - Pointer to a IXMLDOMElement pointer that recives the new Feature - ppOptionElement - Pointer to a IXMLDOMElement pointer that recives the new Option - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppFeatureElement, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptionElement, E_POINTER))) - { - *ppFeatureElement = NULL; - *ppOptionElement = NULL; - - if (SysStringLen(bstrFeatureName) <= 0) - { - hr = E_INVALIDARG; - } - } - else - { - hr = E_POINTER; - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrFeature(m_bstrFrameworkPrefix); - bstrFeature += FEATURE_ELEMENT_NAME; - - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += bstrFeatureName; - - CComBSTR bstrOption(m_bstrFrameworkPrefix); - bstrOption += OPTION_ELEMENT_NAME; - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrFeature, FRAMEWORK_URI, ppFeatureElement); - } - - if(SUCCEEDED(hr)) - { - hr = CreateXMLElement(bstrOption, FRAMEWORK_URI, ppOptionElement); - } - - if(SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateXMLAttribute(*ppFeatureElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ))) - { - hr = (*ppFeatureElement)->appendChild(*ppOptionElement, NULL); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::CreateFeatureOptionPair - -Routine Description: - - This routine create a pair of DOM elements corresponding to Feature and Option. - -Arguments: - - bstrFeatureName - The name of the feature - bstrOptionName - The name of the option - ppFeatureElement - Pointer to a IXMLDOMElement pointer that recives the new Feature - ppOptionElement - Pointer to a IXMLDOMElement pointer that recives the new Option - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _In_ CONST BSTR bstrOptionName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppFeatureElement, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptionElement, E_POINTER))) - { - if (SysStringLen(bstrFeatureName) <= 0 || - SysStringLen(bstrOptionName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - if (SUCCEEDED(hr = CreateFeatureOptionPair(bstrFeatureName, ppFeatureElement, ppOptionElement))) - { - // - // Set the option name attribute - // - CComBSTR bstrAttribValue(m_bstrKeywordsPrefix); - bstrAttribValue += bstrOptionName; - - hr = CreateXMLAttribute(*ppOptionElement, NAME_ATTRIBUTE_NAME, NULL, bstrAttribValue ); - - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTHandler::AppendToElement - -Routine Description: - - This routine uses the passed element name to locate the node to which - it will append the DOM node passed in. - -Arguments: - - bstrElementName - The name of the element to append to - pAppendNode - The node to append - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTHandler::AppendToElement( - _In_ CONST BSTR bstrElementName, - _In_ IXMLDOMNode* pAppendNode - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pAppendNode, E_POINTER))) - { - if (SysStringLen(bstrElementName) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComPtr pNode(NULL); - - CComBSTR bstrQuery(m_bstrFrameworkPrefix); - bstrQuery += bstrElementName; - - if (SUCCEEDED(hr = GetNode(bstrQuery, &pNode))) - { - hr = pNode->appendChild(pAppendNode, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/pthndlr.h b/print/XPSDrvSmpl/src/common/pthndlr.h deleted file mode 100644 index e8bd8a08..00000000 --- a/print/XPSDrvSmpl/src/common/pthndlr.h +++ /dev/null @@ -1,178 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -File Name: - - pthndlr.h - -Abstract: - - Base PrintTicket handler class definition. This class provides common - PrintTicket handling functionality for any filter that requires print - ticket handling. A filter can from this class to get feature unspecific - XML handling functionality. - ---*/ - -#pragma once - -#include "schema.h" -#include "pshndlr.h" - -class CPTHandler : public CPSHandler -{ -public: - // - // Constructors and destructors - // - CPTHandler( - _In_ IXMLDOMDocument2 *pPrintTicket - ); - - virtual ~CPTHandler(); - -public: - HRESULT - DeleteFeature( - _In_z_ BSTR bstrFeature - ); - - HRESULT - DeleteProperty( - _In_z_ BSTR bstrProperty - ); - -protected: - HRESULT - QueryNodeOption( - _In_z_ BSTR bstrQuery, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ); - - HRESULT - FeaturePresent( - _In_z_ BSTR bstrFeature, - _Outptr_opt_ IXMLDOMNode** ppFeatureNode = NULL - ); - - HRESULT - GetFeatureOption( - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ); - - HRESULT - GetSubFeatureOption( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrFeature, - _Outptr_result_maybenull_z_ BSTR* pbstrOption - ); - - HRESULT - GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Outptr_result_maybenull_ BSTR* pbstrValue - ); - - HRESULT - GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ INT* pValue - ); - - HRESULT - GetScoredPropertyValue( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrProperty, - _Out_ REAL* pValue - ); - - HRESULT - SetFeatureOption( - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrOption - ); - - HRESULT - SetSubFeatureOption( - _In_z_ BSTR bstrParentFeature, - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrOption - ); - - HRESULT - SetPropertyAsValue( - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrProperty, - _In_z_ BSTR bstrValue - ); - - HRESULT - SetPropertyAsParameterRef( - _In_z_ BSTR bstrFeature, - _In_z_ BSTR bstrProperty, - _In_z_ BSTR bstrParameterRef, - _In_z_ BSTR bstrValue - ); - - HRESULT - CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST BSTR bstrType, - _In_ CONST BSTR bstrValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ); - - HRESULT - CreateParamRefInitPair( - _In_ CONST BSTR bstrParam, - _In_ CONST INT intValue, - _Outptr_ IXMLDOMElement** ppParamRef, - _Outptr_ IXMLDOMElement** ppParamInit - ); - - HRESULT - CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ); - - HRESULT - CreateFeatureOptionPair( - _In_ CONST BSTR bstrFeatureName, - _In_ CONST BSTR bstrOptionName, - _Outptr_ IXMLDOMElement** ppFeatureElement, - _Outptr_ IXMLDOMElement** ppOptionElement - ); - - HRESULT - AppendToElement( - _In_ CONST BSTR bstrElementName, - _In_ IXMLDOMNode* pAppendNode - ); - -private: - HRESULT - StripKeywordNamespace( - _Inout_ BSTR* pbstrValue - ); - - HRESULT - DeleteNodeList( - _Inout_ IXMLDOMNodeList* pNodeList - ); - - HRESULT - DeleteParamInitOrphans( - _In_ IXMLDOMNodeList* pRefList, - _Inout_ IXMLDOMNodeList* pInitList - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/ptquerybld.cpp b/print/XPSDrvSmpl/src/common/ptquerybld.cpp deleted file mode 100644 index cc7faa8a..00000000 --- a/print/XPSDrvSmpl/src/common/ptquerybld.cpp +++ /dev/null @@ -1,516 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ptquerybld.cpp - -Abstract: - - PrintTicket XPath query builder implementation. The CPTQueryBuilder class - provides a means of constructing PrintTicket specific XPath queries for - retrieving nodes from within the DOM document describing the PrintTicket. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "ptquerybld.h" - -// -// XML PrintTicket Query Builder Format Strings -// -static PCWSTR szPTQFeature = L"//%sFeature[@name = \"%s\"]"; -static PCWSTR szPTQProperty = L"//%sProperty[@name = \"%s\"]"; -static PCWSTR szPTQScoredProperty = L"//%sScoredProperty[@name = \"%s\"]"; -static PCWSTR szPTQParamRef = L"//%sParameterRef[@name = \"%s\"]"; -static PCWSTR szPTQOptionSH = L"/%sOption"; -static PCWSTR szPTQOptionLH = L"/%sScoredProperty[@name = \"%sOptionName\"]/%sValue"; -static PCWSTR szPTQOrNodes = L" | "; - -/*++ - -Routine Name: - - CPTQueryBuilder::CPTQueryBuilder - -Routine Description: - - CPTQueryBuilder class default constructor - -Arguments: - - bstrFrameworkNS - PrintTicket framework namespace prefix - -Return Value: - - None - ---*/ -CPTQueryBuilder::CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS - ) : - m_bstrFrameworkNS(bstrFrameworkNS) -{ -} - -/*++ - -Routine Name: - - CPTQueryBuilder::CPTQueryBuilder - -Routine Description: - - CPTQueryBuilder class constructor - -Arguments: - - bstrFrameworkNS - PrintTicket framework namespace prefix - bstrQuery - String containing base query to use on construction. - -Return Value: - - None - ---*/ -CPTQueryBuilder::CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS, - _In_z_ BSTR bstrQuery - ) : - m_bstrFrameworkNS(bstrFrameworkNS), - m_bstrQuery(bstrQuery) -{ -} - -/*++ - -Routine Name: - - CPTQueryBuilder::~CPTQueryBuilder - -Routine Description: - - CPTQueryBuilder class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTQueryBuilder::~CPTQueryBuilder( - ) -{ -} - -/*++ - -Routine Name: - - CPTQueryBuilder::Clear - -Routine Description: - - Clears the current query string. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::Clear( - VOID - ) -{ - m_bstrQuery.Empty(); - - return S_OK; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::GetQuery - -Routine Description: - - Makes a copy of the current query string and returns it to the caller. - -Arguments: - - bstrQuery - Address of a pointer that will be modified to point to a string - that is filled out with a copy of the current query. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::GetQuery( - _Inout_ _At_(*pbstrQuery, _Pre_maybenull_ _Post_valid_) BSTR* pbstrQuery - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrQuery, E_POINTER))) - { - SysFreeString(*pbstrQuery); - hr = m_bstrQuery.CopyTo(pbstrQuery); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddFeature - -Routine Description: - - Appends a feature query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrFeature - Pointer to a string defining the feature name to be appended. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddFeature( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrFeature - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrFeature); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrFeatureQuery; - cstrFeatureQuery.Format(szPTQFeature, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrFeatureQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddProperty - -Routine Description: - - Appends a property query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrProperty - Pointer to a string defining the property name to be appended. - - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrProperty - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrProperty); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrPropertyQuery; - cstrPropertyQuery.Format(szPTQProperty, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrPropertyQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddScoredProperty - -Routine Description: - - Appends a scored property query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrScoredProperty - Pointer to a string defining the scored property name to be appended. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddScoredProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrScoredProperty - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrScoredProperty); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrScoredPropertyQuery; - cstrScoredPropertyQuery.Format(szPTQScoredProperty, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrScoredPropertyQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddScoredProperty - -Routine Description: - - Appends a Parameter Reference query to the query builder class. - -Arguments: - - bstrKeywordNS - Optional parameter defining the keyword namespace to prefix. - bstrScoredProperty - Pointer to a string defining the scored property name to be appended. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddParamRef( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrParameterRef - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CComBSTR bstrKeyword; - - if (SysStringLen(bstrKeywordNS) > 0) - { - hr = bstrKeyword.Append(bstrKeywordNS); - } - - if (SUCCEEDED(hr)) - { - hr = bstrKeyword.Append(bstrParameterRef); - } - - if (SUCCEEDED(hr)) - { - CStringXDW cstrParamRefQuery; - cstrParamRefQuery.Format(szPTQParamRef, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); - - hr = m_bstrQuery.Append(cstrParamRefQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTQueryBuilder::AddOption - -Routine Description: - - Appends the option query to the query builder class. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTQueryBuilder::AddOption( - _In_opt_z_ BSTR bstrKeywordNS - ) -{ - HRESULT hr = S_OK; - - if (m_bstrFrameworkNS.Length() > 0) - { - try - { - CStringXDW cstrQueryRoot(m_bstrQuery); - CStringXDW cstrOptionQuery; - cstrOptionQuery.Format(szPTQOptionSH, static_cast(m_bstrFrameworkNS)); - - if (SUCCEEDED(hr = m_bstrQuery.Append(cstrOptionQuery)) && - SUCCEEDED(hr = m_bstrQuery.Append(szPTQOrNodes)) && - SUCCEEDED(hr = m_bstrQuery.Append(cstrQueryRoot))) - { - cstrOptionQuery.Format(szPTQOptionLH, static_cast(m_bstrFrameworkNS), - static_cast(bstrKeywordNS), static_cast(m_bstrFrameworkNS)); - hr = m_bstrQuery.Append(cstrOptionQuery); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/common/ptquerybld.h b/print/XPSDrvSmpl/src/common/ptquerybld.h deleted file mode 100644 index a82172ea..00000000 --- a/print/XPSDrvSmpl/src/common/ptquerybld.h +++ /dev/null @@ -1,84 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ptquerybld.h - -Abstract: - - PrintTicket XPath query builder definition. The CPTQueryBuilder class - provides a means of constructing PrintTicket specific XPath queries for - retrieving nodes from within the DOM document describing the PrintTicket. - ---*/ - -#pragma once - -class CPTQueryBuilder -{ -public: - CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS - ); - - CPTQueryBuilder( - _In_z_ BSTR bstrFrameworkNS, - _In_z_ BSTR bstrQuery - ); - - virtual ~CPTQueryBuilder(); - - HRESULT - Clear( - VOID - ); - - HRESULT - GetQuery( - _Inout_ _At_(*pbstrQuery, _Pre_maybenull_ _Post_valid_) BSTR* pbstrQuery - ); - - HRESULT - AddFeature( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrPropertyName - ); - - HRESULT - AddProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrPropertyName - ); - - HRESULT - AddScoredProperty( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrPropertyName - ); - - HRESULT - AddParamRef( - _In_opt_z_ BSTR bstrKeywordNS, - _In_z_ BSTR bstrParameterRef - ); - - HRESULT - AddOption( - _In_opt_z_ BSTR bstrKeywordNS - ); - -private: - CComBSTR m_bstrQuery; - - CComBSTR m_bstrFrameworkNS; -}; - diff --git a/print/XPSDrvSmpl/src/common/schema.cpp b/print/XPSDrvSmpl/src/common/schema.cpp deleted file mode 100644 index ce2aa2c2..00000000 --- a/print/XPSDrvSmpl/src/common/schema.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - schema.cpp - -Abstract: - - PrintSchema implementation. This provides the definition of keywords common - to all features within the PrintSchema. - ---*/ - -#include "precomp.h" -#include "schema.h" - -LPCWSTR XDPrintSchema::SCHEMA_INST_URI = - L"http://www.w3.org/2001/XMLSchema-instance"; - -LPCWSTR XDPrintSchema::SCHEMA_DEF_URI = - L"http://www.w3.org/2001/XMLSchema"; - -LPCWSTR XDPrintSchema::SCHEMA_TYPE = L"type"; -LPCWSTR XDPrintSchema::SCHEMA_INTEGER = L"integer"; -LPCWSTR XDPrintSchema::SCHEMA_DECIMAL = L"decimal"; -LPCWSTR XDPrintSchema::SCHEMA_STRING = L"string"; -LPCWSTR XDPrintSchema::SCHEMA_QNAME = L"QName"; -LPCWSTR XDPrintSchema::SCHEMA_CONDITIONAL = L"Conditional"; - -LPCWSTR XDPrintSchema::FRAMEWORK_URI = - L"http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework"; - -LPCWSTR XDPrintSchema::KEYWORDS_URI = - L"http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords"; - -LPCWSTR XDPrintSchema::FEATURE_ELEMENT_NAME = L"Feature"; -LPCWSTR XDPrintSchema::OPTION_ELEMENT_NAME = L"Option"; -LPCWSTR XDPrintSchema::PARAM_INIT_ELEMENT_NAME = L"ParameterInit"; -LPCWSTR XDPrintSchema::PARAM_REF_ELEMENT_NAME = L"ParameterRef"; -LPCWSTR XDPrintSchema::PARAM_DEF_ELEMENT_NAME = L"ParameterDef"; -LPCWSTR XDPrintSchema::SCORED_PROP_ELEMENT_NAME = L"ScoredProperty"; -LPCWSTR XDPrintSchema::PROPERTY_ELEMENT_NAME = L"Property"; -LPCWSTR XDPrintSchema::VALUE_ELEMENT_NAME = L"Value"; -LPCWSTR XDPrintSchema::NAME_ATTRIBUTE_NAME = L"name"; - - -LPCWSTR XDPrintSchema::PICKONE_VALUE_NAME = L"PickOne"; -LPCWSTR XDPrintSchema::SELECTIONTYPE_VALUE_NAME = L"SelectionType"; -LPCWSTR XDPrintSchema::DATATYPE_VALUE_NAME = L"DataType"; -LPCWSTR XDPrintSchema::DEFAULTVAL_VALUE_NAME = L"DefaultValue"; -LPCWSTR XDPrintSchema::MAX_VALUE_NAME = L"MaxValue"; -LPCWSTR XDPrintSchema::MIN_VALUE_NAME = L"MinValue"; -LPCWSTR XDPrintSchema::MAX_LENGTH_NAME = L"MaxLength"; -LPCWSTR XDPrintSchema::MIN_LENGTH_NAME = L"MinLength"; -LPCWSTR XDPrintSchema::MULTIPLE_VALUE_NAME = L"Multiple"; -LPCWSTR XDPrintSchema::MANDATORY_VALUE_NAME = L"Mandatory"; -LPCWSTR XDPrintSchema::UNITTYPE_VALUE_NAME = L"UnitType"; -LPCWSTR XDPrintSchema::DISPLAYNAME_VALUE_NAME = L"DisplayName"; - -LPCWSTR XDPrintSchema::PRINTTICKET_NAME = L"PrintTicket"; -LPCWSTR XDPrintSchema::PRINTCAPABILITIES_NAME = L"PrintCapabilities"; diff --git a/print/XPSDrvSmpl/src/common/schema.h b/print/XPSDrvSmpl/src/common/schema.h deleted file mode 100644 index 540de949..00000000 --- a/print/XPSDrvSmpl/src/common/schema.h +++ /dev/null @@ -1,94 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - schema.h - -Abstract: - - PrintSchema definition. This provides the definition of keywords common - to all features within the PrintSchema. The description is placed within a - XDPrintSchema namespace. - ---*/ - -#pragma once - -enum EPrintschemaVersion -{ - PRINTSCHEMA_VERSION_NUMBER = 1 -}; - -namespace XDPrintSchema -{ - // - // W3 namespaces - // - extern LPCWSTR SCHEMA_INST_URI; - extern LPCWSTR SCHEMA_DEF_URI; - - // - // W3 type prefixes - // - extern LPCWSTR SCHEMA_TYPE; - extern LPCWSTR SCHEMA_INTEGER; - extern LPCWSTR SCHEMA_DECIMAL; - extern LPCWSTR SCHEMA_STRING; - extern LPCWSTR SCHEMA_QNAME; - extern LPCWSTR SCHEMA_CONDITIONAL; - - // - // Namespaces - // - extern LPCWSTR FRAMEWORK_URI; - extern LPCWSTR KEYWORDS_URI; - - // - // Element and attribute types defined in Printschema framework - // - extern LPCWSTR FEATURE_ELEMENT_NAME; - extern LPCWSTR OPTION_ELEMENT_NAME; - extern LPCWSTR PARAM_INIT_ELEMENT_NAME; - extern LPCWSTR PARAM_REF_ELEMENT_NAME; - extern LPCWSTR PARAM_DEF_ELEMENT_NAME; - extern LPCWSTR SCORED_PROP_ELEMENT_NAME; - extern LPCWSTR VALUE_ELEMENT_NAME; - extern LPCWSTR NAME_ATTRIBUTE_NAME; - extern LPCWSTR PROPERTY_ELEMENT_NAME; - - // - // Value types defined in the PrintSchema Keywords - // - extern LPCWSTR PICKONE_VALUE_NAME; - extern LPCWSTR SELECTIONTYPE_VALUE_NAME; - extern LPCWSTR DATATYPE_VALUE_NAME; - extern LPCWSTR DEFAULTVAL_VALUE_NAME; - extern LPCWSTR MAX_VALUE_NAME; - extern LPCWSTR MIN_VALUE_NAME; - extern LPCWSTR MAX_LENGTH_NAME; - extern LPCWSTR MIN_LENGTH_NAME; - extern LPCWSTR MULTIPLE_VALUE_NAME; - extern LPCWSTR MANDATORY_VALUE_NAME; - extern LPCWSTR UNITTYPE_VALUE_NAME; - extern LPCWSTR DISPLAYNAME_VALUE_NAME; - - // - // Root PrintTicket element - // - extern LPCWSTR PRINTTICKET_NAME; - - // - // Root PrintCapabilities element - // - extern LPCWSTR PRINTCAPABILITIES_NAME; -} - diff --git a/print/XPSDrvSmpl/src/common/wmdata.h b/print/XPSDrvSmpl/src/common/wmdata.h deleted file mode 100644 index effe32a5..00000000 --- a/print/XPSDrvSmpl/src/common/wmdata.h +++ /dev/null @@ -1,71 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmdata.h - -Abstract: - - PageWatermark data structure definition. This provides a convenient - description of the PrintSchema PageWatermark feature. - ---*/ - -#pragma once - -#include "wmschema.h" - -namespace XDPrintSchema -{ - namespace PageWatermark - { - struct WMTextData - { - WMTextData() : - bstrFontColor(L"#FFFFFF"), - fontSize(12), - bstrText(L"Undefined") - { - } - - CComBSTR bstrFontColor; - INT fontSize; - CComBSTR bstrText; - }; - - struct WatermarkData - { - WatermarkData() : - type(TextWatermark), - widthOrigin(0), - heightOrigin(0), - widthExtent(215900), - heightExtent(279400), - transparency(0), - angle(0), - layering(Layering::Overlay) - { - } - - EWatermarkOption type; - INT widthOrigin; - INT heightOrigin; - INT widthExtent; - INT heightExtent; - INT transparency; - INT angle; - WMTextData txtData; - Layering::ELayeringOption layering; - }; - } -} - diff --git a/print/XPSDrvSmpl/src/common/wmpchndlr.cpp b/print/XPSDrvSmpl/src/common/wmpchndlr.cpp deleted file mode 100644 index bab943b8..00000000 --- a/print/XPSDrvSmpl/src/common/wmpchndlr.cpp +++ /dev/null @@ -1,555 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmpchndlr.cpp - -Abstract: - - Page watermark PrintCapabilities handling implementation. The watermark PC handler - is used to set Page Watermark settings in a PrintCapabilities. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdexcept.h" -#include "wmpchndlr.h" -#include "privatedefs.h" - -using XDPrintSchema::PRINTCAPABILITIES_NAME; - -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::ECommonWatermarkProps; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMin; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMax; -using XDPrintSchema::PageWatermark::ETextWatermarkProps; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMin; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMax; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkProps; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMin; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMax; -using XDPrintSchema::PageWatermark::WATERMARK_FEATURE; -using XDPrintSchema::PageWatermark::WATERMARK_OPTIONS; -using XDPrintSchema::PageWatermark::CMN_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::TXT_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::VECTBMP_WATERMARK_PROPS; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMin; -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMax; -using XDPrintSchema::PageWatermark::Layering::LAYERING_FEATURE; -using XDPrintSchema::PageWatermark::Layering::LAYERING_OPTIONS; - -/*++ - -Routine Name: - - CWMPCHandler::CWMPCHandler - -Routine Description: - - CWMPCHandler class constructor - -Arguments: - - pPrintCapabilities - Pointer to the DOM document representation of the PrintCapabilities - -Return Value: - - None - ---*/ -CWMPCHandler::CWMPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ) : - CPCHandler(pPrintCapabilities) -{ -} - -/*++ - -Routine Name: - - CWMPCHandler::~CWMPCHandler - -Routine Description: - - CWMPCHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMPCHandler::~CWMPCHandler() -{ -} - -/*++ - -Routine Name: - - CWMPCHandler::SetCapabilities - -Routine Description: - - This routine sets watermark capabilities in the PrintCapabilities passed to the - class constructor. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPCHandler::SetCapabilities( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Retrieve the PrintTicket root - // - CComPtr pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTCAPABILITIES_NAME; - - if (SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - CComPtr pFeatureElement(NULL); - - if (SUCCEEDED(hr = CreateFeatureSelection(CComBSTR(WATERMARK_FEATURE), NULL, &pFeatureElement))) - { - CComPtr pTextOption(NULL); - - // - // Create the Text Watermark Options - // - if (SUCCEEDED(hr = CreateOption(CComBSTR(WATERMARK_OPTIONS[TextWatermark]), NULL, &pTextOption))) - { - PTDOMElementVector propertList; - - // - // Create the common scored property list - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast(cmnProps + 1)) - { - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - hr = bstrPRefName.Append(L"Text"); - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Create the text specific scored property list - // - for (ETextWatermarkProps txtProps = ETextWatermarkPropsMin; - txtProps < ETextWatermarkPropsMax && SUCCEEDED(hr); - txtProps = static_cast(txtProps + 1)) - { - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(TXT_WATERMARK_PROPS[txtProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += TXT_WATERMARK_PROPS[txtProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the text option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pTextOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pTextOption, NULL); - } - } - - CComPtr pVectorOption(NULL); - - // - // Create the Vector Watermark Options - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateOption(CComBSTR(WATERMARK_OPTIONS[VectorWatermark]), NULL, &pVectorOption))) - { - PTDOMElementVector propertList; - - // - // Create the common scored property list - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast(cmnProps + 1)) - { - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - bstrPRefName += WATERMARK_OPTIONS[TextWatermark]; - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Create the vector specific property list - // - for (EVectBmpWatermarkProps vectProps = EVectBmpWatermarkPropsMin; - vectProps < EVectBmpWatermarkPropsMax && SUCCEEDED(hr); - vectProps = static_cast(vectProps + 1)) - { - // - // Create the scored property element - // - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(VECTBMP_WATERMARK_PROPS[vectProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += VECTBMP_WATERMARK_PROPS[vectProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the vector option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pVectorOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pVectorOption, NULL); - } - } - - CComPtr pBitmapOption(NULL); - - // - // Create the Bitmap Watermark Options - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateOption(CComBSTR(WATERMARK_OPTIONS[BitmapWatermark]), NULL, &pBitmapOption))) - { - PTDOMElementVector propertList; - - // - // Create the common scored property list - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast(cmnProps + 1)) - { - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - hr = bstrPRefName.Append(L"Text"); - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Create the bitmap specific property list - // - for (EVectBmpWatermarkProps bmpProps = EVectBmpWatermarkPropsMin; - bmpProps < EVectBmpWatermarkPropsMax && SUCCEEDED(hr); - bmpProps = static_cast(bmpProps + 1)) - { - // - // Create the scored property element - // - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(VECTBMP_WATERMARK_PROPS[bmpProps]), &pScoredProperty))) - { - CComPtr pParamRef(NULL); - - // - // Construct the parameter reference elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += VECTBMP_WATERMARK_PROPS[bmpProps]; - - if (SUCCEEDED(hr = CreateParameterRef(bstrPRefName, &pParamRef))) - { - hr = pScoredProperty->appendChild(pParamRef, NULL); - } - - propertList.push_back(pScoredProperty); - } - } - - // - // Add the properties to the bitmap option - // - PTDOMElementVector::iterator iterPropertList = propertList.begin(); - - for (;iterPropertList != propertList.end() && SUCCEEDED(hr); iterPropertList++) - { - hr = pBitmapOption->appendChild(*iterPropertList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pBitmapOption, NULL); - } - } - - CComPtr pLayeringFeature(NULL); - - // - // Create the layering feature options - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateFeature(CComBSTR(LAYERING_FEATURE), NULL, &pLayeringFeature))) - { - PTDOMElementVector optionList; - - // - // Create the layering option list - // - for (ELayeringOption wmLayering = ELayeringOptionMin; - wmLayering < ELayeringOptionMax && SUCCEEDED(hr); - wmLayering = static_cast(wmLayering + 1)) - { - CComPtr pOptionProperty(NULL); - - if (SUCCEEDED(hr = CreateOption(CComBSTR(LAYERING_OPTIONS[wmLayering]), NULL, &pOptionProperty))) - { - optionList.push_back(pOptionProperty); - } - } - - // - // Add the options to the layering feature - // - PTDOMElementVector::iterator iterOptionList = optionList.begin(); - - for (;iterOptionList != optionList.end() && SUCCEEDED(hr); iterOptionList++) - { - hr = pLayeringFeature->appendChild(*iterOptionList, NULL); - } - - if (SUCCEEDED(hr)) - { - hr = pFeatureElement->appendChild(pLayeringFeature, NULL); - } - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pFeatureElement, NULL); - } - } - - // - // Create the integer parameter defs - // - for (UINT cIndex = 0; SUCCEEDED(hr) && cIndex < numof(wmParamDefIntegers); cIndex++) - { - CComPtr pParameterDef(NULL); - - // - // PageWatermarkTextColor has no associated multiple value - // - INT multiple; - if (wcscmp(CComBSTR(wmParamDefIntegers[cIndex].property_name), L"PageWatermarkTextColor") == 0) - { - // - // convert integer representation into a string parameter in the - // PrintCapabilities. This is a special case because it's treated - // as an int in the DEVMODE & a string in the PrintTicket - // - CComBSTR bstrDefault(L"#AARRGGBB"); - hr = StringCchPrintf(bstrDefault, SysStringLen(bstrDefault)+1, TEXT("#%.8X"), wmParamDefIntegers[cIndex].default_value); - - if (SUCCEEDED(hr)) - { - hr = CreateStringParameterDef(CComBSTR(wmParamDefIntegers[cIndex].property_name), // Paramater Name - TRUE, // Is Print Schema keyword? - CComBSTR(wmParamDefIntegers[cIndex].display_name), // Display Text - bstrDefault, // Default - 9, // Min Length: - // table contains min value, which is different - 9, // Max Length: - // table contains min value, which is different - CComBSTR(wmParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef); // Parameter Def - } - } - else - { - multiple = wmParamDefIntegers[cIndex].multiple; - - hr = CreateIntParameterDef(CComBSTR(wmParamDefIntegers[cIndex].property_name), // Paramater Name - wmParamDefIntegers[cIndex].is_public, // Is Print Schema keyword? - CComBSTR(wmParamDefIntegers[cIndex].display_name), // Display Text - wmParamDefIntegers[cIndex].default_value, // Default - wmParamDefIntegers[cIndex].min_length, // Min value - wmParamDefIntegers[cIndex].max_length, // Max value - multiple, // Multiple - CComBSTR(wmParamDefIntegers[cIndex].unit_type), // Unit Type - &pParameterDef); // Parameter Def - } - - if (SUCCEEDED(hr)) - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - - // - // Create the string parameter defs - // - for (UINT cIndex = 0; SUCCEEDED(hr) && cIndex < numof(wmParamDefStrings); cIndex++) - { - CComPtr pParameterDef(NULL); - - if (SUCCEEDED(hr = CreateStringParameterDef(CComBSTR(wmParamDefStrings[cIndex].property_name), // Paramater Name - TRUE, // Is Print Schema keyword? - CComBSTR(wmParamDefStrings[cIndex].display_name), // Display Text - CComBSTR(wmParamDefStrings[cIndex].default_value), // Default - wmParamDefStrings[cIndex].min_length, // Min Length - wmParamDefStrings[cIndex].max_length, // Max Length - CComBSTR(wmParamDefStrings[cIndex].unit_type), // Unit Type - &pParameterDef))) // Parameter Def - { - hr = pPTRoot->appendChild(pParameterDef, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/wmpchndlr.h b/print/XPSDrvSmpl/src/common/wmpchndlr.h deleted file mode 100644 index 2ffcaada..00000000 --- a/print/XPSDrvSmpl/src/common/wmpchndlr.h +++ /dev/null @@ -1,41 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmpchndlr.h - -Abstract: - - Page Watermark PrintCapabilities handling definition. The booklet PC handler - is used to set booklet settings in a PrintCapabilities. - ---*/ - -#pragma once - -#include "pchndlr.h" -#include "wmdata.h" - -class CWMPCHandler : public CPCHandler -{ -public: - CWMPCHandler( - _In_ IXMLDOMDocument2* pPrintCapabilities - ); - - virtual ~CWMPCHandler(); - - HRESULT - SetCapabilities( - VOID - ); -}; diff --git a/print/XPSDrvSmpl/src/common/wmpthndlr.cpp b/print/XPSDrvSmpl/src/common/wmpthndlr.cpp deleted file mode 100644 index 49792d6a..00000000 --- a/print/XPSDrvSmpl/src/common/wmpthndlr.cpp +++ /dev/null @@ -1,1167 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmpthndlr.cpp - -Abstract: - - PageWatermark PrintTicket handler implementation. Derived from CPTHandler, - this provides PageWatermark specific Get and Set methods acting on the - PrintTicket passed (as a DOM document). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "wmpthndlr.h" - -using XDPrintSchema::PRINTTICKET_NAME; -using XDPrintSchema::NAME_ATTRIBUTE_NAME; -using XDPrintSchema::SCHEMA_DECIMAL; -using XDPrintSchema::SCHEMA_INTEGER; -using XDPrintSchema::SCHEMA_STRING; - -using XDPrintSchema::PageWatermark::WatermarkData; - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::EWatermarkOptionMin; -using XDPrintSchema::PageWatermark::NoWatermark; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::EWatermarkOptionMax; - -using XDPrintSchema::PageWatermark::ECommonWatermarkProps; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMin; -using XDPrintSchema::PageWatermark::WidthOrigin; -using XDPrintSchema::PageWatermark::HeightOrigin; -using XDPrintSchema::PageWatermark::Transparency; -using XDPrintSchema::PageWatermark::Angle; -using XDPrintSchema::PageWatermark::ECommonWatermarkPropsMax; - -using XDPrintSchema::PageWatermark::ETextWatermarkProps; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMin; -using XDPrintSchema::PageWatermark::FontColor; -using XDPrintSchema::PageWatermark::FontSize; -using XDPrintSchema::PageWatermark::Text; -using XDPrintSchema::PageWatermark::ETextWatermarkPropsMax; - -using XDPrintSchema::PageWatermark::EVectBmpWatermarkProps; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMin; -using XDPrintSchema::PageWatermark::WidthExtent; -using XDPrintSchema::PageWatermark::HeightExtent; -using XDPrintSchema::PageWatermark::EVectBmpWatermarkPropsMax; - -using XDPrintSchema::PageWatermark::WATERMARK_FEATURE; -using XDPrintSchema::PageWatermark::WATERMARK_OPTIONS; -using XDPrintSchema::PageWatermark::CMN_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::TXT_WATERMARK_PROPS; -using XDPrintSchema::PageWatermark::VECTBMP_WATERMARK_PROPS; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMin; -using XDPrintSchema::PageWatermark::Layering::Overlay; -using XDPrintSchema::PageWatermark::Layering::Underlay; -using XDPrintSchema::PageWatermark::Layering::ELayeringOptionMax; - -using XDPrintSchema::PageWatermark::Layering::LAYERING_FEATURE; -using XDPrintSchema::PageWatermark::Layering::LAYERING_OPTIONS; - -/*++ - -Routine Name: - - CWMPTHandler::CWMPTHandler - -Routine Description: - - CWMPTHandler class constructor - -Arguments: - - pPrintTicket - Pointer to the DOM document representation of the PrintTicket - -Return Value: - - None - ---*/ -CWMPTHandler::CWMPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ) : - CPTHandler(pPrintTicket) -{ -} - -/*++ - -Routine Name: - - CWMPTHandler::~CWMPTHandler - -Routine Description: - - CWMPTHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMPTHandler::~CWMPTHandler() -{ -} - -/*++ - -Routine Name: - - CWMPTHandler::GetData - -Routine Description: - - The routine fills the data structure passed in with watermark data retrieved from - the PrintTicket passed to the class constructor. - -Arguments: - - pWmData - Pointer to the watermark data structure to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - Feature not present in PrintTicket - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetData( - _Out_ WatermarkData* pWmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER))) - { - CComBSTR bstrWMOption; - CComBSTR bstrLayerOption; - - if (SUCCEEDED(hr = GetFeatureOption(CComBSTR(WATERMARK_FEATURE), &bstrWMOption)) && - SUCCEEDED(hr = GetSubFeatureOption(CComBSTR(WATERMARK_FEATURE), - CComBSTR(LAYERING_FEATURE), - &bstrLayerOption)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[WidthOrigin]), - &pWmData->widthOrigin)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[HeightOrigin]), - &pWmData->heightOrigin)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[Transparency]), - &pWmData->transparency)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(CMN_WATERMARK_PROPS[Angle]), - &pWmData->angle))) - { - if (bstrWMOption == WATERMARK_OPTIONS[BitmapWatermark]) - { - pWmData->type = BitmapWatermark; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[WidthExtent]), - &pWmData->widthExtent))) - { - hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[HeightExtent]), - &pWmData->heightExtent); - } - - } - else if (bstrWMOption == WATERMARK_OPTIONS[TextWatermark]) - { - pWmData->type = TextWatermark; - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(TXT_WATERMARK_PROPS[FontColor]), - &pWmData->txtData.bstrFontColor)) && - SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(TXT_WATERMARK_PROPS[FontSize]), - &pWmData->txtData.fontSize))) - { - hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(TXT_WATERMARK_PROPS[Text]), - &pWmData->txtData.bstrText); - } - } - else if (bstrWMOption == WATERMARK_OPTIONS[VectorWatermark]) - { - pWmData->type = VectorWatermark; - - if (SUCCEEDED(hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[WidthExtent]), - &pWmData->widthExtent))) - { - hr = GetScoredPropertyValue(CComBSTR(WATERMARK_FEATURE), - CComBSTR(VECTBMP_WATERMARK_PROPS[HeightExtent]), - &pWmData->heightExtent); - } - } - else - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - if (bstrLayerOption == LAYERING_OPTIONS[Underlay]) - { - pWmData->layering = Underlay; - } - else if (bstrLayerOption == LAYERING_OPTIONS[Overlay]) - { - pWmData->layering = Overlay; - } - else - { - hr = E_FAIL; - } - } - } - - if (hr == E_ELEMENT_NOT_FOUND) - { - pWmData->type = NoWatermark; - } - } - - // - // Validate the data - // - if (SUCCEEDED(hr)) - { - if (pWmData->type < EWatermarkOptionMin || - pWmData->type >= EWatermarkOptionMax || - pWmData->layering < ELayeringOptionMin || - pWmData->layering >= ELayeringOptionMax) - { - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::SetData - -Routine Description: - - This routine sets the watermark data in the PrintTicket passed to the - class constructor. - -Arguments: - - pWmData - Pointer to the watermark data to be set in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::SetData( - _In_ CONST WatermarkData* pWmData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER))) - { - try - { - // - // Remove any existing watermark feature node - // - if (SUCCEEDED(hr = Delete()) && - pWmData->type != NoWatermark) - { - // - // Construct the appropriate watermark element - // - CComPtr pWMDataElem(NULL); - PTDOMElementVector paramInitList; - - switch (pWmData->type) - { - case TextWatermark: - { - hr = CreateTextWMElements(pWmData, &pWMDataElem, ¶mInitList); - } - break; - - case BitmapWatermark: - { - hr = CreateBitmapWMElements(pWmData, &pWMDataElem, ¶mInitList); - } - break; - - case VectorWatermark: - { - hr = CreateVectorWMElements(pWmData, &pWMDataElem, ¶mInitList); - } - break; - - default: - { - hr = E_FAIL; - } - break; - } - - // - // Insert the watermark and paramater init nodes - // - CComPtr pPTRoot(NULL); - - CComBSTR bstrPTQuery(m_bstrFrameworkPrefix); - bstrPTQuery += PRINTTICKET_NAME; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetNode(bstrPTQuery, &pPTRoot))) - { - hr = pPTRoot->appendChild(pWMDataElem, NULL); - - PTDOMElementVector::iterator iterParamInit = paramInitList.begin(); - - for (;iterParamInit != paramInitList.end() && SUCCEEDED(hr); iterParamInit++) - { - hr = pPTRoot->appendChild(*iterParamInit, NULL); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::Delete - -Routine Description: - - This routine deletes the watermark feature from the PrintTicket passed to the - class constructor - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::Delete( - VOID - ) -{ - // - // Remove any existing watermark feature node - // - HRESULT hr = DeleteFeature(CComBSTR(WATERMARK_FEATURE)); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateCommonWMElements - -Routine Description: - - This routine creates all the DOM elements common to all Watermark types. Note that - this routine also returns the option element seperately (so the caller can specify the - watermark type) and a list of the ParameterInit elements (so the caller can append them - to the root PrintTicket element) - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - ppOptionElem - Pointer to an IXMLDOMElement pointer that recieves option element - pParamInitList - Pointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateCommonWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Outptr_ IXMLDOMElement** ppOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptionElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER))) - { - *ppWMDataElem = NULL; - - if (pWmData->layering < ELayeringOptionMin || - pWmData->layering >= ELayeringOptionMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create the feature option pair - CreateFeatureOptionPair does not - // set the option name, this is done in the calling function - // - if (SUCCEEDED(hr = CreateFeatureOptionPair(CComBSTR(WATERMARK_FEATURE), ppWMDataElem, ppOptionElem))) - { - // - // Over all common properties, create and insert the element - // - for (ECommonWatermarkProps cmnProps = ECommonWatermarkPropsMin; - cmnProps < ECommonWatermarkPropsMax && SUCCEEDED(hr); - cmnProps = static_cast(cmnProps + 1)) - { - // - // Create the scored property element - // - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(CMN_WATERMARK_PROPS[cmnProps]), &pScoredProperty))) - { - // - // Construct the param ref and param init elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - - if (wcscmp(CMN_WATERMARK_PROPS[cmnProps], L"Angle") == 0) - { - bstrPRefName += L"Text"; - } - - bstrPRefName += CMN_WATERMARK_PROPS[cmnProps]; - - CComPtr pParamRef(NULL); - CComPtr pParamInit(NULL); - - CComBSTR bstrType; - CComBSTR bstrValue; - - if (SUCCEEDED(hr = GetCmnPropTypeAndValue(pWmData, cmnProps, &bstrType, &bstrValue)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrPRefName, bstrType, bstrValue, &pParamRef, &pParamInit))) - { - // - // Append the parameter ref element to the scored property, append the - // scored property to the option element and add the parameter init - // element to the vector - // - CComPtr pPRInserted(NULL); - CComPtr pSPInserted(NULL); - - if (SUCCEEDED(hr = pScoredProperty->appendChild(pParamRef, &pPRInserted)) && - SUCCEEDED(hr = (*ppOptionElem)->appendChild(pScoredProperty, &pSPInserted))) - { - try - { - pParamInitList->push_back(pParamInit); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - - // - // Create the layering feature - // - CComPtr pLayeringElement(NULL); - CComPtr pLayeringOptionElement(NULL); - - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += LAYERING_OPTIONS[pWmData->layering]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateFeatureOptionPair(CComBSTR(LAYERING_FEATURE), - CComBSTR(LAYERING_OPTIONS[pWmData->layering]), - &pLayeringElement, - &pLayeringOptionElement))) - { - // - // Append the layering feature to the watermark feature node - // - hr = (*ppWMDataElem)->appendChild(pLayeringElement, NULL); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateCommonVectBmpWMElements - -Routine Description: - - This routine creates all the DOM elements common to all the vector and bitmap Watermark types. - -Arguments: - - pWmData - Pointer to the watermark data structure - pOptionElem - Pointer to an IXMLDOMElement to append the elements to - pParamInitList - Pointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateCommonVectBmpWMElements( - _In_ CONST WatermarkData* pWmData, - _In_ IXMLDOMElement* pOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOptionElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER))) - { - // - // Over all common properties, create and insert the element - // - for (EVectBmpWatermarkProps vectBmpProps = EVectBmpWatermarkPropsMin; - vectBmpProps < EVectBmpWatermarkPropsMax && SUCCEEDED(hr); - vectBmpProps = static_cast(vectBmpProps + 1)) - { - // - // Create the scored property element - // - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(VECTBMP_WATERMARK_PROPS[vectBmpProps]), &pScoredProperty))) - { - // - // Construct the param ref and param init elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += VECTBMP_WATERMARK_PROPS[vectBmpProps]; - - CComPtr pParamRef(NULL); - CComPtr pParamInit(NULL); - - CComBSTR bstrType; - CComBSTR bstrValue; - - if (SUCCEEDED(hr = GetCmnVectBmpPropTypeAndValue(pWmData, vectBmpProps, &bstrType, &bstrValue)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrPRefName, bstrType, bstrValue, &pParamRef, &pParamInit))) - { - // - // Append the parameter ref element to the scored property, append the - // scored property to the option element and add the parameter init - // element to the vector - // - CComPtr pPRInserted(NULL); - CComPtr pSPInserted(NULL); - - if (SUCCEEDED(hr = pScoredProperty->appendChild(pParamRef, &pPRInserted)) && - SUCCEEDED(hr = pOptionElem->appendChild(pScoredProperty, &pSPInserted))) - { - try - { - pParamInitList->push_back(pParamInit); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateTextWMElements - -Routine Description: - - This routine creates a text watermark feature in the PrintTicket - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - pParamInitList - P:ointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateTextWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - CComPtr pOptionElem(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER)) && - SUCCEEDED(hr = CreateCommonWMElements(pWmData, ppWMDataElem, &pOptionElem, pParamInitList))) - { - // - // Set the option node name attribute - // - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += WATERMARK_OPTIONS[TextWatermark]; - - hr = CreateXMLAttribute(pOptionElem, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - - // - // Write out the text specific options - // - if (SUCCEEDED(hr)) - { - for (ETextWatermarkProps txtProps = ETextWatermarkPropsMin; - txtProps < ETextWatermarkPropsMax && SUCCEEDED(hr); - txtProps = static_cast(txtProps + 1)) - { - // - // Create the scored property element - // - CComPtr pScoredProperty(NULL); - - if (SUCCEEDED(hr = CreateScoredProperty(CComBSTR(TXT_WATERMARK_PROPS[txtProps]), &pScoredProperty))) - { - // - // Construct the param ref and param init elements - // - CComBSTR bstrPRefName(WATERMARK_FEATURE); - bstrPRefName += TXT_WATERMARK_PROPS[txtProps]; - - CComPtr pParamRef(NULL); - CComPtr pParamInit(NULL); - - CComBSTR bstrType; - CComBSTR bstrValue; - - if (SUCCEEDED(hr = GetTxtPropTypeAndValue(pWmData, txtProps, &bstrType, &bstrValue)) && - SUCCEEDED(hr = CreateParamRefInitPair(bstrPRefName, bstrType, bstrValue, &pParamRef, &pParamInit))) - { - // - // Append the parameter ref element to the scored property, append the - // scored property to the option element and add the parameter init - // element to the param init list - // - CComPtr pPRInserted(NULL); - CComPtr pSPInserted(NULL); - - if (SUCCEEDED(hr = pScoredProperty->appendChild(pParamRef, &pPRInserted)) && - SUCCEEDED(hr = pOptionElem->appendChild(pScoredProperty, &pSPInserted))) - { - try - { - pParamInitList->push_back(pParamInit); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateBitmapWMElements - -Routine Description: - - This routine creates a bitmap watermark feature in the PrintTicket - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - pParamInitList - P:ointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateBitmapWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - CComPtr pOptionElem(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER)) && - SUCCEEDED(hr = CreateCommonWMElements(pWmData, ppWMDataElem, &pOptionElem, pParamInitList)) && - SUCCEEDED(hr = CreateCommonVectBmpWMElements(pWmData, pOptionElem, pParamInitList))) - { - // - // Set the option node name attribute - // - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += WATERMARK_OPTIONS[BitmapWatermark]; - - hr = CreateXMLAttribute(pOptionElem, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::CreateVectorWMElements - -Routine Description: - - This routine creates a vector watermark feature in the PrintTicket - -Arguments: - - pWmData - Pointer to the watermark data structure - ppWMDataElem - Pointer to an IXMLDOMElement pointer that recieves feature element - pParamInitList - P:ointer to a vector of DOM element pointers that recieves the parameter init elements - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::CreateVectorWMElements( - _In_ CONST WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ) -{ - HRESULT hr = S_OK; - - CComPtr pOptionElem(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppWMDataElem, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pParamInitList, E_POINTER)) && - SUCCEEDED(hr = CreateCommonWMElements(pWmData, ppWMDataElem, &pOptionElem, pParamInitList)) && - SUCCEEDED(hr = CreateCommonVectBmpWMElements(pWmData, pOptionElem, pParamInitList))) - { - // - // Set the option node name attribute - // - CComBSTR bstrAttribName(m_bstrKeywordsPrefix); - bstrAttribName += WATERMARK_OPTIONS[VectorWatermark]; - - hr = CreateXMLAttribute(pOptionElem, NAME_ATTRIBUTE_NAME, NULL, bstrAttribName ); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::GetCmnPropTypeAndValue - -Routine Description: - - This routine initalises the type and value strings for a given common watermark property - -Arguments: - - pWmData - Pointer to a watermark data structure with the watermark settings - cmnProps - The watermark setting to retrieve the type and value for - pbstrType - Pointer to a BSTR that recieves the type of the value - pbstrValue - Pointer to a BSTR that recieves the value as a string - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetCmnPropTypeAndValue( - _In_ CONST WatermarkData* pWmData, - _In_ CONST ECommonWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrType, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (cmnProps < ECommonWatermarkPropsMin || - cmnProps >= ECommonWatermarkPropsMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrType; - CStringXDW cstrValue; - - switch (cmnProps) - { - case WidthOrigin: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->widthOrigin); - } - break; - - case HeightOrigin: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->heightOrigin); - } - break; - - case Transparency: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->transparency); - } - break; - - case Angle: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->angle); - } - break; - - default: - { - hr = E_FAIL; - ERR("Unknown common watermark property\n"); - } - break; - } - - if (SUCCEEDED(hr)) - { - *pbstrType = cstrType.AllocSysString(); - *pbstrValue = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::GetCmnVectBmpPropTypeAndValue - -Routine Description: - - This routine initalises the type and value strings for a common vector and bitmap - watermark properties - -Arguments: - - pWmData - Pointer to a watermark data structure with the watermark settings - cmnProps - The setting to retrieve the type and value for - pbstrType - Pointer to a BSTR that recieves the type of the value - pbstrValue - Pointer to a BSTR that recieves the value as a string - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetCmnVectBmpPropTypeAndValue( - _In_ CONST WatermarkData* pWmData, - _In_ CONST EVectBmpWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrType, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (cmnProps < EVectBmpWatermarkPropsMin || - cmnProps >= EVectBmpWatermarkPropsMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrType; - CStringXDW cstrValue; - - switch (cmnProps) - { - case WidthExtent: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->widthExtent); - } - break; - - case HeightExtent: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->heightExtent); - } - break; - - default: - { - hr = E_FAIL; - ERR("Unknown common watermark property\n"); - } - break; - } - - if (SUCCEEDED(hr)) - { - *pbstrType = cstrType.AllocSysString(); - *pbstrValue = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTHandler::GetTxtPropTypeAndValue - -Routine Description: - - This routine initalises the type and value strings for a given text watermark property - -Arguments: - - pWmData - Pointer to a watermark data structure with the watermark settings - txtProps - The text watermark setting to retrieve the type and value for - pbstrType - Pointer to a BSTR that recieves the type of the value - pbstrValue - Pointer to a BSTR that recieves the value as a string - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTHandler::GetTxtPropTypeAndValue( - _In_ CONST WatermarkData* pWmData, - _In_ CONST ETextWatermarkProps txtProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWmData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrType, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrValue, E_POINTER))) - { - if (txtProps < ETextWatermarkPropsMin || - txtProps >= ETextWatermarkPropsMax) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrType; - CStringXDW cstrValue; - - switch (txtProps) - { - case FontColor: - { - cstrType = SCHEMA_STRING; - cstrValue.Format(L"%s", static_cast(pWmData->txtData.bstrFontColor)); - } - break; - - case FontSize: - { - cstrType = SCHEMA_INTEGER; - cstrValue.Format(L"%i", pWmData->txtData.fontSize); - } - break; - - case Text: - { - cstrType = SCHEMA_STRING; - cstrValue.Format(L"%s", static_cast(pWmData->txtData.bstrText)); - } - break; - - default: - { - hr = E_FAIL; - ERR("Unknown text watermark property\n"); - } - break; - } - - if (SUCCEEDED(hr)) - { - *pbstrType = cstrType.AllocSysString(); - *pbstrValue = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/wmpthndlr.h b/print/XPSDrvSmpl/src/common/wmpthndlr.h deleted file mode 100644 index 0cfd24e8..00000000 --- a/print/XPSDrvSmpl/src/common/wmpthndlr.h +++ /dev/null @@ -1,116 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmpthnlr.h - -Abstract: - - PageWatermark PrintTicket handling definition. The watermark PT handler - is used to extract watermark settings from a PrintTicket and populate - the watermark properties class with the retrieved settings. The class also - defines a method for setting the feature in the PrintTicket given the - data structure. - ---*/ - -#pragma once - -#include "pthndlr.h" -#include "wmdata.h" - -class CWMPTHandler : public CPTHandler -{ -public: - CWMPTHandler( - _In_ IXMLDOMDocument2* pPrintTicket - ); - - virtual ~CWMPTHandler(); - - HRESULT - GetData( - _Out_ XDPrintSchema::PageWatermark::WatermarkData* pWmData - ); - - HRESULT - SetData( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData - ); - - HRESULT - Delete( - VOID - ); - -private: - HRESULT - CreateCommonWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Outptr_ IXMLDOMElement** ppOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateCommonVectBmpWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ IXMLDOMElement* pOptionElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateTextWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateBitmapWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - CreateVectorWMElements( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _Outptr_ IXMLDOMElement** ppWMDataElem, - _Out_ PTDOMElementVector* pParamInitList - ); - - HRESULT - GetCmnPropTypeAndValue( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ CONST XDPrintSchema::PageWatermark::ECommonWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ); - - HRESULT - GetCmnVectBmpPropTypeAndValue( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ CONST XDPrintSchema::PageWatermark::EVectBmpWatermarkProps cmnProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ); - - HRESULT - GetTxtPropTypeAndValue( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData* pWmData, - _In_ CONST XDPrintSchema::PageWatermark::ETextWatermarkProps txtProps, - _Outptr_ BSTR* pbstrType, - _Outptr_ BSTR* pbstrValue - ); -}; - diff --git a/print/XPSDrvSmpl/src/common/wmschema.cpp b/print/XPSDrvSmpl/src/common/wmschema.cpp deleted file mode 100644 index 286e33db..00000000 --- a/print/XPSDrvSmpl/src/common/wmschema.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmschema.cpp - -Abstract: - - PageWatermark PrintSchema implementation. This implements the features, - options and enumerations that describe the PrintSchema PageWatermark feature. - ---*/ - -#include "precomp.h" -#include "wmschema.h" - -LPCWSTR XDPrintSchema::PageWatermark::WATERMARK_FEATURE = L"PageWatermark"; - -LPCWSTR XDPrintSchema::PageWatermark::WATERMARK_OPTIONS[] = { - L"None", - L"Text", - L"BitmapGraphic", - L"VectorGraphic" -}; - -LPCWSTR XDPrintSchema::PageWatermark::CMN_WATERMARK_PROPS[] = { - L"OriginWidth", - L"OriginHeight", - L"Transparency", - L"Angle" -}; - -LPCWSTR XDPrintSchema::PageWatermark::TXT_WATERMARK_PROPS[] = { - L"TextColor", - L"TextFontSize", - L"TextText" -}; - -LPCWSTR XDPrintSchema::PageWatermark::VECTBMP_WATERMARK_PROPS[] = { - L"SizeWidth", - L"SizeHeight" -}; - -LPCWSTR XDPrintSchema::PageWatermark::Layering::LAYERING_FEATURE = L"Layering"; - -LPCWSTR XDPrintSchema::PageWatermark::Layering::LAYERING_OPTIONS[] = { - L"Underlay", - L"Overlay" -}; - - diff --git a/print/XPSDrvSmpl/src/common/wmschema.h b/print/XPSDrvSmpl/src/common/wmschema.h deleted file mode 100644 index 734a99df..00000000 --- a/print/XPSDrvSmpl/src/common/wmschema.h +++ /dev/null @@ -1,114 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmschema.h - -Abstract: - - PageWatermark PrintSchema definition. This defines the features, options - and enumerations that describe the PrintSchema PageWatermark feature within - a XDPrintSchema::PageWatermark namespace. - ---*/ - -#pragma once - -#include "schema.h" - -namespace XDPrintSchema -{ - // - // PageWatermark elements described as Printschema keywords - // - namespace PageWatermark - { - // - // Feature name - // - extern LPCWSTR WATERMARK_FEATURE; - - // - // Option names - // - enum EWatermarkOption - { - NoWatermark = 0, EWatermarkOptionMin = 0, - TextWatermark, - BitmapWatermark, - VectorWatermark, - EWatermarkOptionMax - }; - - extern LPCWSTR WATERMARK_OPTIONS[EWatermarkOptionMax]; - - // - // Common watermark properties - // - enum ECommonWatermarkProps - { - WidthOrigin = 0, ECommonWatermarkPropsMin = 0, - HeightOrigin, - Transparency, - Angle, - ECommonWatermarkPropsMax - }; - - extern LPCWSTR CMN_WATERMARK_PROPS[ECommonWatermarkPropsMax]; - - // - // Text watermark properties - // - enum ETextWatermarkProps - { - FontColor = 0, ETextWatermarkPropsMin = 0, - FontSize, - Text, - ETextWatermarkPropsMax - }; - - extern LPCWSTR TXT_WATERMARK_PROPS[ETextWatermarkPropsMax]; - - // - // Vector / Bitmap common properties - // - enum EVectBmpWatermarkProps - { - WidthExtent = 0, EVectBmpWatermarkPropsMin = 0, - HeightExtent, - EVectBmpWatermarkPropsMax - }; - - extern LPCWSTR VECTBMP_WATERMARK_PROPS[EVectBmpWatermarkPropsMax]; - - // - // Layering sub feature - // - namespace Layering - { - extern LPCWSTR LAYERING_FEATURE; - - // - // Layering options - // - enum ELayeringOption - { - Underlay = 0, ELayeringOptionMin = 0, - Overlay, - ELayeringOptionMax - }; - - extern LPCWSTR LAYERING_OPTIONS[ELayeringOptionMax]; - } - } -} - diff --git a/print/XPSDrvSmpl/src/common/workbuff.cpp b/print/XPSDrvSmpl/src/common/workbuff.cpp deleted file mode 100644 index efa5fcc8..00000000 --- a/print/XPSDrvSmpl/src/common/workbuff.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - workbuff.cpp - -Abstract: - - CWorkingBuffer class implementation. This class provides a means of working - with a local buffer by defining a simple interface that allows the retrieval - of a buffer of an appropriate size, handling reallocation as necessary. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "workbuff.h" - -/*++ - -Routine Name: - - CWorkingBuffer::CWorkingBuffer - -Routine Description: - - CWorkingBuffer class constructor - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWorkingBuffer::CWorkingBuffer() : - m_pBuffer(NULL), - m_cbSize(CB_COPY_BUFFER) -{ - m_pBuffer = HeapAlloc(GetProcessHeap(), 0, m_cbSize); - - if (m_pBuffer == NULL) - { - m_cbSize = 0; - throw CXDException(E_OUTOFMEMORY); - } -} - -/*++ - -Routine Name: - - CWorkingBuffer::~CWorkingBuffer - -Routine Description: - - CWorkingBuffer class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWorkingBuffer::~CWorkingBuffer() -{ - if (m_pBuffer != NULL) - { - HeapFree(GetProcessHeap(), 0, m_pBuffer); - m_pBuffer = NULL; - m_cbSize = 0; - } -} - -/*++ - -Routine Name: - - CWorkingBuffer::GetBuffer - -Routine Description: - - This routine returns a pointer to a buffer of at least the requested size. If the internal - buffer is not large enough it will be resized accordingly. - -Arguments: - - cbSize - Requested size of the buffer - ppBuffer - Pointer to a VOID pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWorkingBuffer::GetBuffer( - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER))) - { - *ppBuffer = NULL; - - if (cbSize == 0) - { - hr = E_INVALIDARG; - } - - if (m_cbSize == 0) - { - // - // We have no existing buffer - we should have one - // - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - if (m_cbSize >= cbSize) - { - *ppBuffer = m_pBuffer; - } - else - { - // - // Double the buffer size till it is greater than the requested size - // - SIZE_T cbNewSize = m_cbSize; - while (cbNewSize < cbSize) - { - cbNewSize *= 2; - }; - - _Analysis_assume_(cbNewSize >= 1); - - // - // Reallocate the buffer - // - PVOID pNewBuffer = HeapReAlloc(GetProcessHeap(), 0, m_pBuffer, cbNewSize); - - if (pNewBuffer != NULL) - { - m_cbSize = cbNewSize; - m_pBuffer = pNewBuffer; - *ppBuffer = m_pBuffer; - } - else - { - hr = E_OUTOFMEMORY; - } - } - } - - ERR_ON_HR(hr); - return hr; -}; - -/*++ - -Routine Name: - - CWorkingBuffer::GetBufferAt - -Routine Description: - - This routine returns a pointer into the internal buffer at the requested offset. This will - not grow the size of the buffer. - -Arguments: - - cbOffset - Offset into the internal buffer - cbSize - Size of the requested buffer - ppBuffer - Pointer to a VOID pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) - If the internal buffer is not large enough - E_* - On error - ---*/ -HRESULT -CWorkingBuffer::GetBufferAt( - _In_ ULONG cbOffset, - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER))) - { - *ppBuffer = NULL; - - if (cbSize + cbOffset < m_cbSize) - { - *ppBuffer = reinterpret_cast(m_pBuffer) + cbOffset; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/common/workbuff.h b/print/XPSDrvSmpl/src/common/workbuff.h deleted file mode 100644 index 263e97d3..00000000 --- a/print/XPSDrvSmpl/src/common/workbuff.h +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - workbuff.h - -Abstract: - - CWorkingBuffer class definition. This class provides a means of working - with a local buffer by defining a simple interface that allows the retrieval - of a buffer of an appropriate size, handling reallocation as necessary. - ---*/ - -#pragma once - -class CWorkingBuffer -{ -public: - CWorkingBuffer(); - - virtual ~CWorkingBuffer(); - - HRESULT - GetBuffer( - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ); - - HRESULT - GetBufferAt( - _In_ ULONG cbOffset, - _In_ CONST ULONGLONG cbSize, - _Outptr_result_bytebuffer_(cbSize) PVOID* ppBuffer - ); - -private: - _Field_size_bytes_(m_cbSize) PVOID m_pBuffer; - - SIZE_T m_cbSize; -}; - diff --git a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj b/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj deleted file mode 100644 index 7cd9846d..00000000 --- a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj +++ /dev/null @@ -1,593 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {42677515-C196-4C0F-99A2-F11E2FB55BF6} - $(MSBuildProjectName) - false - true - Debug - Win32 - {D1077168-B333-455C-93E8-E83066110321} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - true - Level4 - Sync - MultiThreaded - MultiThreadedDebug - - - %(AdditionalIncludeDirectories);.\;.\..\inc;.\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - xdsmplcmn - - - xdsmplcmn - - - xdsmplcmn - - - xdsmplcmn - - - xdsmplcmn - - - xdsmplcmn - - - xdsmplcmn - - - xdsmplcmn - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj.Filters b/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj.Filters deleted file mode 100644 index b9b2d859..00000000 --- a/print/XPSDrvSmpl/src/common/xdsmplcmn.vcxproj.Filters +++ /dev/null @@ -1,2230 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {75E1F153-C8D9-48CA-BE6B-826ECD1DB3AD} - - - h;hpp;hxx;hm;inl;inc;xsd - {C230151A-AC0B-49BB-801B-E64449458C5F} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {DAF0D217-1F43-40AB-871C-801F743FDFC9} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/debug.cpp b/print/XPSDrvSmpl/src/debug/debug.cpp deleted file mode 100644 index 330a4a1d..00000000 --- a/print/XPSDrvSmpl/src/debug/debug.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - debug.cpp - -Abstract: - - Debug implementations. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdstring.h" - -/*++ - -Routine Name: - - RealDebugMessage - -Routine Description: - - This routine takes a debug message and va_list and outputs the message via OutputDebugString - -Arguments: - - dwSize - Maximum size of the debug message in number of characters - pszMessage - The debug message string - arglist - The arg list for the debug message string - -Return Value: - - BOOL - TRUE - On success - FALSE - On error - ---*/ -BOOL -RealDebugMessage( - _In_ DWORD dwSize, - _In_ PCSTR pszMessage, - va_list arglist - ) -{ - HRESULT hr = S_OK; - PSTR pszMsgBuf; - - if (NULL == pszMessage || - 0 == dwSize) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr)) - { - // - // Allocate memory for message buffer. - // - pszMsgBuf = new(std::nothrow) CHAR[dwSize + 1]; - - if (NULL != pszMsgBuf) - { - // - // Pass the variable parameters to wvsprintf to be formated. - // - hr = StringCbVPrintfA(pszMsgBuf, (dwSize + 1) * sizeof(CHAR), pszMessage, arglist); - - // - // Dump string to debug output. - // - OutputDebugStringA(pszMsgBuf); - - // - // Clean up. - // - delete[] pszMsgBuf; - pszMsgBuf = NULL; - } - else - { - hr = E_OUTOFMEMORY; - } - } - - return SUCCEEDED(hr); -} - -/*++ - -Routine Name: - - DbgPrint - -Routine Description: - - This routine takes a format string and arguments and outputs as a debug string - -Arguments: - - pszFormatString - Format string for the debug message - ... - argument list - -Return Value: - - BOOL - TRUE - On success - FALSE - On error - ---*/ -BOOL -DbgPrint( - _In_ PCSTR pszFormatString, - ... - ) -{ - BOOL bResult; - va_list VAList; - - // - // Pass the variable parameters to RealDebugMessage to be processed. - // - va_start(VAList, pszFormatString); - bResult = RealDebugMessage(0x8000, pszFormatString, VAList); - va_end(VAList); - - return bResult; -} - -/*++ - -Routine Name: - - DbgDOMDoc - -Routine Description: - - This routine outputs an XML DOM document to the debug output stream - -Arguments: - - pszMessage - Debug message - pDomDoc - DOM document to be output - -Return Value: - - None. - ---*/ -VOID -DbgDOMDoc( - _In_ PCSTR pszMessage, - _In_ IXMLDOMDocument2* pDomDoc - ) -{ - try - { - CComBSTR xml; - - if (pDomDoc != NULL && - SUCCEEDED(pDomDoc->get_xml(&xml))) - { - CStringXDA ansi(xml); - - if (pszMessage != NULL) - { - DbgPrint("%s%s\n", pszMessage, ansi.GetBuffer()); - } - else - { - DbgPrint("%s\n", ansi.GetBuffer()); - } - } - } - catch (CXDException&) - { - } -} - diff --git a/print/XPSDrvSmpl/src/debug/debug.h b/print/XPSDrvSmpl/src/debug/debug.h deleted file mode 100644 index ddfdc038..00000000 --- a/print/XPSDrvSmpl/src/debug/debug.h +++ /dev/null @@ -1,186 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsdbg.h - -Abstract: - - Debug definitions. - ---*/ - -#pragma once - -// -// These macros are used for debugging purposes. They expand -// to white spaces on a free build. Here is a brief description -// of what they do and how they are used: -// -// giDebugLevel -// Global variable which set the current debug level to control -// the amount of debug messages emitted. -// -// VERBOSE(msg) -// Display a message if the current debug level is <= DBG_VERBOSE. -// -// TERSE(msg) -// Display a message if the current debug level is <= DBG_TERSE. -// -// WARNING(msg) -// Display a message if the current debug level is <= DBG_WARNING. -// The message format is: WRN filename (linenumber): message -// -// ERR(msg) -// Similiar to WARNING macro above - displays a message -// if the current debug level is <= DBG_ERROR. -// -// ASSERT(cond) -// Verify a condition is true. If not, force a breakpoint. -// -// ASSERTMSG(cond, msg) -// Verify a condition is true. If not, display a message and -// force a breakpoint. -// -// RIP(msg) -// Display a message and force a breakpoint. -// -// Usage: -// These macros require extra parantheses for the msg argument -// example, ASSERTMSG(x > 0, ("x is less than 0\n")); -// WARNING(("App passed NULL pointer, ignoring...\n")); -// - -#pragma once - -#define DBG_VERBOSE 1 -#define DBG_TERSE 2 -#define DBG_WARNING 3 -#define DBG_ERROR 4 -#define DBG_RIP 5 - -BOOL -RealDebugMessage( - _In_ DWORD dwSize, - _In_ PCSTR pszMessage, - va_list arglist - ); - -BOOL -DbgPrint( - _In_ PCSTR pszFormatString, - ... - ); - -VOID -DbgDOMDoc( - _In_ PCSTR pszMessage, - _In_ IXMLDOMDocument2* pDomDoc - ); - -#if DBG - -#ifndef MAX_DEBUG_LEVEL -#define MAX_DEBUG_LEVEL DBG_VERBOSE -#endif - -#define DBGMSG(level, prefix, msg) { \ - INT dbgLevel = level; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel)) { \ - DbgPrint("%s %s (%d): ", prefix, __FILE__, __LINE__); \ - DbgPrint(msg); \ - } \ - } - -#define DBGMSG_ON_HR(level, prefix, hr) { \ - INT dbgLevel = level; \ - HRESULT hres = hr; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel) && FAILED(hres)) { \ - DbgPrint("%s %s (%d): Call failed with HRESULT = 0x%x\n", prefix, __FILE__, __LINE__, hr); \ - } \ - } - -#define DBGMSG_ON_HR_EXC(level, prefix, hr, hr_exc) { \ - INT dbgLevel = level; \ - HRESULT hres = hr; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel) && FAILED(hres) && hres != hr_exc) { \ - DbgPrint("%s %s (%d): Call failed with HRESULT = 0x%x\n", prefix, __FILE__, __LINE__, hr); \ - } \ - } - -#define DBGPRINT(level, msg) { \ - INT dbgLevel = level; \ - if (MAX_DEBUG_LEVEL <= (dbgLevel)) { \ - DbgPrint(msg); \ - } \ - } - -#define DBGXML(msg, pDomDoc) { \ - INT dbgLevel = DBG_VERBOSE; \ - if (MAX_DEBUG_LEVEL <= dbgLevel) { \ - DbgDOMDoc(msg, pDomDoc); \ - } \ - } - -#define VERBOSE(msg) DBGPRINT(DBG_VERBOSE, msg) -#define TERSE(msg) DBGPRINT(DBG_TERSE, msg) -#define WARNING(msg) DBGMSG(DBG_WARNING, "WRN", msg) -#define ERR(msg) DBGMSG(DBG_ERROR, "ERR", msg) -#define ERR_ON_HR(hr) DBGMSG_ON_HR(DBG_ERROR, "ERR", hr) -#define ERR_ON_HR_EXC(hr, hr_exc) DBGMSG_ON_HR_EXC(DBG_ERROR, "ERR", hr, hr_exc) - -#define ASSERT(cond) { \ - if (! (cond)) { \ - RIP(("\n")); \ - } \ - } - -#define ASSERTMSG(cond, msg) { \ - if (!(cond)) { \ - RIP(msg); \ - } \ - } - -#define RIP(msg) { \ - DBGMSG(DBG_RIP, "RIP", msg); \ - DebugBreak(); \ - } - -#define DBG_ONLY(p) p - -#else // !DBG - -#define VERBOSE(msg) -#define TERSE(msg) -#define WARNING(msg) -#define ERR(msg) -#define ERR_ON_HR(hr) -#define ERR_ON_HR_EXC(hr, hr_exc) - -#define ASSERT(cond) - -#define ASSERTMSG(cond, msg) - -#define RIP(msg) - -#define DBG_ONLY(p) - -#define DBGMSG(level, prefix, msg) - -#define DBGMSG_ON_HR(level, prefix, hr) - -#define DBGPRINT(level, msg) - -#define DBGXML(msg, pDomDoc) - -#endif - diff --git a/print/XPSDrvSmpl/src/debug/precomp.h b/print/XPSDrvSmpl/src/debug/precomp.h deleted file mode 100644 index fe380958..00000000 --- a/print/XPSDrvSmpl/src/debug/precomp.h +++ /dev/null @@ -1,67 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - precomp.h - -Abstract: - - Precompiled header. - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include - -// -// COM includes -// -#include -#include - -// -// ATL Includes -// -#include - -// -// STL Includes -// -#include - -// -// MSXML includes -// -#include - -#include - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/debug/precompsrc.cpp b/print/XPSDrvSmpl/src/debug/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/debug/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj deleted file mode 100644 index d719c20a..00000000 --- a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj +++ /dev/null @@ -1,343 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {E5DC3A24-691A-4F3A-B519-E4C49B2DAC98} - $(MSBuildProjectName) - false - true - Debug - Win32 - {53D0D9CF-F293-45DB-8027-4C68A5747835} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - xdsdbg - - - xdsdbg - - - xdsdbg - - - xdsdbg - - - xdsdbg - - - xdsdbg - - - xdsdbg - - - xdsdbg - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - MultiThreaded - MultiThreadedDebug - Sync - true - Level4 - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(AdditionalIncludeDirectories);.\;.\..\inc;$(DDK_INC_PATH) - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters b/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters deleted file mode 100644 index def7a023..00000000 --- a/print/XPSDrvSmpl/src/debug/xdsdbg.vcxproj.Filters +++ /dev/null @@ -1,33 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {D63DDF6B-528A-4350-B9BD-5781172E99A7} - - - h;hpp;hxx;hm;inl;inc;xsd - {BA0B6D06-BD16-42D4-94AD-1E321724C320} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {684F91A3-B169-45E2-BD6B-FE8D8524326C} - - - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp b/print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp deleted file mode 100644 index 67a4d867..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkflt.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkflt.cpp - -Abstract: - - Booklet filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support booklet - printing. The booklet filter is responsible for re-ordering pages and re-uses - the NUp filter to provide 2-up and offset support. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "pthndlr.h" -#include "bkflt.h" -#include "bksax.h" -#include "bkpthndlr.h" - -using XDPrintSchema::Binding::BindingData; - -/*++ - -Routine Name: - - CBookletFilter::CBookletFilter - -Routine Description: - - Default constructor for the booklet filter which initialises the - filter to sensible default values - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletFilter::CBookletFilter() : - m_bSendAllDocs(TRUE), - m_bookScope(CBkPTProperties::None) -{ -} - -/*++ - -Routine Name: - - CBookletFilter::~CBookletFilter - -Routine Description: - - Default destructor for the booklet filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletFilter::~CBookletFilter() -{ -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document sequence part in a container - -Arguments: - - pFDS - Pointer to the fixed document sequence to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ) -{ - VERBOSE("Processing Fixed Document Sequence part with booklet filter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - // - // Get the PT manager to return the FixedDocumentSequence ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFDS)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTJobScope, &pPT))) - { - // - // Set the binding scope from the PrintTicket - // - hr = SetBindingScope(pPT); - } - } - - if (SUCCEEDED(hr)) - { - hr = m_pXDWriter->SendFixedDocumentSequence(pFDS); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document part in a container - -Arguments: - - pFD - Pointer to the fixed document to process - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CBookletFilter::ProcessPart( - _Inout_ IFixedDocument* pFD - ) -{ - VERBOSE("Processing Fixed Document part with booklet filter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER)) && - SUCCEEDED(hr = m_ptManager.SetTicket(pFD))) - { - // - // If we are in a JobBook session we want to maintain the current - // JobBook settings - // - if (m_bookScope != CBkPTProperties::Job) - { - // - // Flush any outstanding pages in case we have just completed a - // DocNUp sequence - // - hr = FlushCache(); - - // - // Get the PT manager to return the FixedDocument ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTDocumentScope, &pPT))) - { - // - // Set the binding scope from the PrintTicket - // - hr = SetBindingScope(pPT); - } - } - } - - if (SUCCEEDED(hr) && - m_bSendAllDocs) - { - hr = m_pXDWriter->SendFixedDocument(pFD); - - // - // If we are JobBindAllDocuments we only ever send one doc - now we have - // sent the first document we can test to see if we need to send all of them - // - if (m_bookScope == CBkPTProperties::Job) - { - m_bSendAllDocs = FALSE; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - ASSERTMSG(m_pXDWriter != NULL, "XD writer is not initialised.\n"); - - VERBOSE("Processing Fixed Page with booklet filter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pXDWriter, E_PENDING))) - { - // - // Check if we are processing a booklet job - // - if (m_bookScope != CBkPTProperties::None) - { - // - // Cache pages for reordering - // - try - { - m_cacheFP.push_back(pFP); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - else - { - hr = m_pXDWriter->SendFixedPage(pFP); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::Finalize - -Routine Description: - - Method to flush the cache of pages as the last action of the filter - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::Finalize( - VOID - ) -{ - // - // Just flush the cache of pages - // - return FlushCache(); -} - -/*++ - -Routine Name: - - CBookletFilter::FlushCache - -Routine Description: - - Method to send the cached collection of pages in the correct order back - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::FlushCache( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_pXDWriter == NULL) - { - hr = E_PENDING; - } - - size_t cPages = m_cacheFP.size(); - - if (SUCCEEDED(hr) && - cPages > 0 && - m_bookScope != CBkPTProperties::None) - { - // - // We may need to add a pad page if the page count is odd - // - CComPtr pNewFP(NULL); - if (cPages%2 == 1 && - SUCCEEDED(hr = CreatePadPage(&pNewFP))) - { - // - // We successfully created our pad page; add it to the cache - // - try - { - m_cacheFP.push_back(pNewFP); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - cPages++; - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Re-order pages in the cache - // - map reorderedPages; - size_t newIndex = 0; - size_t pageIndex = 0; - for (pageIndex = 0; pageIndex < cPages/2; pageIndex++) - { - reorderedPages[newIndex] = m_cacheFP[pageIndex]; - newIndex += 2; - } - - newIndex = cPages - 1; - for (pageIndex = cPages/2; pageIndex < cPages; pageIndex++) - { - reorderedPages[newIndex] = m_cacheFP[pageIndex]; - newIndex -= 2; - } - - // - // Write out reordered pages - // - for (pageIndex = 0; pageIndex < cPages && SUCCEEDED(hr); pageIndex++) - { - hr = m_pXDWriter->SendFixedPage(reorderedPages[pageIndex]); - } - - // - // Clean out the cache - // - m_cacheFP.clear(); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::CreatePadPage - -Routine Description: - - Method to create a pad page which is required for odd page counts to - ensure pages are correctly ordered for presentation as a booklet - -Arguments: - - ppNewPage - Pointer to a pointer to the newly created fixed page - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletFilter::CreatePadPage( - _Outptr_ IFixedPage** ppNewPage - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters and members before proceeding - // - if (SUCCEEDED(hr = CHECK_POINTER(ppNewPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pXDWriter, E_PENDING))) - { - *ppNewPage = NULL; - PCWSTR pszPageName = NULL; - - try - { - // - // Create a unique name for the pad page for this print session - // - CStringXDW szNewPageName; - szNewPageName.Format(L"/Pad_page_%u.xaml", GetUniqueNumber()); - pszPageName = szNewPageName.GetBuffer(); - - // - // Create a new empty page and retrieve a writer. Also get a - // reader from the first page so we can copy the FixedPage root - // element. This ensures the page sizes match. - // - CComPtr pWriter(NULL); - CComPtr pSaxRdr(NULL); - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pXDWriter->GetNewEmptyPart(pszPageName, - IID_IFixedPage, - reinterpret_cast(ppNewPage), - &pWriter)) && - SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60))) - { - // - // We use a simple SAX handler which copies only the root - // element and discards all other content. - // - CBkSaxHandler bkSaxHndlr(pWriter); - CComPtr pReader(NULL); - - IFixedPage* pFP = NULL; - - pFP = m_cacheFP[0]; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&bkSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast(pReadStreamToSeq))); - } - } - - pWriter->Close(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletFilter::SetBindingScope - -Routine Description: - - Method to retrieve the binding scope from a PrintTicket - -Arguments: - - pPT - Pointer to the PrintTicket to retrieve the scope from - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - Booklet settings not present in the PT - E_* - On error - ---*/ -HRESULT -CBookletFilter::SetBindingScope( - _In_ IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPT, E_POINTER))) - { - try - { - BindingData bindingData; - CBookPTHandler bkPTHandler(pPT); - - // - // Retrieve the booklet properties from the ticket via the handler - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = bkPTHandler.GetData(&bindingData))) - { - CBkPTProperties bookletPTProps(bindingData); - - // - // Retrieve the booklet scope - // - hr = bookletPTProps.GetScope(&m_bookScope); - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // Booklet PT settings are not present - reset hr to S_FALSE and proceed - // - hr = S_FALSE; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkflt.h b/print/XPSDrvSmpl/src/filters/booklet/bkflt.h deleted file mode 100644 index 52f72378..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkflt.h +++ /dev/null @@ -1,80 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkflt.h - -Abstract: - - Booklet filter class definition. This class derives from the Xps filter - class and implements the necessary part handlers to support booklet - printing. The booklet filter is responsible for re-ordering pages and re-uses - the NUp filter to provide 2-up and offset support. - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "bkprps.h" - -class CBookletFilter : public CXDXpsFilter -{ -public: - CBookletFilter(); - - virtual ~CBookletFilter(); - -private: - HRESULT - ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ); - - HRESULT - ProcessPart( - _Inout_ IFixedDocument* pFD - ); - - HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - HRESULT - Finalize( - VOID - ); - - HRESULT - FlushCache( - VOID - ); - - HRESULT - CreatePadPage( - _Outptr_ IFixedPage** ppNewPage - ); - - HRESULT - SetBindingScope( - _In_ IXMLDOMDocument2* pPT - ); - -private: - vector > m_cacheFP; - - BOOL m_bSendAllDocs; - - CBkPTProperties::EBookletScope m_bookScope; -}; - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkflt.rc b/print/XPSDrvSmpl/src/filters/booklet/bkflt.rc deleted file mode 100644 index 4834b059..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 Microsoft Corporation -// -// All rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// File Name: -// -// bkflt.rc -// -// Abstract: -// -// Booklet filter resource file. -// -// - -#include -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Booklet Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp b/print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp deleted file mode 100644 index dce58de0..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkprps.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkprps.cpp - -Abstract: - - Booklet properties class implementation. The booklet properties class - is responsible for interpreting booklet data appropriate to the booklet - filter. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "bkprps.h" - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::JobBindAllDocuments; -using XDPrintSchema::Binding::None; - -/*++ - -Routine Name: - - CBkPTProperties::CBkPTProperties - -Routine Description: - - Default constructor for the booklet PrintTicket properties class which - sets the internal binding setting to the setting supplied - -Arguments: - - bindingData - Structure containing the booklet binding settings - from the PrintTicket - -Return Value: - - None - ---*/ -CBkPTProperties::CBkPTProperties( - _In_ CONST BindingData& bindingData - ) : - m_bindData(bindingData) -{ -} - -/*++ - -Routine Name: - - CBkPTProperties::~CBkPTProperties - -Routine Description: - - Default destructor for the CBkPTProperties class - -Arguments: - - None - -Return Value: - - None - ---*/ -CBkPTProperties::~CBkPTProperties() -{ -} - -/*++ - -Routine Name: - - CBkPTProperties::GetScope - -Routine Description: - - Method to return the booklet scope which can be either none, job wide or document wide - -Arguments: - - pBkScope - Booklet printing scope which can be None, Job wide or Document - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBkPTProperties::GetScope( - _Out_ EBookletScope* pBkScope - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBkScope, E_POINTER))) - { - *pBkScope = CBkPTProperties::None; - - if (m_bindData.bindOption != None) - { - *pBkScope = m_bindData.bindFeature == JobBindAllDocuments ? CBkPTProperties::Job : CBkPTProperties::Document; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/booklet/bkprps.h b/print/XPSDrvSmpl/src/filters/booklet/bkprps.h deleted file mode 100644 index 38d17c26..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bkprps.h +++ /dev/null @@ -1,52 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkprps.h - -Abstract: - - Booklet properties class definition. The booklet properties class - is responsible for holding and controling booklet properties. - ---*/ - -#pragma once - -#include "bkdata.h" - -class CBkPTProperties -{ -public: - enum EBookletScope - { - None = 0, - Job, - Document - }; - -public: - CBkPTProperties( - _In_ CONST XDPrintSchema::Binding::BindingData& bindingData - ); - - virtual ~CBkPTProperties(); - - HRESULT - GetScope( - _Out_ EBookletScope* pBkScope - ); - -private: - XDPrintSchema::Binding::BindingData m_bindData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bksax.cpp b/print/XPSDrvSmpl/src/filters/booklet/bksax.cpp deleted file mode 100644 index 8582e72c..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bksax.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bksax.cpp - -Abstract: - - Booklet filter SAX handler implementation. The booklet SAX handler derives - from the default SAX handler and implements the necesary SAX interfaces to - process fixed page mark-up for booklet printing. - For documents with odd page counts, we add a blank padding page so that the - 2-Up behaves correctly. All that is required of the handler is to retrieve - the fixed page open tag and write this out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "bksax.h" - -/*++ - -Routine Name: - - CBkSaxHandler::CBkSaxHandler - -Routine Description: - - Contructor for the booklet filters SAX handler which registers - internally the writer for sending new markup out to - -Arguments: - - pWriter - Pointer to a write stream which receives markup - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CBkSaxHandler::CBkSaxHandler( - _In_ IPrintWriteStream* pWriter - ) : - m_pWriter(pWriter) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to booklet SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBkSaxHandler::~CBkSaxHandler - -Routine Description: - - Default destructor for the booklet filters SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CBkSaxHandler::~CBkSaxHandler() -{ -} - -/*++ - -Routine Name: - - CBkSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CBkSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - CComBSTR bstrElement; - - hr = bstrElement.Append(pwchQName, cchQName); - - // - // All we are doing is copying the fixed page root into the new - // document to ensure the same page size - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - bstrElement == L"FixedPage" && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - try - { - cstrOut.Append(L"<"); - cstrOut.Append(bstrElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // For all attributes - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - // - // Close the fixed page tag - // - if (SUCCEEDED(hr)) - { - try - { - cstrOut.Append(L"/>"); - } - catch (CXDException& e) - { - hr = e; - } - } - - // - // Write out the empty page - // - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CBkSaxHandler::startDocument - -Routine Description: - - SAX handler method which handles the start document call to ensure - the xml version is correctly set - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CBkSaxHandler::startDocument( - void - ) -{ - HRESULT hr = S_OK; - - try - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pWriter, E_FAIL))) - { - CStringXDW cstrOut(L""); - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/booklet/bksax.h b/print/XPSDrvSmpl/src/filters/booklet/bksax.h deleted file mode 100644 index 7a0826b4..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/bksax.h +++ /dev/null @@ -1,59 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bksax.cpp - -Abstract: - - Booklet filter SAX handler definition. The booklet SAX handler derives - from the default SAX handler and implements the necesary SAX interfaces to - process fixed page mark-up for booklet printing. - For documents with odd page counts, we add a blank padding page so that the - 2-Up behaves correctly. All that is required of the handler is to retrieve - the fixed page open tag and write this out. - ---*/ - -#pragma once - -#include "saxhndlr.h" - -class CBkSaxHandler : public CSaxHandler -{ -public: - CBkSaxHandler( - _In_ IPrintWriteStream* pWriter - ); - - virtual ~CBkSaxHandler(); - - HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - -private: - CComPtr m_pWriter; -}; - diff --git a/print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp b/print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp deleted file mode 100644 index 6d6c97b9..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/dllentry.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the booklet filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "bkflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the booklet filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 87AFE626-06CC-4672-A2C1-1B7CF12CBEDD - // - CLSID bookletCLSID = {0x87AFE626, 0x06CC, 0x4672, {0xA2, 0xC1, 0x1B, 0x7C, 0xF1, 0x2C, 0xBE, 0xDD}}; - - return GetFilterClassFactory(rclsid, riid, bookletCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/booklet/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/booklet/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/booklet/xdbook.def b/print/XPSDrvSmpl/src/filters/booklet/xdbook.def deleted file mode 100644 index ad3c7eda..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/xdbook.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 Microsoft Corporation -; -; All rights reserved. -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; File Name: -; -; xdbook.def -; -; Abstract: -; -; Booklet filter module definition file -; - -LIBRARY XDBook - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj b/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj deleted file mode 100644 index be4eedd5..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj +++ /dev/null @@ -1,540 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {8D542B56-EB45-43B1-AAB8-417352F5BDE6} - $(MSBuildProjectName) - false - true - Debug - Win32 - {A382BFF2-1BDB-408F-9E26-D62594210A87} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - xdbook - - - xdbook - - - xdbook - - - xdbook - - - xdbook - - - xdbook - - - xdbook - - - xdbook - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - xdbook.def - - - - - xdbook.def - - - - - xdbook.def - - - - - xdbook.def - - - - - xdbook.def - - - - - xdbook.def - - - - - xdbook.def - - - - - xdbook.def - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj.Filters deleted file mode 100644 index 3f281a6c..00000000 --- a/print/XPSDrvSmpl/src/filters/booklet/xdbook.vcxproj.Filters +++ /dev/null @@ -1,65 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {27EE07C8-4A3B-416F-9266-E7701F9FB1DB} - - - h;hpp;hxx;hm;inl;inc;xsd - {6811EDBB-9803-4589-BAAE-09AD34EC922A} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {68346DB5-5823-45D6-8621-B9323A164F62} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - Header Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/XDColMan.def b/print/XPSDrvSmpl/src/filters/color/XDColMan.def deleted file mode 100644 index 1e85c9f1..00000000 --- a/print/XPSDrvSmpl/src/filters/color/XDColMan.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 Microsoft Corporation -; -; All rights reserved. -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; File Name: -; -; xdwmark.def -; -; Abstract: -; -; Watermark filter module definition file -; - -LIBRARY XDColMan - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj b/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj deleted file mode 100644 index aa6176fc..00000000 --- a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj +++ /dev/null @@ -1,614 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {C9C14C99-103E-45CB-B1B4-2C165429E35C} - $(MSBuildProjectName) - false - true - Debug - Win32 - {78463D57-E549-447C-A846-B9301DBB2BC9} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - XDColMan - - - XDColMan - - - XDColMan - - - XDColMan - - - XDColMan - - - XDColMan - - - XDColMan - - - XDColMan - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalDependencies);mscms.lib;windowscodecs.lib - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - XDColMan.def - - - - - XDColMan.def - - - - - XDColMan.def - - - - - XDColMan.def - - - - - XDColMan.def - - - - - XDColMan.def - - - - - XDColMan.def - - - - - XDColMan.def - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj.Filters deleted file mode 100644 index 4602c7b8..00000000 --- a/print/XPSDrvSmpl/src/filters/color/XDColMan.vcxproj.Filters +++ /dev/null @@ -1,329 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {D821B726-E809-40D7-B964-B46198856820} - - - h;hpp;hxx;hm;inl;inc;xsd - {25073272-3E9F-4F45-B3A7-805E2F15B111} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {2EAE715D-4338-4A62-8F12-EC400CFF4D18} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/bmpconv.cpp b/print/XPSDrvSmpl/src/filters/color/bmpconv.cpp deleted file mode 100644 index 8c6bd347..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpconv.cpp +++ /dev/null @@ -1,1187 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bmpconv.cpp - -Abstract: - - WIC bitmap conversion class implementation. This class provides a wrapper to a bitmap - stream that uses WIC to access bitmap data and provide conversion functionality. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "bmpconv.h" - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter default constructor - -Arguments: - - None - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter() : - m_pImagingFactory(NULL), - m_pBitmap(NULL), - m_pColorContext(NULL), - m_pCurrentLock(NULL), - m_ePixelFormat(kWICPixelFormatDontCare) -{ - // - // Make sure we have an imaging factory to work with - // - HRESULT hr = CreateImagingFactory(); - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter constructor - -Arguments: - - ePixFormat - Bitmap pixel format - cWidth - Bitmap width - cHeight - Bitmap height - dpiX - Bitmap horizontal resolution - dpiY - Bitmap vertical resolution - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ) : - m_pImagingFactory(NULL), - m_pBitmap(NULL), - m_pColorContext(NULL), - m_pCurrentLock(NULL), - m_ePixelFormat(ePixFormat) -{ - HRESULT hr = S_OK; - - // - // Make sure we have an imaging factory to work with... - // - if (SUCCEEDED(hr = CreateImagingFactory())) - { - // - // ...and that the underlying bitmap is created and intialized. - // - hr = Initialize(m_ePixelFormat, cWidth, cHeight, dpiX, dpiY); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter constructor - -Arguments: - - pStream - Stream containing the bitmap container data - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter( - _In_ IStream* pStream - ) : - m_pImagingFactory(NULL), - m_pBitmap(NULL), - m_pColorContext(NULL), - m_pCurrentLock(NULL), - m_ePixelFormat(kWICPixelFormatDontCare) -{ - HRESULT hr = S_OK; - - // - // Make sure we have an imaging factory to work with... - // - if (SUCCEEDED(hr = CreateImagingFactory())) - { - // - // ...and that the underlying bitmap is created and intialized from the input stream. - // - hr = Initialize(pStream); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CBmpConverter::CBmpConverter - -Routine Description: - - CBmpConverter constructor - -Arguments: - - converter - Converter class to construct from - -Return Value: - - None - Throws an exception on error. - ---*/ -CBmpConverter::CBmpConverter( - _In_ CONST CBmpConverter& converter - ) : - m_pImagingFactory(converter.m_pImagingFactory), - m_pBitmap(converter.m_pBitmap), - m_pColorContext(converter.m_pColorContext), - m_pCurrentLock(converter.m_pCurrentLock), - m_ePixelFormat(converter.m_ePixelFormat) -{ - ASSERTMSG(m_pCurrentLock == NULL, "Copying locked bitmap can lead to a deadlock when writing out the bitmap.\n"); -} - -/*++ - -Routine Name: - - CBmpConverter::~CBmpConverter - -Routine Description: - - CBmpConverter destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBmpConverter::~CBmpConverter() -{ -} - -/*++ - -Routine Name: - - CBmpConverter::Initialize - -Routine Description: - - Initializes the bitmap given format, dimensions and resolution - -Arguments: - - ePixFormat - Bitmap pixel format - cWidth - Bitmap width - cHeight - Bitmap height - dpiX - Bitmap horizontal resolution - dpiY - Bitmap vertical resolution - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Initialize( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ) -{ - HRESULT hr = S_OK; - - if (ePixFormat <= kWICPixelFormatMin || - ePixFormat >= kWICPixelFormatMax || - cWidth == 0 || - cHeight == 0 || - dpiX <= 0 || - dpiY <= 0) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - // - // Create the bitmap - // - m_pBitmap = NULL; - m_ePixelFormat = ePixFormat; - if (SUCCEEDED(hr = m_pImagingFactory->CreateBitmap(cWidth, - cHeight, - g_lutPixFrmtGuid[m_ePixelFormat], - WICBitmapCacheOnLoad, - &m_pBitmap)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_FAIL))) - { - // - // Make sure the resolution is preserved - this can lead to strange scaling - // in an XPS document if the resoution changes - // - hr = m_pBitmap->SetResolution(dpiX, dpiY); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Initialize - -Routine Description: - - Initializes the bitmap from a stream containing the container information - -Arguments: - - pStream - Streamed container information - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Initialize( - _In_ IStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - CComPtr pDecoder(NULL); - CComPtr pBitmapSrcFrame(NULL); - LARGE_INTEGER cbMoveFromStart = {0}; - - // - // Ensure we have released any current color contexts - // - m_pColorContext = NULL; - - // - // Create a decoder from the input stream and retrieve the first frame. Create a color context - // to recieve any potential embedded color profiles. - // - if (SUCCEEDED(hr = pStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL)) && - SUCCEEDED(hr = m_pImagingFactory->CreateDecoderFromStream(pStream, NULL, WICDecodeMetadataCacheOnDemand, &pDecoder)) && - SUCCEEDED(hr = CHECK_POINTER(pDecoder, E_FAIL)) && - SUCCEEDED(hr = pDecoder->GetFrame(0, &pBitmapSrcFrame)) && - SUCCEEDED(hr = CHECK_POINTER(pDecoder, E_FAIL)) && - SUCCEEDED(hr = m_pImagingFactory->CreateColorContext(&m_pColorContext)) && - SUCCEEDED(hr = CHECK_POINTER(m_pColorContext, E_FAIL))) - { - // - // Check for an embedded color context - // - UINT cColContexts = 0; - if (SUCCEEDED(hr = pBitmapSrcFrame->GetColorContexts(1, &(m_pColorContext.p), &cColContexts))) - { - // - // If there are no color contexts, ensure the color context is released - // - if (cColContexts == 0) - { - m_pColorContext = NULL; - } - - hr = Initialize(pBitmapSrcFrame); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Initialize - -Routine Description: - - Intializes the bitmap from a WIC bitmap source - -Arguments: - - pSource - pointer to the WIC bitmap source interface to intialize from - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Initialize( - _In_ IWICBitmapSource* pSource - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - // - // Make sure we have released any current bitmaps - // - m_pBitmap = NULL; - - // - // Create the bitmap from the source and set the pixel format enumeration from the GUID - // - WICPixelFormatGUID guidPixFormat; - if (SUCCEEDED(hr = m_pImagingFactory->CreateBitmapFromSource(pSource, WICBitmapCacheOnDemand, &m_pBitmap)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_FAIL)) && - SUCCEEDED(hr = m_pBitmap->GetPixelFormat(&guidPixFormat))) - { - hr = PixelFormatFromGUID(guidPixFormat, &m_ePixelFormat); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Write - -Routine Description: - - Writes the bitmap to a stream using the requested container format - -Arguments: - - guidContainerFormat - Requested container format to write out - pStream - The destination stream to write to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Write( - _In_ REFGUID guidContainerFormat, - _Inout_ IStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - CComPtr pEncoder(NULL); - CComPtr pFrame(NULL); - CComPtr pPropertyBag(NULL); - - UINT srcWidth = 0; - UINT srcHeight = 0; - - DOUBLE xRes = 0.0; - DOUBLE yRes = 0.0; - - WICPixelFormatGUID srcFormat; - - // - // Create the appropriate encoder, set the stream to recieve the data and retrieve a frame. - // Initialize the frame from the current bitmap data. - // - if (SUCCEEDED(hr = m_pImagingFactory->CreateEncoder(guidContainerFormat, NULL, &pEncoder)) && - SUCCEEDED(hr = pEncoder->Initialize(pStream, WICBitmapEncoderNoCache)) && - SUCCEEDED(hr = pEncoder->CreateNewFrame(&pFrame, &pPropertyBag)) && - SUCCEEDED(hr = CHECK_POINTER(pFrame, E_FAIL)) && - SUCCEEDED(hr = CHECK_POINTER(pPropertyBag, E_FAIL)) && - SUCCEEDED(hr = pFrame->Initialize(pPropertyBag)) && - SUCCEEDED(hr = m_pBitmap->GetSize(&srcWidth, &srcHeight)) && - SUCCEEDED(hr = m_pBitmap->GetResolution(&xRes, &yRes)) && - SUCCEEDED(hr = m_pBitmap->GetPixelFormat(&srcFormat))) - { - WICRect sizeSrc = {0}; - sizeSrc.Width = static_cast(srcWidth); - sizeSrc.Height = static_cast(srcHeight); - - if (SUCCEEDED(hr = pFrame->SetSize(srcWidth, srcHeight)) && - SUCCEEDED(hr = pFrame->SetResolution(xRes, yRes)) && - SUCCEEDED(hr = pFrame->SetPixelFormat(&srcFormat))) - { - if (HasColorContext()) - { - hr = pFrame->SetColorContexts(1, &m_pColorContext.p); - } - - if (SUCCEEDED(hr)) - { - // - // Write the bitmap data to the frame. - // - hr = pFrame->WriteSource(m_pBitmap, &sizeSrc); - } - } - } - - // - // Commit the frame and the encoder - this sets the bitmap data and encodes the - // bitmap into a container - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pFrame->Commit())) - { - hr = pEncoder->Commit(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::Convert - -Routine Description: - - Uses WIC to convert from the current pixel format to the requested pixel format - -Arguments: - - ePixFormat - the requested pixel format - pbCanConvert - variable that recieves whether the conversion is possible - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::Convert( - _In_ EWICPixelFormat ePixFormat, - _Out_ BOOL* pbCanConvert - ) -{ - HRESULT hr = S_OK; - - if (ePixFormat > kWICPixelFormatDontCare && - ePixFormat < kWICPixelFormatMax) - { - if (SUCCEEDED(hr = CHECK_POINTER(pbCanConvert, E_POINTER))) - { - *pbCanConvert = TRUE; - } - } - else - { - hr = E_INVALIDARG; - } - - // - // If the requested format differs from the original we need to do some work. - // - if (SUCCEEDED(hr) && - ePixFormat != m_ePixelFormat) - { - CComPtr pConverter(NULL); - - WICPixelFormatGUID dstFormat = g_lutPixFrmtGuid[ePixFormat]; - WICPixelFormatGUID srcFormat; - - // - // Retrieve a format converter, intialize from the current bitmap the use the converter - // to reset the bitmap to the appropriate type. - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = m_pImagingFactory->CreateFormatConverter(&pConverter)) && - SUCCEEDED(hr = CHECK_POINTER(pConverter, E_FAIL)) && - SUCCEEDED(hr = m_pBitmap->GetPixelFormat(&srcFormat)) && - SUCCEEDED(hr = pConverter->CanConvert(srcFormat, dstFormat, pbCanConvert)) && - *pbCanConvert && - SUCCEEDED(hr = pConverter->Initialize(m_pBitmap, dstFormat, WICBitmapDitherTypeNone, NULL, 0.0f, WICBitmapPaletteTypeCustom))) - { - hr = Initialize(pConverter); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::LockSurface - -Routine Description: - - Locks the requested rectangle for reading and writing of the pixel data directly - -Arguments: - - prcLock - The rectangle area of the bitmap to lock - bReadOnly - Is this a read only lock - pcbStride - Pointer to variable that recieves the stride between scanlines - pcWidth - Pointer to variable that recieves the bitmap pixel width - pcHeight - Pointer to variable that recieves the bitmap pixel height - pcbData - Pointer to variable that recieves the size of the pixel data buffer - ppbData - Pointer to a BYTE pointer that recieves the data pointer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::LockSurface( - _In_ WICRect* prcLock, - _In_ CONST BOOL& bReadOnly, - _Out_ UINT* pcbStride, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Inout_ UINT* pcbData, - _Outptr_result_bytebuffer_maybenull_(*pcbData) - PBYTE* ppbData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(prcLock, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbStride, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcHeight, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppbData, E_POINTER))) - { - *pcbStride = 0; - *pcWidth = 0; - *pcHeight = 0; - *pcbData = 0; - *ppbData = NULL; - - // - // Free any current locks and acquire a new one. Get the stride, size and data from the lock. - // - m_pCurrentLock = NULL; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pBitmap->Lock(prcLock, bReadOnly ? WICBitmapLockRead : WICBitmapLockWrite, &m_pCurrentLock)) && - SUCCEEDED(hr = CHECK_POINTER(m_pCurrentLock, E_FAIL)) && - SUCCEEDED(hr = m_pCurrentLock->GetStride(pcbStride)) && - SUCCEEDED(hr = m_pCurrentLock->GetSize(pcWidth, pcHeight))) - { - hr = m_pCurrentLock->GetDataPointer(pcbData, ppbData); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::UnlockSurface - -Routine Description: - - Unlocks any current lock on the bitmap surface - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::UnlockSurface( - VOID - ) -{ - m_pCurrentLock = NULL; - - return S_OK; -} - -/*++ - -Routine Name: - - CBmpConverter::GetColorContext - -Routine Description: - - Retrieves any color context associated with the bitmap - -Arguments: - - ppColorContext - Pointer to a color context interface pointer to recieve the context - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - On no context present - E_* - On error - ---*/ -HRESULT -CBmpConverter::GetColorContext( - _Outptr_ IWICColorContext** ppColorContext - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppColorContext, E_POINTER))) - { - *ppColorContext = NULL; - - if (HasColorContext()) - { - *ppColorContext = m_pColorContext; - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::HasAlphaChannel - -Routine Description: - - Indicates if the bitmap has an alpha channel - -Arguments: - - None - -Return Value: - - TRUE - The bitmap has an alpha channel - FALSE - There is no alpha channel - ---*/ -BOOL -CBmpConverter::HasAlphaChannel( - VOID - ) CONST -{ - BOOL bHasAlpha = FALSE; - - switch (m_ePixelFormat) - { - case kWICPixelFormat32bppBGRA: - case kWICPixelFormat32bppPBGRA: - case kWICPixelFormat64bppRGBA: - case kWICPixelFormat64bppPRGBA: - case kWICPixelFormat128bppRGBAFloat: - case kWICPixelFormat128bppPRGBAFloat: - case kWICPixelFormat64bppRGBAFixedPoint: - case kWICPixelFormat128bppRGBAFixedPoint: - case kWICPixelFormat64bppRGBAHalf: - case kWICPixelFormat40bppCMYKAlpha: - case kWICPixelFormat80bppCMYKAlpha: - case kWICPixelFormat32bpp3ChannelsAlpha: - case kWICPixelFormat40bpp4ChannelsAlpha: - case kWICPixelFormat48bpp5ChannelsAlpha: - case kWICPixelFormat56bpp6ChannelsAlpha: - case kWICPixelFormat64bpp7ChannelsAlpha: - case kWICPixelFormat72bpp8ChannelsAlpha: - case kWICPixelFormat64bpp3ChannelsAlpha: - case kWICPixelFormat80bpp4ChannelsAlpha: - case kWICPixelFormat96bpp5ChannelsAlpha: - case kWICPixelFormat112bpp6ChannelsAlpha: - case kWICPixelFormat128bpp7ChannelsAlpha: - case kWICPixelFormat144bpp8ChannelsAlpha: - { - bHasAlpha = TRUE; - } - break; - - default: - { - } - break; - } - - return bHasAlpha; -} - -/*++ - -Routine Name: - - CBmpConverter::HasColorContext - -Routine Description: - - Indicates whether the bitmap has a color context - -Arguments: - - None - -Return Value: - - TRUE - The bitmap has a color context - FALSE - There is no color context associated with the bitmap - ---*/ -BOOL -CBmpConverter::HasColorContext( - VOID - ) CONST -{ - return m_pColorContext != NULL; -} - -/*++ - -Routine Name: - - CBmpConverter::HasColorProfile - -Routine Description: - - Indicates whether the color context (if present) contains a color profile - -Arguments: - - None - -Return Value: - - TRUE - There is a color context and it contains a color profile - FALSE - There is either no color context or the context does not contain a color profile - ---*/ -BOOL -CBmpConverter::HasColorProfile( - VOID - ) CONST -{ - BOOL bHasProfile = FALSE; - - if (HasColorContext()) - { - WICColorContextType wicContextType = WICColorContextUninitialized; - if (m_pColorContext != NULL && - SUCCEEDED(m_pColorContext->GetType(&wicContextType))) - { - bHasProfile = wicContextType == WICColorContextProfile; - } - } - - return bHasProfile; -} - -/*++ - -Routine Name: - - CBmpConverter::GetPixelFormat - -Routine Description: - - Retrieves the underlying pixel format - -Arguments: - - None - -Return Value: - - Enumerated value identifying the current pixel format of the bitmap - ---*/ -EWICPixelFormat -CBmpConverter::GetPixelFormat( - VOID - ) -{ - return m_ePixelFormat; -} - -/*++ - -Routine Name: - - CBmpConverter::GetSize - -Routine Description: - - Retrieves the dimensions of the bitmap - -Arguments: - - pcWidth - Pointer to a variable that recieves the pixel width - pcHeight - Pointer to a variable that recieves the pixel height - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::GetSize( - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcHeight, E_POINTER))) - { - *pcWidth = 0; - *pcHeight = 0; - - hr = m_pBitmap->GetSize(pcWidth, pcHeight); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::GetResolution - -Routine Description: - - Retrieves the resolution of the underlying bitmap - -Arguments: - - pDpiX - Pointer to a variable that recieves the horizontal resolution - pDpiY - Pointer to a variable that recieves the vertical resolution - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::GetResolution( - _Out_ DOUBLE* pDpiX, - _Out_ DOUBLE* pDpiY - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(pDpiX, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDpiY, E_POINTER))) - { - *pDpiX = 0.0; - *pDpiY = 0.0; - - hr = m_pBitmap->GetResolution(pDpiX, pDpiY); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::SetProfile - -Routine Description: - - This method sets creates a color context based of the supplied profile filename and - associates that cotext with the bitmap - -Arguments: - - szProfile - The profile filename - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::SetProfile( - _In_z_ LPWSTR szProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pImagingFactory, E_PENDING))) - { - m_pColorContext = NULL; - if (SUCCEEDED(hr = m_pImagingFactory->CreateColorContext(&m_pColorContext))) - { - hr = m_pColorContext->InitializeFromFilename(szProfile); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::operator= - -Routine Description: - - Assignment operator - -Arguments: - - converter - Instance of a CBmpConverter to be assigned to - -Return Value: - - Reference to the newly assigned CBmpConverter instance - ---*/ -CBmpConverter& -CBmpConverter::operator=( - _In_ CONST CBmpConverter& converter - ) -{ - // - // Assign all the member pointers. The COM pointer takes care of reference counting. - // - m_pImagingFactory = converter.m_pImagingFactory; - m_pBitmap = converter.m_pBitmap; - m_pColorContext = converter.m_pColorContext; - m_pCurrentLock = converter.m_pCurrentLock; - m_ePixelFormat = converter.m_ePixelFormat; - - ASSERTMSG(m_pCurrentLock == NULL, "Copying locked bitmap can lead to a deadlock.\n"); - - return *this; -} - -/*++ - -Routine Name: - - CBmpConverter::CreateImagingFactory - -Routine Description: - - Creates the WIC imaging factory - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::CreateImagingFactory( - VOID - ) -{ - m_pImagingFactory = NULL; - HRESULT hr = m_pImagingFactory.CoCreateInstance(CLSID_WICImagingFactory); - if (SUCCEEDED(hr)) - { - hr = CHECK_POINTER(m_pImagingFactory, E_FAIL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBmpConverter::PixelFormatFromGUID - -Routine Description: - - Converts the WIC pixel format GUID to the matching pixel format enumeration - -Arguments: - - pixelFormat - GUID defining the pixel format - pPixFormat - Pointer to the pixel format to be set - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBmpConverter::PixelFormatFromGUID( - _In_ REFGUID pixelFormat, - _Out_ EWICPixelFormat* pPixFormat - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPixFormat, E_POINTER))) - { - *pPixFormat = kWICPixelFormatDontCare; - BOOL bFound = 0; - - // - // Loop all the potential formats - // - for (UINT cFormat = 0; - cFormat < kWICPixelFormatMax; - cFormat++) - { - // - // Try to match the guid - // - if (pixelFormat == g_lutPixFrmtGuid[cFormat]) - { - // - // The index provides the corresponding pixel format enumerated value - // - bFound = TRUE; - *pPixFormat = static_cast(cFormat); - break; - } - } - - if (!bFound) - { - RIP("Could not match format GUID\n"); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/bmpconv.h b/print/XPSDrvSmpl/src/filters/color/bmpconv.h deleted file mode 100644 index 5bed56b4..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpconv.h +++ /dev/null @@ -1,168 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bmpconv.h - -Abstract: - - WIC bitmap conversion class definition. This class provides a wrapper to a bitmap - stream that uses WIC to access bitmap data and provide conversion functionality. - ---*/ - -#pragma once - -#include "bmpdata.h" - -class CBmpConverter -{ -public: - CBmpConverter(); - - CBmpConverter( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ); - - CBmpConverter( - _In_ IStream* pStream - ); - - CBmpConverter( - _In_ CONST CBmpConverter& converter - ); - - virtual ~CBmpConverter(); - - HRESULT - Initialize( - _In_ CONST EWICPixelFormat& ePixFormat, - _In_ CONST UINT& cWidth, - _In_ CONST UINT& cHeight, - _In_ CONST DOUBLE& dpiX, - _In_ CONST DOUBLE& dpiY - ); - - HRESULT - Initialize( - _In_ IStream* pStream - ); - - HRESULT - Initialize( - _In_ IWICBitmapSource* pSource - ); - - HRESULT - Write( - _In_ REFGUID guidContainerFormat, - _Inout_ IStream* pStream - ); - - HRESULT - Convert( - _In_ EWICPixelFormat ePixFormat, - _Out_ BOOL* pbCanConvert - ); - - HRESULT - LockSurface( - _In_ WICRect* prcLock, - _In_ CONST BOOL& bReadOnly, - _Out_ UINT* pcbStride, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Inout_ UINT* pcbData, - _Outptr_result_bytebuffer_maybenull_(*pcbData) - PBYTE* ppbData - ); - - HRESULT - UnlockSurface( - VOID - ); - - HRESULT - GetColorContext( - _Outptr_ IWICColorContext** ppColorContext - ); - - BOOL - HasAlphaChannel( - VOID - ) CONST; - - BOOL - HasColorContext( - VOID - ) CONST; - - BOOL - HasColorProfile( - VOID - ) CONST; - - EWICPixelFormat - GetPixelFormat( - VOID - ); - - HRESULT - GetSize( - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight - ); - - HRESULT - GetResolution( - _Out_ DOUBLE* pDpiX, - _Out_ DOUBLE* pDpiY - ); - - HRESULT - SetProfile( - _In_z_ LPWSTR szProfile - ); - - CBmpConverter& - operator=( - _In_ CONST CBmpConverter& converter - ); - -private: - HRESULT - CreateImagingFactory( - VOID - ); - - HRESULT - PixelFormatFromGUID( - _In_ REFGUID pixelFormat, - _Out_ EWICPixelFormat* pPixFormat - ); - -protected: - CComPtr m_pImagingFactory; - - CComPtr m_pBitmap; - - CComPtr m_pColorContext; - - CComPtr m_pCurrentLock; - - EWICPixelFormat m_ePixelFormat; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/bmpdata.cpp b/print/XPSDrvSmpl/src/filters/color/bmpdata.cpp deleted file mode 100644 index b4df4d02..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpdata.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bmpdata.cpp - -Abstract: - - This file supplies various look-up tables for use in converting and color matching - input bitmaps via WCS/ICM and WIC - ---*/ - -#include "precomp.h" -#include "globals.h" -#include "bmpdata.h" - -/* -Look up table between WIC pixel format enumeration and WIC pixel format GUID -*/ -CONST WICPixelFormatGUID g_lutPixFrmtGuid[kWICPixelFormatMax] = { - GUID_WICPixelFormatDontCare, - GUID_WICPixelFormat1bppIndexed, - GUID_WICPixelFormat2bppIndexed, - GUID_WICPixelFormat4bppIndexed, - GUID_WICPixelFormat8bppIndexed, - GUID_WICPixelFormatBlackWhite, - GUID_WICPixelFormat2bppGray, - GUID_WICPixelFormat4bppGray, - GUID_WICPixelFormat8bppGray, - GUID_WICPixelFormat16bppBGR555, - GUID_WICPixelFormat16bppBGR565, - GUID_WICPixelFormat16bppGray, - GUID_WICPixelFormat24bppBGR, - GUID_WICPixelFormat24bppRGB, - GUID_WICPixelFormat32bppBGR, - GUID_WICPixelFormat32bppBGRA, - GUID_WICPixelFormat32bppPBGRA, - GUID_WICPixelFormat32bppGrayFloat, - GUID_WICPixelFormat48bppRGBFixedPoint, - GUID_WICPixelFormat16bppGrayFixedPoint, - GUID_WICPixelFormat32bppBGR101010, - GUID_WICPixelFormat48bppRGB, - GUID_WICPixelFormat64bppRGBA, - GUID_WICPixelFormat64bppPRGBA, - GUID_WICPixelFormat96bppRGBFixedPoint, - GUID_WICPixelFormat128bppRGBAFloat, - GUID_WICPixelFormat128bppPRGBAFloat, - GUID_WICPixelFormat128bppRGBFloat, - GUID_WICPixelFormat32bppCMYK, - GUID_WICPixelFormat64bppRGBAFixedPoint, - GUID_WICPixelFormat64bppRGBFixedPoint, - GUID_WICPixelFormat128bppRGBAFixedPoint, - GUID_WICPixelFormat128bppRGBFixedPoint, - GUID_WICPixelFormat64bppRGBAHalf, - GUID_WICPixelFormat64bppRGBHalf, - GUID_WICPixelFormat48bppRGBHalf, - GUID_WICPixelFormat32bppRGBE, - GUID_WICPixelFormat16bppGrayHalf, - GUID_WICPixelFormat32bppGrayFixedPoint, - GUID_WICPixelFormat64bppCMYK, - GUID_WICPixelFormat24bpp3Channels, - GUID_WICPixelFormat32bpp4Channels, - GUID_WICPixelFormat40bpp5Channels, - GUID_WICPixelFormat48bpp6Channels, - GUID_WICPixelFormat56bpp7Channels, - GUID_WICPixelFormat64bpp8Channels, - GUID_WICPixelFormat48bpp3Channels, - GUID_WICPixelFormat64bpp4Channels, - GUID_WICPixelFormat80bpp5Channels, - GUID_WICPixelFormat96bpp6Channels, - GUID_WICPixelFormat112bpp7Channels, - GUID_WICPixelFormat128bpp8Channels, - GUID_WICPixelFormat40bppCMYKAlpha, - GUID_WICPixelFormat80bppCMYKAlpha, - GUID_WICPixelFormat32bpp3ChannelsAlpha, - GUID_WICPixelFormat40bpp4ChannelsAlpha, - GUID_WICPixelFormat48bpp5ChannelsAlpha, - GUID_WICPixelFormat56bpp6ChannelsAlpha, - GUID_WICPixelFormat64bpp7ChannelsAlpha, - GUID_WICPixelFormat72bpp8ChannelsAlpha, - GUID_WICPixelFormat64bpp3ChannelsAlpha, - GUID_WICPixelFormat80bpp4ChannelsAlpha, - GUID_WICPixelFormat96bpp5ChannelsAlpha, - GUID_WICPixelFormat112bpp6ChannelsAlpha, - GUID_WICPixelFormat128bpp7ChannelsAlpha, - GUID_WICPixelFormat144bpp8ChannelsAlpha -}; - -/* -Look-up table between WICPixelFormat enumeration and conversion information - -The aim of this table is to assist us in transforming the input WCS data into a format acceptable -to WCS/ICM TranslateBitmapBits call. The sort of problems this aims to resolve are: - - 1. The lack of S7DOT24FIXED format support in WCS/ICM. - 2. The lack of half format support in WCS/ICM. - 3. The lack of support for > 8bpc in WCS/ICM for channel counts > 4 - -The table is used in the following way: - - 1. Look-up the most appropriate WIC pixel format for color conversion by indexing into - the table using the matching WIC pixel format enumeration then using WIC to convert - to this format. - 2. Identify the matching BMFORMAT enumeration to process with WCS/ICM - 3. Identify where we need to process alpha data seperately and using an intermediate - transform buffer to pass to ICM/WCS where necessary - -Additionally the table also provides useful look-up information for use when processing -intermediate transform buffers: channel count, alpha channel placement and color data type. - -*/ -CONST WICToBMFORMAT g_lutWICToBMFormat[kWICPixelFormatMax] = { - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormatDontCare - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat1bppIndexed - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat2bppIndexed - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat4bppIndexed - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat8bppIndexed - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormatBlackWhite - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormat2bppGray - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormat4bppGray - {kWICPixelFormat8bppGray, kBM_GRAY, FALSE, 1, 0, COLOR_BYTE}, // kWICPixelFormat8bppGray - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat16bppBGR555 - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat16bppBGR565 - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat16bppGray - {kWICPixelFormat24bppBGR, kBM_BGRTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat24bppBGR - {kWICPixelFormat24bppRGB, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat24bppRGB - {kWICPixelFormat24bppBGR, kBM_BGRTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat32bppBGR - {kWICPixelFormat32bppBGRA, kBM_xRGBQUADS, FALSE, 4, 3, COLOR_BYTE}, // kWICPixelFormat32bppBGRA - {kWICPixelFormat32bppPBGRA, kBM_xRGBQUADS, FALSE, 4, 3, COLOR_BYTE}, // kWICPixelFormat32bppPBGRA - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat32bppGrayFloat - {kWICPixelFormat48bppRGBFixedPoint, kBM_S2DOT13FIXED_scRGB, FALSE, 3, 0, COLOR_S2DOT13FIXED}, // kWICPixelFormat48bppRGBFixedPoint - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat16bppGrayFixedPoint - {kWICPixelFormat48bppRGB, kBM_16b_RGB, FALSE, 3, 0, COLOR_WORD}, // kWICPixelFormat32bppBGR101010 - {kWICPixelFormat48bppRGB, kBM_16b_RGB, FALSE, 3, 0, COLOR_WORD}, // kWICPixelFormat48bppRGB - {kWICPixelFormat64bppRGBA, kBM_16b_RGB, TRUE, 4, 3, COLOR_WORD}, // kWICPixelFormat64bppRGBA - {kWICPixelFormat64bppPRGBA, kBM_16b_RGB, TRUE, 4, 3, COLOR_WORD}, // kWICPixelFormat64bppPRGBA - {kWICPixelFormat128bppRGBFloat, kBM_32b_scRGB, TRUE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat96bppRGBFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat128bppRGBAFloat - {kWICPixelFormat128bppPRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat128bppPRGBAFloat - {kWICPixelFormat128bppRGBFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat128bppRGBFloat - {kWICPixelFormat32bppCMYK, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat32bppCMYK - {kWICPixelFormat64bppRGBAFixedPoint, kBM_S2DOT13FIXED_scARGB, FALSE, 4, 3, COLOR_S2DOT13FIXED}, // kWICPixelFormat64bppRGBAFixedPoint - {kWICPixelFormat64bppRGBFixedPoint, kBM_S2DOT13FIXED_scARGB, FALSE, 4, 0, COLOR_S2DOT13FIXED}, // kWICPixelFormat64bppRGBFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat128bppRGBAFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat128bppRGBFixedPoint - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat64bppRGBAHalf - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat64bppRGBHalf - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 0, COLOR_FLOAT}, // kWICPixelFormat48bppRGBHalf - {kWICPixelFormat128bppRGBAFloat, kBM_32b_scARGB, FALSE, 4, 3, COLOR_FLOAT}, // kWICPixelFormat32bppRGBE - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat16bppGrayHalf - {kWICPixelFormat16bppGray, kBM_16b_GRAY, FALSE, 1, 0, COLOR_WORD}, // kWICPixelFormat32bppGrayFixedPoint - {kWICPixelFormat32bpp4Channels, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat64bppCMYK - {kWICPixelFormat24bpp3Channels, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat24bpp3Channels - {kWICPixelFormat32bpp4Channels, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat32bpp4Channels - {kWICPixelFormat40bpp5Channels, kBM_5CHANNEL, FALSE, 5, 0, COLOR_BYTE}, // kWICPixelFormat40bpp5Channels - {kWICPixelFormat48bpp6Channels, kBM_6CHANNEL, FALSE, 6, 0, COLOR_BYTE}, // kWICPixelFormat48bpp6Channels - {kWICPixelFormat56bpp7Channels, kBM_7CHANNEL, FALSE, 7, 0, COLOR_BYTE}, // kWICPixelFormat56bpp7Channels - {kWICPixelFormat64bpp8Channels, kBM_8CHANNEL, FALSE, 8, 0, COLOR_BYTE}, // kWICPixelFormat64bpp8Channels - {kWICPixelFormat24bpp3Channels, kBM_RGBTRIPLETS, FALSE, 3, 0, COLOR_BYTE}, // kWICPixelFormat48bpp3Channels - {kWICPixelFormat32bpp4Channels, kBM_CMYKQUADS, FALSE, 4, 0, COLOR_BYTE}, // kWICPixelFormat64bpp4Channels - {kWICPixelFormat40bpp5Channels, kBM_5CHANNEL, FALSE, 5, 0, COLOR_BYTE}, // kWICPixelFormat80bpp5Channels - {kWICPixelFormat48bpp6Channels, kBM_6CHANNEL, FALSE, 6, 0, COLOR_BYTE}, // kWICPixelFormat96bpp6Channels - {kWICPixelFormat56bpp7Channels, kBM_7CHANNEL, FALSE, 7, 0, COLOR_BYTE}, // kWICPixelFormat112bpp7Channels - {kWICPixelFormat64bpp8Channels, kBM_8CHANNEL, FALSE, 8, 0, COLOR_BYTE}, // kWICPixelFormat128bpp8Channels - {kWICPixelFormat40bppCMYKAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat40bppCMYKAlpha - {kWICPixelFormat40bppCMYKAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat80bppCMYKAlpha - {kWICPixelFormat32bpp3ChannelsAlpha, kBM_RGBTRIPLETS, TRUE, 4, 3, COLOR_BYTE}, // kWICPixelFormat32bpp3ChannelsAlpha - {kWICPixelFormat40bpp4ChannelsAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat40bpp4ChannelsAlpha - {kWICPixelFormat48bpp5ChannelsAlpha, kBM_5CHANNEL, TRUE, 6, 5, COLOR_BYTE}, // kWICPixelFormat48bpp5ChannelsAlpha - {kWICPixelFormat56bpp6ChannelsAlpha, kBM_6CHANNEL, TRUE, 7, 6, COLOR_BYTE}, // kWICPixelFormat56bpp6ChannelsAlpha - {kWICPixelFormat64bpp7ChannelsAlpha, kBM_7CHANNEL, TRUE, 8, 7, COLOR_BYTE}, // kWICPixelFormat64bpp7ChannelsAlpha - {kWICPixelFormat72bpp8ChannelsAlpha, kBM_8CHANNEL, TRUE, 9, 8, COLOR_BYTE}, // kWICPixelFormat72bpp8ChannelsAlpha - {kWICPixelFormat32bpp3ChannelsAlpha, kBM_RGBTRIPLETS, TRUE, 4, 3, COLOR_BYTE}, // kWICPixelFormat64bpp3ChannelsAlpha - {kWICPixelFormat40bpp4ChannelsAlpha, kBM_CMYKQUADS, TRUE, 5, 4, COLOR_BYTE}, // kWICPixelFormat80bpp4ChannelsAlpha - {kWICPixelFormat48bpp5ChannelsAlpha, kBM_5CHANNEL, TRUE, 6, 5, COLOR_BYTE}, // kWICPixelFormat96bpp5ChannelsAlpha - {kWICPixelFormat56bpp6ChannelsAlpha, kBM_6CHANNEL, TRUE, 7, 6, COLOR_BYTE}, // kWICPixelFormat112bpp6ChannelsAlpha - {kWICPixelFormat64bpp7ChannelsAlpha, kBM_7CHANNEL, TRUE, 8, 7, COLOR_BYTE}, // kWICPixelFormat128bpp7ChannelsAlpha - {kWICPixelFormat72bpp8ChannelsAlpha, kBM_8CHANNEL, TRUE, 9, 8, COLOR_BYTE}, // kWICPixelFormat144bpp8ChannelsAlpha -}; - -/* -Look up table between color data type and data type size -*/ -CONST size_t g_lutColorDataSize[] = -{ - 0, // Packing as enumeration starts from 1 - sizeof(BYTE), // COLOR_BYTE =1 - sizeof(WORD), // COLOR_WORD - sizeof(FLOAT), // COLOR_FLOAT - sizeof(WORD), // COLOR_S2DOT13FIXED -}; - -/* -Define a color type that is not valid for WCS - we use this to distinguish -BMFORMATs that do not have a corresponding WCS color type -*/ -#define COLOR_INVALID 0 - -/* -Look up between local BMFORMAT enumeration providing the underlying enumeration -value and the corresponding pixel data size -*/ -CONST BMFormatData g_lutBMFormatData[kICMPixelFormatMax] = { - {BM_x555RGB, 3, static_cast(COLOR_INVALID)}, - {BM_x555XYZ, 3, static_cast(COLOR_INVALID)}, - {BM_x555Yxy, 3, static_cast(COLOR_INVALID)}, - {BM_x555Lab, 3, static_cast(COLOR_INVALID)}, - {BM_x555G3CH, 3, static_cast(COLOR_INVALID)}, - {BM_RGBTRIPLETS, 3, COLOR_BYTE}, - {BM_BGRTRIPLETS, 3, COLOR_BYTE}, - {BM_XYZTRIPLETS, 3, COLOR_BYTE}, - {BM_YxyTRIPLETS, 3, COLOR_BYTE}, - {BM_LabTRIPLETS, 3, COLOR_BYTE}, - {BM_G3CHTRIPLETS, 3, COLOR_BYTE}, - {BM_5CHANNEL, 5, COLOR_BYTE}, - {BM_6CHANNEL, 6, COLOR_BYTE}, - {BM_7CHANNEL, 7, COLOR_BYTE}, - {BM_8CHANNEL, 8, COLOR_BYTE}, - {BM_GRAY, 1, COLOR_BYTE}, - {BM_xRGBQUADS, 4, COLOR_BYTE}, - {BM_xBGRQUADS, 4, COLOR_BYTE}, - {BM_xG3CHQUADS, 4, COLOR_BYTE}, - {BM_KYMCQUADS, 4, COLOR_BYTE}, - {BM_CMYKQUADS, 4, COLOR_BYTE}, - {BM_10b_RGB, 4, COLOR_BYTE}, - {BM_10b_XYZ, 4, COLOR_BYTE}, - {BM_10b_Yxy, 4, COLOR_BYTE}, - {BM_10b_Lab, 4, COLOR_BYTE}, - {BM_10b_G3CH, 4, COLOR_BYTE}, - {BM_NAMED_INDEX, 4, COLOR_BYTE}, - {BM_16b_RGB, 3, COLOR_WORD}, - {BM_16b_XYZ, 3, COLOR_WORD}, - {BM_16b_Yxy, 3, COLOR_WORD}, - {BM_16b_Lab, 3, COLOR_WORD}, - {BM_16b_G3CH, 3, COLOR_WORD}, - {BM_16b_GRAY, 3, COLOR_WORD}, - {BM_565RGB, 3, COLOR_WORD}, - {BM_32b_scRGB, 3, COLOR_FLOAT}, - {BM_32b_scARGB, 4, COLOR_FLOAT}, - {BM_S2DOT13FIXED_scRGB, 3, COLOR_S2DOT13FIXED}, - {BM_S2DOT13FIXED_scARGB, 4, COLOR_S2DOT13FIXED}, -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/bmpdata.h b/print/XPSDrvSmpl/src/filters/color/bmpdata.h deleted file mode 100644 index 225b7745..00000000 --- a/print/XPSDrvSmpl/src/filters/color/bmpdata.h +++ /dev/null @@ -1,768 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bmpdata.h - -Abstract: - - This file supplies definitions for various look-up tables for use in converting and - color matching input bitmaps via WCS/ICM and WIC - ---*/ - -#pragma once - -// -// Macros to limit maximum buffer size allocations -// -#define MAX_COLDATATYPE_SIZE sizeof(FLOAT) -#define MAX_COLCHANNEL_COUNT 9 // 8 channel plus alpha -#define MAX_PIXELWIDTH_COUNT SIZE_MAX/MAX_COLDATATYPE_SIZE/MAX_COLCHANNEL_COUNT - - -/* -Enumeration for all WIC pixel formats -*/ -enum EWICPixelFormat -{ - kWICPixelFormatDontCare = 0, kWICPixelFormatMin = 0, - kWICPixelFormat1bppIndexed, - kWICPixelFormat2bppIndexed, - kWICPixelFormat4bppIndexed, - kWICPixelFormat8bppIndexed, - kWICPixelFormatBlackWhite, - kWICPixelFormat2bppGray, - kWICPixelFormat4bppGray, - kWICPixelFormat8bppGray, - kWICPixelFormat16bppBGR555, - kWICPixelFormat16bppBGR565, - kWICPixelFormat16bppGray, - kWICPixelFormat24bppBGR, - kWICPixelFormat24bppRGB, - kWICPixelFormat32bppBGR, - kWICPixelFormat32bppBGRA, - kWICPixelFormat32bppPBGRA, - kWICPixelFormat32bppGrayFloat, - kWICPixelFormat48bppRGBFixedPoint, - kWICPixelFormat16bppGrayFixedPoint, - kWICPixelFormat32bppBGR101010, - kWICPixelFormat48bppRGB, - kWICPixelFormat64bppRGBA, - kWICPixelFormat64bppPRGBA, - kWICPixelFormat96bppRGBFixedPoint, - kWICPixelFormat128bppRGBAFloat, - kWICPixelFormat128bppPRGBAFloat, - kWICPixelFormat128bppRGBFloat, - kWICPixelFormat32bppCMYK, - kWICPixelFormat64bppRGBAFixedPoint, - kWICPixelFormat64bppRGBFixedPoint, - kWICPixelFormat128bppRGBAFixedPoint, - kWICPixelFormat128bppRGBFixedPoint, - kWICPixelFormat64bppRGBAHalf, - kWICPixelFormat64bppRGBHalf, - kWICPixelFormat48bppRGBHalf, - kWICPixelFormat32bppRGBE, - kWICPixelFormat16bppGrayHalf, - kWICPixelFormat32bppGrayFixedPoint, - kWICPixelFormat64bppCMYK, - kWICPixelFormat24bpp3Channels, - kWICPixelFormat32bpp4Channels, - kWICPixelFormat40bpp5Channels, - kWICPixelFormat48bpp6Channels, - kWICPixelFormat56bpp7Channels, - kWICPixelFormat64bpp8Channels, - kWICPixelFormat48bpp3Channels, - kWICPixelFormat64bpp4Channels, - kWICPixelFormat80bpp5Channels, - kWICPixelFormat96bpp6Channels, - kWICPixelFormat112bpp7Channels, - kWICPixelFormat128bpp8Channels, - kWICPixelFormat40bppCMYKAlpha, - kWICPixelFormat80bppCMYKAlpha, - kWICPixelFormat32bpp3ChannelsAlpha, - kWICPixelFormat40bpp4ChannelsAlpha, - kWICPixelFormat48bpp5ChannelsAlpha, - kWICPixelFormat56bpp6ChannelsAlpha, - kWICPixelFormat64bpp7ChannelsAlpha, - kWICPixelFormat72bpp8ChannelsAlpha, - kWICPixelFormat64bpp3ChannelsAlpha, - kWICPixelFormat80bpp4ChannelsAlpha, - kWICPixelFormat96bpp5ChannelsAlpha, - kWICPixelFormat112bpp6ChannelsAlpha, - kWICPixelFormat128bpp7ChannelsAlpha, - kWICPixelFormat144bpp8ChannelsAlpha, - kWICPixelFormatMax -}; - -/* -ICM/WCS BMFORMAT enumeration indexed from 0 for use as a look-up into -a BMFORMAT data structure array -*/ -enum EICMPixelFormat -{ - kBM_x555RGB = 0, kICMPixelFormatMin = 0, - kBM_x555XYZ, - kBM_x555Yxy, - kBM_x555Lab, - kBM_x555G3CH, - kBM_RGBTRIPLETS, - kBM_BGRTRIPLETS, - kBM_XYZTRIPLETS, - kBM_YxyTRIPLETS, - kBM_LabTRIPLETS, - kBM_G3CHTRIPLETS, - kBM_5CHANNEL, - kBM_6CHANNEL, - kBM_7CHANNEL, - kBM_8CHANNEL, - kBM_GRAY, - kBM_xRGBQUADS, - kBM_xBGRQUADS, - kBM_xG3CHQUADS, - kBM_KYMCQUADS, - kBM_CMYKQUADS, - kBM_10b_RGB, - kBM_10b_XYZ, - kBM_10b_Yxy, - kBM_10b_Lab, - kBM_10b_G3CH, - kBM_NAMED_INDEX, - kBM_16b_RGB, - kBM_16b_XYZ, - kBM_16b_Yxy, - kBM_16b_Lab, - kBM_16b_G3CH, - kBM_16b_GRAY, - kBM_565RGB, - kBM_32b_scRGB, - kBM_32b_scARGB, - kBM_S2DOT13FIXED_scRGB, - kBM_S2DOT13FIXED_scARGB, - kICMPixelFormatMax -}; - -/* -This structure is used to store information for converting and processing a particular -WIC format. The structure forms the basis of a look-up table between a source WIC pixel -format and the following items: - The format to convert to before processing - - This converts to a form consumable by ICM/WCS. - The corresponding BMFORMAT enumeration - - This lets us lookup the data type to pass to TranslateBitmapBits. - Whether we need an intermediate buffer to process alpha data - The alpha channel in WIC pixel formats do not match ICM/WCS compatible - formats. Under these circumstances we need to copy the bitmap data, translate - and apply back to the WIC bitmap. - The count of channels and the channel width - This allows us to lookup the offset required when copying intermediate data to - the WIC bitmap. - The offset to the alpha channel (we actually store the COLORDATATYPE and lookup the size) - When copying alpha data we need to know where to retrieve the alpha channel from and - where to copy it to in a given scanline. - -With this data, handling intermediate buffer data follows the following algorithm: - - If no intermediate buffer is required - The locked WIC pixel data can be converted in situ - Otherwise - Color data handling - From the begining of the WIC buffer and the intermediate buffer - Copy the intermediate buffer pixel width into the locked WIC scanline - Move the WIC pixel pointer on by the WIC pixel width - Move the intermediate buffer pointer on by the BMFORMAT pixel width - Repeat till no scanline data left to process - Alpha data handling - From the begining of the source and destination WIC buffers - Offset the source to the alpha channel - Offset the destination to the alpha channel - Convert the source to format to the destination - Copy the alpha data to the destination - Move the source WIC pixel pointer on by the WIC pixel width - Move the destination WIC pixel pointer on by the WIC pixel width - Repeat till no alpha data left to process - -*/ -struct WICToBMFORMAT -{ - EWICPixelFormat m_pixFormTarget; - EICMPixelFormat m_bmFormTarget; - BOOL m_bNeedsScanBuffer; - UINT m_cChannels; - UINT m_cAlphaOffset; - COLORDATATYPE m_colDataType; -}; - -/* -Structure providing information about BMFORMAT data for use as a lookup against -the local BMFORMAT enumeration -*/ -struct BMFormatData -{ - BMFORMAT m_bmFormat; - UINT m_cChannels; - COLORDATATYPE m_colDataType; -}; - -extern CONST WICPixelFormatGUID g_lutPixFrmtGuid[kWICPixelFormatMax]; -extern CONST WICToBMFORMAT g_lutWICToBMFormat[kWICPixelFormatMax]; -extern CONST size_t g_lutColorDataSize[]; -extern CONST BMFormatData g_lutBMFormatData[kICMPixelFormatMax]; - -struct S2DOT13FIXED -{ - WORD val; -}; -typedef S2DOT13FIXED* PS2DOT13FIXED; - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ BYTE src - ) -{ - dst = src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ WORD src - ) -{ - dst = static_cast((static_cast(src) + 0x7F) >> 8); -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ FLOAT src - ) -{ - if (src < 0.0f) - { - dst = 0x00; - } - else if (src > 1.0f) - { - dst = 0xFF; - } - else - { - dst = static_cast(src * kMaxByteAsFloat); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to BYTE - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ BYTE& dst, - _In_ S2DOT13FIXED src - ) -{ - if (src.val & kS2Dot13Neg) - { - dst = 0x00; - } - else if (src.val > kS2Dot13One) - { - dst = 0xFF; - } - else - { - dst = static_cast(MulDiv(src.val, 0xFF, kS2Dot13One)); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ BYTE src - ) -{ - dst = (src << 8) | src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ WORD src - ) -{ - dst = src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ FLOAT src - ) -{ - if (src < 0.0f) - { - dst = 0x0000; - } - else if (src > 1.0f) - { - dst = 0xFFFF; - } - else - { - dst = static_cast(src * kMaxWordAsFloat); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to WORD - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ WORD& dst, - _In_ S2DOT13FIXED src - ) -{ - if (src.val & kS2Dot13Neg) - { - dst = 0x0000; - } - else if (src.val > kS2Dot13One) - { - dst = 0xFFFF; - } - else - { - dst = static_cast(MulDiv(src.val, 0xFFFF, kS2Dot13One)); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ BYTE src - ) -{ - dst = src/kMaxByteAsFloat; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ WORD src - ) -{ - dst = src/kMaxWordAsFloat; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ FLOAT src - ) -{ - dst = src; -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to FLOAT - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ FLOAT& dst, - _In_ S2DOT13FIXED src - ) -{ - if (src.val & kS2Dot13Neg) - { - dst = -static_cast(src.val^kS2Dot13Neg)/kS2Dot13One; - } - else - { - dst = static_cast(src.val)/kS2Dot13One; - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts BYTE to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ BYTE src - ) -{ - dst.val = static_cast(MulDiv(kS2Dot13One, src, 0xFF)); -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts WORD to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ WORD src - ) -{ - dst.val = static_cast(MulDiv(kS2Dot13One, src, 0xFFFF)); -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts FLOAT to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ FLOAT src - ) -{ - if (src < -4.0f) - { - dst.val = kS2Dot13Min; - } - else if (src > 4.0f) - { - dst.val = kS2Dot13Max; - } - else - { - dst.val = static_cast(src * kS2Dot13One); - } -} - -/*++ - -Routine Name: - - ConvertCopy - -Routine Description: - - Inline function that converts a src channel data type to a destination - of another type. This overload converts S2DOT13FIXED to S2DOT13FIXED - -Arguments: - - dst - Destination value to be set - src - Source value - -Return Value: - - None - ---*/ -inline VOID -ConvertCopy( - _Out_ S2DOT13FIXED& dst, - _In_ S2DOT13FIXED src - ) -{ - dst = src; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmflt.cpp b/print/XPSDrvSmpl/src/filters/color/cmflt.cpp deleted file mode 100644 index 303cef2a..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmflt.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmflt.cpp - -Abstract: - - Color management filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support color management. - The color management filter is responsible for adding and removing resources to - and from the XPS document and putting the appropriate mark-up onto pages when applying - a color transform. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pthndlr.h" -#include "cmflt.h" -#include "cmsax.h" -#include "colconv.h" -#include "cmpthndlr.h" -#include "cmintpthndlr.h" -#include "cmprofpthndlr.h" - -using XDPrintSchema::PageColorManagement::ColorManagementData; -using XDPrintSchema::PageColorManagement::Driver; - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; - -using XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData; - -/*++ - -Routine Name: - - CColorManageFilter::CColorManageFilter - -Routine Description: - - Default constructor for the color management filter which ensures GDI plus is correctly running - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageFilter::CColorManageFilter() -{ -} - -/*++ - -Routine Name: - - CColorManageFilter::~CColorManageFilter - -Routine Description: - - Default destructor for the color management filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManageFilter::~CColorManageFilter() -{ -} - -/*++ - -Routine Name: - - CColorManageFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CColorManageFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with color management handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - // - // Get the PT manager to return the correct ticket. Use a regular pointer - // to retrieve the ticket and assign to the smart pointer to increment - // ref count (we don't want our smart pointer to release the PT before - // the PT manager is finished with it) - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFP)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTPageScope, &pPT))) - { - try - { - // - // Get data from PT handler and test if we are color matching - // - ColorManagementData cmData; - CColorManagePTHandler cmPTHandler(pPT); - - PageSourceColorProfileData cmProfData; - CColorManageProfilePTHandler profPTHandler(pPT); - - PageICMRenderingIntentData cmIntData; - CColorManageIntentsPTHandler ptIntentsHandler(pPT); - - CComVariant varName; - - if (SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_PRINTER_NAME, &varName)) && - SUCCEEDED(hr = cmPTHandler.GetData(&cmData)) && - SUCCEEDED(hr = profPTHandler.GetData(&cmProfData))) - { - hr = ptIntentsHandler.GetData(&cmIntData); - } - - if (SUCCEEDED(hr) && - cmData.cmOption == Driver && - cmProfData.cmProfileName.Length() > 0) - { - // - // Retrieve the writer from the fixed page - // - CComPtr pWriter(NULL); - - // - // Create a map of the resources that need to be cleaned up after the page - // has been processed. These are bitmaps that have been replaced with color - // matched equivalents and any icc profiles that have been consumed while - // color matching. - // - ResDeleteMap resDel; - - if (SUCCEEDED(hr = pFP->GetWriteStream(&pWriter))) - { - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr pSaxRdr(NULL); - CComPtr pReader(NULL); - - // - // Create a profile manager which handles working with the selected profile - // - CProfileManager profManager(varName.bstrVal, cmProfData, cmIntData, pFP); - - // - // Create two color converter objects which coordinate color transforms for - // bitmaps and color mark-up strings - // - CBitmapColorConverter cmBmpConverter(m_pXDWriter, pFP, &m_resCache, &profManager, &resDel); - CColorRefConverter cmRefConverter(m_pXDWriter, pFP, &m_resCache, &profManager, &resDel); - CResourceDictionaryConverter cmDictConverter(m_pXDWriter, - pFP, - &m_resCache, - &profManager, - &resDel, - &cmBmpConverter, - &cmRefConverter); - - // - // Create a SAX handler to parse the markup in the fixed page - // - CCMSaxHandler cmSaxHndlr(pWriter, &cmBmpConverter, &cmRefConverter, &cmDictConverter); - - if (SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&cmSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast(pReadStreamToSeq))); - } - } - - pWriter->Close(); - } - - if (SUCCEEDED(hr)) - { - // - // We have parsed the entire page - it should be safe to delete - // all unrequired resources - // - ResDeleteMap::const_iterator iterRes = resDel.begin(); - - for (;iterRes != resDel.end(); iterRes++) - { - hr = pFP->DeleteResource(iterRes->first); - } - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - hr = S_FALSE; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - } - - if (SUCCEEDED(hr)) - { - // - // We can send the fixed page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmflt.h b/print/XPSDrvSmpl/src/filters/color/cmflt.h deleted file mode 100644 index 02c44853..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmflt.h +++ /dev/null @@ -1,51 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmflt.h - -Abstract: - - Implementation of the color management filter which handles page parts from the - XPS document container. - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "ptmanage.h" - -typedef map ResDeleteMap; - -class CColorManageFilter : public CXDXpsFilter -{ -public: - CColorManageFilter(); - - virtual ~CColorManageFilter(); - -private: - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - -private: - - // - // Create a resource cache object to manage the storage of bitmaps and - // color profiles in the container - // - CFileResourceCache m_resCache; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/cmflt.rc b/print/XPSDrvSmpl/src/filters/color/cmflt.rc deleted file mode 100644 index 19ae3e89..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 Microsoft Corporation -// -// All rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// File Name: -// -// cmflt.rc -// -// Abstract: -// -// Color filter resource file. -// -// - -#include -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Color Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/color/cmimg.cpp b/print/XPSDrvSmpl/src/filters/color/cmimg.cpp deleted file mode 100644 index 6c312629..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmimg.cpp +++ /dev/null @@ -1,856 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmimg.cpp - -Abstract: - - Color managed image implementation. The CColorManagedImage class is responsible - for managing the image resource for a stored bitmap. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "cmimg.h" -#include "streamcnv.h" - -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -/*++ - -Routine Name: - - CColorManagedImage::CColorManagedImage - -Routine Description: - - Constructor for the CColorManagedImage class which registers internally the - supplied resource URI and a pointer to the profile manager which will supply - suitable color transforms to apply to that resource - -Arguments: - - bstrResURI - String containing the URI to the resource to be handled - pProfManager - Pointer to a profile manager which will supply suitable - transforms to apply to the supplied resource - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorManagedImage::CColorManagedImage( - _In_ BSTR bstrResURI, - _In_ CProfileManager* pProfManager, - _In_ IFixedPage* pFixedPage, - _In_ ResDeleteMap* pResDel - ) : - m_pProfManager(pProfManager), - m_pFixedPage(pFixedPage), - m_bstrSrcProfileURI(NULL), - m_pResDel(pResDel) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfManager, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pResDel, E_POINTER))) - { - if (SysStringLen(bstrResURI) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - CComBSTR bstrAttribute(bstrResURI); - - if (bstrAttribute.Length() == 0) - { - hr = E_INVALIDARG; - } - else - { - try - { - // - // Process the mark-up looking for the bitmap URI and any associated profiles - // - CStringXDW cstrAttribute(bstrResURI); - CStringXDW cstrColConvBMP(L"{ColorConvertedBitmap "); - - cstrAttribute.Trim(); - INT cchFind = cstrAttribute.Find(cstrColConvBMP); - - if (cchFind == -1) - { - // - // The mark-up is the bitmap URI - // - cstrAttribute.Trim(); - m_bstrBitmapURI.Empty(); - m_bstrBitmapURI.Attach(cstrAttribute.AllocSysString()); - } - else - { - // - // The mark-up is specifying a profile associated with the image. - // Extract the path and set this in the profile manager. The markup takes - // the form "{ColorConvertedBitmap image.ext profile.icc}". - // - - // - // Delete leading string "{ColorConvertedBitmap " and the trailing "}" - // - cstrAttribute.Delete(0, cstrColConvBMP.GetLength()); - cstrAttribute.Delete(cstrAttribute.GetLength() - 1, 1); - cstrAttribute.Trim(); - - // - // Find the seperating space - // - cchFind = cstrAttribute.Find(L" "); - - // - // Construct the bitmap URI - // - m_bstrBitmapURI.Empty(); - m_bstrBitmapURI.Attach(cstrAttribute.Left(cchFind).AllocSysString()); - - // - // Delete the bitmap URI and space leaving the profile URI - // - cstrAttribute.Delete(0, cchFind+1); - - m_bstrSrcProfileURI.Empty(); - m_bstrSrcProfileURI.Attach(cstrAttribute.AllocSysString()); - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CColorManagedImage::~CColorManagedImage - -Routine Description: - - Default destructor for the CColorManagedImage class - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorManagedImage::~CColorManagedImage() -{ -} - -/*++ - -Routine Name: - - CColorManagedImage::WriteData - -Routine Description: - - This method handles the decoding of a bitmap, the colour - translation applied to the bitmap and the re-encoding of the bitmap - -Arguments: - - pStream - Pointer to a stream to write the resource out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - try - { - CComPtr pRead(NULL); - CComPtr pImagePart(NULL); - CComPtr pImageStream(NULL); - - // - // Load the bitmap into memory and create a stream to read the bitmap from - // - if (SUCCEEDED(hr = m_pFixedPage->GetPagePart(m_bstrBitmapURI, &pRead)) && - SUCCEEDED(hr = pRead.QueryInterface(&pImagePart)) && - SUCCEEDED(hr = pImagePart->GetStream(&pImageStream))) - { - BOOL bApplyTransform = FALSE; - CComPtr pInputImageStream(NULL); - - EWICPixelFormat eDstPixFormat = kWICPixelFormatDontCare; - UINT cDstWidth = 0; - UINT cDstHeight = 0; - DOUBLE dpiDstX = 0.0; - DOUBLE dpiDstY = 0.0; - - EProfileOption eProfileOption = RGB; - - // - // Set up the source and destination bitmaps so they are ready for use by TranslateBitmapBits - // - pInputImageStream.Attach(new(std::nothrow) CPrintReadStreamToIStream(pImageStream)); - if (SUCCEEDED(hr = CHECK_POINTER(pInputImageStream, E_OUTOFMEMORY)) && - SUCCEEDED(hr = m_srcBmp.Initialize(pInputImageStream)) && - SUCCEEDED(hr = m_srcBmp.GetSize(&cDstWidth, &cDstHeight)) && - SUCCEEDED(hr = m_srcBmp.GetResolution(&dpiDstX, &dpiDstY)) && - SUCCEEDED(hr = m_pProfManager->GetProfileOption(&eProfileOption))) - { - // - // The destination bitmap format can be one of: - // - // kWICPixelFormat128bppRGBFloat - scRGB output - // kWICPixelFormat128bppRGBAFloat - scRGB output with a source alpha channel - // kWICPixelFormat64bppCMYK - CMYK output - // kWICPixelFormat80bppCMYKAlpha - CMYK output with a source alpha channel - // - BOOL bScRGBOut = FALSE; - switch (eProfileOption) - { - case RGB: - { - eDstPixFormat = m_srcBmp.HasAlphaChannel() ? kWICPixelFormat128bppRGBAFloat : kWICPixelFormat128bppRGBFloat; - bScRGBOut = TRUE; - } - break; - - case CMYK: - { - eDstPixFormat = m_srcBmp.HasAlphaChannel() ? kWICPixelFormat40bppCMYKAlpha : kWICPixelFormat32bppCMYK; - } - break; - - default: - { - RIP("Unrecognised destination profile option.\n"); - - hr = E_FAIL; - } - break; - } - - if (SUCCEEDED(hr)) - { - // - // If the input is scRGB and the output is scRGB just pass through the bitmap - // Note: This should be optimised we do not write out a new bitmap but use the original - // - if (eDstPixFormat == m_srcBmp.GetPixelFormat() && - bScRGBOut) - { - m_dstBmp = m_srcBmp; - } - else if (SUCCEEDED(hr = m_dstBmp.Initialize(eDstPixFormat, cDstWidth, cDstHeight, dpiDstX, dpiDstY))) - { - bApplyTransform = TRUE; - } - } - } - - // - // Process the source and destination bitmaps a scanline at a time if the output image - // is still not set - // - if (SUCCEEDED(hr) && - bApplyTransform) - { - // - // Create scanline iterator objects from the source and destination bitmaps - // - CScanIterator srcIter(m_srcBmp, NULL); - CScanIterator dstIter(m_dstBmp, NULL); - - // - // Initialize the iterators, set the source profile and transform the scanlines - // - if (SUCCEEDED(hr = srcIter.Initialize(TRUE)) && - SUCCEEDED(hr = dstIter.Initialize(FALSE)) && - SUCCEEDED(hr = SetSrcProfile(&srcIter)) && - SUCCEEDED(hr = TransformScanLines(&srcIter, &dstIter))) - { - // - // CMYK output requires an embedded profile - // - CComBSTR bstrProfile; - if (eProfileOption == CMYK && - SUCCEEDED(hr = m_pProfManager->GetDstProfileName(&bstrProfile))) - { - hr = dstIter.SetProfile(bstrProfile); - } - } - - if (SUCCEEDED(hr)) - { - m_dstBmp = dstIter; - } - - // - // If there's a problem loading a suitable source profile, just pass - // the bitmap through unmodified - // - if (hr == HRESULT_FROM_WIN32(ERROR_PROFILE_NOT_FOUND)) - { - bApplyTransform = FALSE; - m_dstBmp = m_srcBmp; - hr = S_OK; - } - } - - if (SUCCEEDED(hr)) - { - // - // Create a write stream to accept the converted bitmap, fill from the output bitmap - // and write to the output stream (after ensuring the stream is pointing to the start). - // - CComPtr pOutputImageStream(NULL); - - LARGE_INTEGER cbMoveFromStart = {0}; - - PBYTE pBuff = new(std::nothrow) BYTE[CB_COPY_BUFFER]; - - if (SUCCEEDED(hr = CHECK_POINTER(pBuff, E_OUTOFMEMORY)) && - SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &pOutputImageStream)) && - SUCCEEDED(hr = m_dstBmp.Write(GUID_ContainerFormatWmp, pOutputImageStream)) && - SUCCEEDED(hr = pOutputImageStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL))) - { - ULONG cbRead = 0; - ULONG cbWritten = 0; - - while (SUCCEEDED(hr) && - SUCCEEDED(hr = pOutputImageStream->Read(pBuff, CB_COPY_BUFFER, &cbRead)) && - cbRead > 0) - { - hr = pStream->WriteBytes(pBuff, cbRead, &cbWritten); - ASSERTMSG(cbRead == cbWritten, "Failed to write all data.\n"); - } - } - - if (pBuff != NULL) - { - delete[] pBuff; - pBuff = NULL; - } - } - - // - // Set the content type of the image part - // - CComQIPtr pImage = pResource; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pImage, E_NOINTERFACE))) - { - hr = pImage->SetImageContent(CComBSTR(L"image/vnd.ms-photo")); - } - - // - // If all is well mark the replaced bitmap and profile for deletion - // - if (SUCCEEDED(hr)) - { - (*m_pResDel)[m_bstrBitmapURI.m_str] = TRUE; - - if (m_bstrSrcProfileURI.Length() > 0) - { - (*m_pResDel)[m_bstrSrcProfileURI.m_str] = TRUE; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorManagedImage::GetKeyName - -Routine Description: - - Method to obtain a unique key for the resource being handled - -Arguments: - - pbstrKeyName - Pointer to a string to hold the generated key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - if (m_bstrBitmapURI.Length() > 0) - { - *pbstrKeyName = NULL; - - // - // The full URI to the bitmap resource concatenated with any associated - // profile is a suitable key - // - try - { - CStringXDW cstrKey(m_bstrBitmapURI); - cstrKey += m_bstrSrcProfileURI; - - *pbstrKeyName = cstrKey.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorManagedImage::GetResURI - -Routine Description: - - Method to obtain the URI of the resource being handled - -Arguments: - - pbstrResURI - Pointer to a string to hold the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - if (m_bstrBitmapURI.Length() > 0) - { - try - { - // - // Create a URI from the original bitmap URI and the current tick count - // - CStringXDW cstrFileName(m_bstrBitmapURI); - CStringXDW cstrFileExt(PathFindExtension(cstrFileName)); - - INT indFileExt = cstrFileName.Find(cstrFileExt); - - if (indFileExt > -1) - { - cstrFileName.Delete(indFileExt, cstrFileExt.GetLength()); - } - - // - // Create a unique name for the bitmap for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"%s_%u.wdp", static_cast(cstrFileName), GetUniqueNumber()); - - SysFreeString(*pbstrResURI); - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorManagedImage::SetSrcProfile - -Routine Description: - - Method to set the source color profile given a particular source bitmap - -Arguments: - - pSrcBmp - Pointer to the source bitmap - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::SetSrcProfile( - _In_ CBmpConverter* pSrcBmp - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcBmp, E_POINTER))) - { - // - // Update the source profile based on the source bitmap. The source profile - // is set according to the following rules: - // - // If the profile is specified in the ImageSource mark-up - // Use the profile in the container - // Else If the profile is embeded - // Use the embedded profile - // Else - // If the profile is RGB <= 16 bpc - // Use sRGB profile as source - // Else if the profile is RGB > 16 bpc - // Use scRGB profile as source - // Else if the profile is CMYK - // Use SWOP profile as source - // - if (m_bstrSrcProfileURI.Length() > 0) - { - // - // The mark-up references a profile in the XPS document - get the profile manager - // to extract it and set as the source profile - // - hr = m_pProfManager->SetSrcProfileFromContainer(m_bstrSrcProfileURI); - } - else if (pSrcBmp->HasColorProfile()) - { - IWICColorContext* pSrcContext = NULL; - - UINT cbBuffer = 0; - PBYTE pBuffer = NULL; - UINT cbActual = 0; - - // - // We have a profile embedded in the bitmap - extract and set as the source profile - // - if (SUCCEEDED(hr = pSrcBmp->GetColorContext(&pSrcContext)) && - SUCCEEDED(hr = pSrcContext->GetProfileBytes(cbBuffer, pBuffer, &cbActual))) - { - if (cbActual > 0) - { - pBuffer = new(std::nothrow) BYTE[cbActual]; - cbBuffer = cbActual; - - // - // The annotation on IWICColorContext::GetProfileBytes requires that the buffer - // be initialized. - // - - if (SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_OUTOFMEMORY))) - { - ::memset(pBuffer, 0, cbBuffer); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pSrcContext->GetProfileBytes(cbBuffer, pBuffer, &cbActual))) - { - // - // Set the source profile in the profile manager. Note: in this instance the profile name is - // no used to load the profile, merely to cache the profile. The bitmap URI uniquely idenitifies - // the bitmap and hence the embedded profile and is appropriate as a cache name - // - hr = m_pProfManager->SetSrcProfileFromBuffer(m_bstrBitmapURI, pBuffer, cbBuffer); - } - - if (pBuffer != NULL) - { - delete[] pBuffer; - pBuffer = NULL; - } - } - else - { - RIP("Zero length profile.\n"); - hr = E_FAIL; - } - } - } - else - { - // - // Deduce the source profile from the source bitmap format - // - switch (pSrcBmp->GetPixelFormat()) - { - case kWICPixelFormatDontCare: - case kWICPixelFormat1bppIndexed: - case kWICPixelFormat2bppIndexed: - case kWICPixelFormat4bppIndexed: - case kWICPixelFormat8bppIndexed: - case kWICPixelFormatBlackWhite: - case kWICPixelFormat2bppGray: - case kWICPixelFormat4bppGray: - case kWICPixelFormat8bppGray: - case kWICPixelFormat16bppBGR555: - case kWICPixelFormat16bppBGR565: - case kWICPixelFormat16bppGray: - case kWICPixelFormat24bppBGR: - case kWICPixelFormat24bppRGB: - case kWICPixelFormat32bppBGR: - case kWICPixelFormat32bppBGRA: - case kWICPixelFormat32bppPBGRA: - case kWICPixelFormat32bppBGR101010: - case kWICPixelFormat48bppRGB: - case kWICPixelFormat64bppRGBA: - case kWICPixelFormat64bppPRGBA: - { - hr = m_pProfManager->SetSrcProfileFromColDir(L"sRGB Color Space Profile.icm"); - } - break; - - case kWICPixelFormat48bppRGBFixedPoint: - case kWICPixelFormat96bppRGBFixedPoint: - case kWICPixelFormat128bppRGBAFloat: - case kWICPixelFormat128bppPRGBAFloat: - case kWICPixelFormat128bppRGBFloat: - case kWICPixelFormat64bppRGBAFixedPoint: - case kWICPixelFormat64bppRGBFixedPoint: - case kWICPixelFormat128bppRGBAFixedPoint: - case kWICPixelFormat128bppRGBFixedPoint: - case kWICPixelFormat64bppRGBAHalf: - case kWICPixelFormat64bppRGBHalf: - case kWICPixelFormat48bppRGBHalf: - case kWICPixelFormat32bppRGBE: - case kWICPixelFormat16bppGrayHalf: - case kWICPixelFormat32bppGrayFloat: - case kWICPixelFormat32bppGrayFixedPoint: - case kWICPixelFormat16bppGrayFixedPoint: - { - hr = m_pProfManager->SetSrcProfileFromColDir(L"xdwscRGB.icc"); - } - break; - - case kWICPixelFormat32bppCMYK: - case kWICPixelFormat64bppCMYK: - case kWICPixelFormat40bppCMYKAlpha: - case kWICPixelFormat80bppCMYKAlpha: - { - hr = m_pProfManager->SetSrcProfileFromColDir(L"xdCMYKPrinter.icc"); - } - break; - - default: - { - RIP("No acceptable default profile.\n"); - - hr = HRESULT_FROM_WIN32(ERROR_PROFILE_NOT_FOUND); - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CColorManagedImage::TransformScanLines - -Routine Description: - - Given source and destination scanline iterators, this method applies the - requiresite color transform - -Arguments: - - pSrcScans - Pointer to the source scanline iterator - pDstScans - Pointer to the destination scanline iterator - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorManagedImage::TransformScanLines( - _In_ CScanIterator* pSrcScans, - _In_ CScanIterator* pDstScans - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcScans, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDstScans, E_POINTER))) - { - try - { - // - // Apply the transform - // - HTRANSFORM hTransform = NULL; - BOOL bCanUseWCS = FALSE; - - if (SUCCEEDED(hr = m_pProfManager->GetColorTransform(&hTransform, &bCanUseWCS))) - { - PBYTE pDstData = NULL; - BMFORMAT bmSrcFormat; - UINT cSrcWidth = 0; - UINT cSrcHeight = 0; - UINT cbSrcStride = 0; - - PBYTE pSrcData = NULL; - BMFORMAT bmDstFormat; - UINT cDstWidth = 0; - UINT cDstHeight = 0; - UINT cbDstStride = 0; - - // - // While the source andd destination have scanlines remaining to process... - // - while (!pDstScans->Finished() && - !pSrcScans->Finished() && - SUCCEEDED(hr)) - { - // - // ...retrieve the scan buffers (these may have been processed to remove alpha data)... - // - if (SUCCEEDED(hr = pSrcScans->GetScanBuffer(&pSrcData, &bmSrcFormat, &cSrcWidth, &cSrcHeight, &cbSrcStride)) && - SUCCEEDED(hr = pDstScans->GetScanBuffer(&pDstData, &bmDstFormat, &cDstWidth, &cDstHeight, &cbDstStride))) - { - // - // ...translate the scanline data... - // - if (TranslateBitmapBits(hTransform, - pSrcData, - bmSrcFormat, - cSrcWidth, - cSrcHeight, - cbSrcStride, - pDstData, - bmDstFormat, - cbDstStride, - NULL, - 0)) - { - // - // ...and commit the data to the destination bitmap before incrementing to the next scanline. - // - hr = pDstScans->Commit(*pSrcScans); - (*pSrcScans)++; - (*pDstScans)++; - } - else - { - RIP("Translate bitmap bits failed.\n"); - hr = GetLastErrorAsHResult(); - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmimg.h b/print/XPSDrvSmpl/src/filters/color/cmimg.h deleted file mode 100644 index 397c3678..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmimg.h +++ /dev/null @@ -1,87 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmimg.h - -Abstract: - - Color management image definition. The CColorManagedImage class is responsible - for managing the image resources used in a container. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#pragma once - -#include "rescache.h" -#include "profman.h" -#include "scaniter.h" -#include "cmflt.h" - -class CColorManagedImage : public IResWriter -{ -public: - CColorManagedImage( - _In_ BSTR bstrResURI, - _In_ CProfileManager* pProfManager, - _In_ IFixedPage* pFixedPage, - _In_ ResDeleteMap* pResDel - ); - - ~CColorManagedImage(); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - HRESULT - SetSrcProfile( - _In_ CBmpConverter* pScanIter - ); - - HRESULT - TransformScanLines( - _In_ CScanIterator* pSrcScans, - _In_ CScanIterator* pDstScans - ); - -private: - CComBSTR m_bstrBitmapURI; - - CComBSTR m_bstrSrcProfileURI; - - CProfileManager* m_pProfManager; - - CBmpConverter m_srcBmp; - - CBmpConverter m_dstBmp; - - CComPtr m_pFixedPage; - - ResDeleteMap* m_pResDel; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/cmsax.cpp b/print/XPSDrvSmpl/src/filters/color/cmsax.cpp deleted file mode 100644 index f5db86dd..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmsax.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmsax.cpp - -Abstract: - - Color managed image SAX handler implementation. The CCMSaxHandler class is responsible - for handling the XML markup in the container. - - Note regarding opacity masks: Ideally we would like to avoid color matching whilst - within an opacity mask element as only the alpha channel is of interest. This is - complicated however by the fact that the opacity mask resources my be re-used as - rendering resources. Ideally we would color match opacity mask elements only when - the resources are shared with other rendering operations. This is difficult to - achieve with SAX however as we do not know a priori if the resource is shared or - the resource is going to be shared. - Currently we are performing unnecessary color matching when an opacity mask is - encountered. We could alternatively ensure opacity mask resources are preserved and - other render sources are modified and written as new resources. The trade off is - reduced speed performance against added resource handling complexity and XPS - content bloat. This implementation takes the first option which trades processing time - against the amount of data written to the container and resource handling complexity. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "cmsax.h" - -/*++ - -Routine Name: - - CCMSaxHandler::CCMSaxHandler - -Routine Description: - - Contructor for the color management filters SAX handler. - The constructor registers a writer for sending new markup out to and a color - converter object which handles any color conversion work for those markup - elements containing color data. - -Arguments: - - pWriter - Pointer to a write stream which receives markup - pConverter - Pointer to a color converter object which handles any - color conversion work for elements containing color data - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CCMSaxHandler::CCMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_opt_ CResourceDictionaryConverter* pDictConverter - ) : - m_pWriter(pWriter), - m_bOpenTag(FALSE), - m_pBmpConv(pBmpConverter), - m_pRefConv(pRefConverter), - m_pDictConv(pDictConverter) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to color SAX handler.\n"); - ASSERTMSG(m_pBmpConv != NULL, "NULL bitmap color converter passed to color SAX handler.\n"); - ASSERTMSG(m_pRefConv != NULL, "NULL color ref converter passed to color SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pBmpConv, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pRefConv, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CCMSaxHandler::~CCMSaxHandler - -Routine Description: - - Default destructor for the color management filters SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CCMSaxHandler::~CCMSaxHandler() -{ - m_bstrOpenElement.Empty(); -} - -/*++ - -Routine Name: - - CCMSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup. - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CCMSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName < 1) - { - hr = E_INVALIDARG; - } - } - - CStringXDW cstrOut; - if (SUCCEEDED(hr)) - { - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = bstrElement; - - // - // Create output element - // - cstrOut.Append(L"<"); - cstrOut.Append(bstrElement); - - // - // We opened a tag - // - m_bOpenTag = TRUE; - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes; cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - if (bstrElement == L"ResourceDictionary" && - bstrAttName == L"Source") - { - // - // Convert remote resource dictionary - // - if (SUCCEEDED(hr = CHECK_POINTER(m_pDictConv, E_FAIL))) - { - hr = m_pDictConv->Convert(&bstrAttValue); - } - } - else - { - // - // Find all color refs and image sources. - // - if (bstrAttName == L"Color" || - bstrAttName == L"Fill" || - bstrAttName == L"Stroke" ) - { - // - // Process the value passing the colorref - // - hr = m_pRefConv->Convert(&bstrAttValue); - } - else if (bstrAttName == L"ImageSource") - { - // - // Process the value passing the URI - // - hr = m_pBmpConv->Convert(&bstrAttValue); - } - } - - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CCMSaxHandler::endElement - -Routine Description: - - SAX handler method which handles each end element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CCMSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER))) - { - if (cchQName < 1) - { - hr = E_INVALIDARG; - } - } - - CStringXDW cstrClose; - if (SUCCEEDED(hr)) - { - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - // - // If this is a root element with child nodes, the open - // element will not match the last startElement. In this case - // we need to add an appropriate closing tag - // - if (bstrElement == m_bstrOpenElement) - { - // - // Names match so just add a closing bracket - // - // We might have closed the tag when writing a new element - // - if (m_bOpenTag) - { - cstrClose.Append(L"/>"); - } - } - else - { - // - // Add a clossing tag - // - cstrClose.Append(L""); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - m_bOpenTag = FALSE; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CCMSaxHandler::startDocument - -Routine Description: - - SAX handler method which handles the start document call to ensure - the xml version is correctly set - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CCMSaxHandler::startDocument( - void - ) -{ - HRESULT hr = S_OK; - - try - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pWriter, E_FAIL))) - { - CStringXDW cstrOut(L""); - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/cmsax.h b/print/XPSDrvSmpl/src/filters/color/cmsax.h deleted file mode 100644 index dc09f9d0..00000000 --- a/print/XPSDrvSmpl/src/filters/color/cmsax.h +++ /dev/null @@ -1,80 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cmsax.h - -Abstract: - - Color management sax handler definition. The color management SAX handler - is responsible for parsing the FixedPage mark-up for and vector objects - or bitmaps which contain color data and altering the mark-up where appropriate. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "colconv.h" - -class CCMSaxHandler : public CSaxHandler -{ -public: - CCMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_opt_ CResourceDictionaryConverter* pDictConverter - ); - - virtual ~CCMSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - - HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - -private: - CComPtr m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CColorConverter* m_pBmpConv; - - CColorConverter* m_pRefConv; - - CColorConverter* m_pDictConv; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/colchan.cpp b/print/XPSDrvSmpl/src/filters/color/colchan.cpp deleted file mode 100644 index 2d98334f..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colchan.cpp +++ /dev/null @@ -1,1883 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colchan.cpp - -Abstract: - - Color channel class implementation. The color channel class is responsible for maintaining - simple single color multiple channel data intialised from color references in the XPS markup. - It provides methods for intialization, access and conversion of the data. - - Note regarding color formats: The CColorChannelData class is only used in the filter for - processing color references in mark-up. As such we only ever see 8 bit per channel sRGB and - floating point scRGB and n-channel colors and we only ever need convert to 16 bpc for - down-level scRGB conversion. If the CColorChannelData is ever used when fixed point input - or other output types are required then these formats need support added (see E_NOTIMPL - return values). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "colchan.h" - -#define MAX_CHANNEL_COUNT 9 // 1 alpha channel and 8 color channels -#define MAX_CHANNEL_SIZE sizeof(FLOAT) - -DWORD g_cbChannelType[] = { - sizeof(BYTE), // COLOR_BYTE - sizeof(WORD), // COLOR_WORD - sizeof(FLOAT), // COLOR_FLOAT - sizeof(WORD) // COLOR_S2DOT13FIXED -}; - - -/*++ - -Routine Name: - - CColorChannelData::CColorChannelData - -Routine Description: - - CColorChannelData default constructor - -Arguments: - - None - -Return Value: - - None - Throws an exception on failure. - ---*/ -CColorChannelData::CColorChannelData() : - m_cChannels(0), - m_channelType(COLOR_BYTE), - m_pChannelData(NULL), - m_cbChannelData(0), - m_dataType(sRGB) -{ - if (FAILED(AllocateChannelBuffers(&m_cbChannelData, &m_pChannelData))) - { - throw CXDException(E_OUTOFMEMORY); - } -} - -/*++ - -Routine Name: - - CColorChannelData::~CColorChannelData - -Routine Description: - - CColorChannelData destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorChannelData::~CColorChannelData() -{ - FreeChannelBuffers(); -} - -/*++ - -Routine Name: - - CColorChannelData::AddChannelData - -Routine Description: - - Template method for adding channel data. This allows any of the available color - channel data types to be added to the channel data buffer - -Arguments: - - channelValue - Value for the channel to be added - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template -HRESULT -CColorChannelData::AddChannelData( - _In_ CONST _T& channelValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = ValidateDataSize<_T>())) - { - if (m_cChannels < MAX_CHANNEL_COUNT) - { - _T* pChannelData = reinterpret_cast<_T*>(m_pChannelData); - pChannelData[m_cChannels] = channelValue; - m_cChannels++; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelCount - -Routine Description: - - Retrieves the current number of channels defining the color. - -Arguments: - - pcChannels - Pointer to a variable that recieves the count of channels - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelCount( - _Out_ DWORD* pcChannels - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcChannels, E_POINTER))) - { - *pcChannels = m_cChannels; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelCountNoAlpha - -Routine Description: - - Retrieves the number of channels less the alpha channel if present - -Arguments: - - pcChannels - Pointer to a variable that recieves the count of non-alpha channels - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelCountNoAlpha( - _Out_ DWORD* pcChannels - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = GetChannelCount(pcChannels))) - { - if (HasAlpha()) - { - (*pcChannels)--; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelType - -Routine Description: - - Retrieves the COLORDATATYPE for the channel data - -Arguments: - - pChannelType - Pointer to a COLORDATATYPE variable that recieves the type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelType( - _Out_ COLORDATATYPE* pChannelType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelType, E_POINTER))) - { - *pChannelType = m_channelType; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ResetChannelType - -Routine Description: - - Resets the underlying channel data type to the requested type - -Arguments: - - channelType - The channel data type to reset to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ResetChannelType( - _In_ CONST COLORDATATYPE& channelType - ) -{ - m_channelType = channelType; - m_cChannels = 0; - - return S_OK; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelData - -Routine Description: - - Retrieves the buffer and count of bytes of the channel data - -Arguments: - - pcbDataSize - Pointer to variable that recieves the count of bytes in the buffer - ppData - Pointer to a BYTE pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelData( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ) -{ - HRESULT hr = S_OK; - - DWORD cbDataTypeSize = 0; - if (SUCCEEDED(hr = CHECK_POINTER(pcbDataSize, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = GetChannelSizeFromType(m_channelType, &cbDataTypeSize))) - { - *ppData = NULL; - *pcbDataSize = 0; - - if (m_cbChannelData >= m_cChannels * cbDataTypeSize) - { - if (m_cChannels > 0) - { - *pcbDataSize = m_cChannels * cbDataTypeSize; - *ppData = m_pChannelData; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelDataNoAlpha - -Routine Description: - - Retrieves the buffer and count of bytes of the channel data excluding the - alpha channel if present - -Arguments: - - pcbDataSize - Pointer to variable that recieves the count of bytes in the buffer - ppData - Pointer to a BYTE pointer that recieves the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelDataNoAlpha( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ) -{ - HRESULT hr = S_OK; - - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbDataSize, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = GetChannelData(&cbData, reinterpret_cast(&pData)))) - { - *pcbDataSize = cbData; - *ppData = pData; - - if (HasAlpha()) - { - DWORD cbChannelSize = 0; - if (SUCCEEDED(hr = GetChannelSizeFromType(m_channelType, &cbChannelSize))) - { - if (cbData >= cbChannelSize) - { - *pcbDataSize = cbData - cbChannelSize; - *ppData = pData + cbChannelSize; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ClampChannelValues - -Routine Description: - - Template method that recieves the minimum and maximum value for a channel - and applies this to all channels defining the color - -Arguments: - - min - Minimum channel value - max - Maximum channel value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template -HRESULT -CColorChannelData::ClampChannelValues( - _In_ CONST _T& min, - _In_ CONST _T& max - ) -{ - HRESULT hr = S_OK; - - // - // Validate the data size against the current type - // - if (SUCCEEDED(hr = ValidateDataSize<_T>())) - { - _T* pData = reinterpret_cast<_T*>(m_pChannelData); - for (DWORD cChannel = 0; cChannel < m_cChannels; cChannel++, pData++) - { - if (*pData < min) - { - *pData = min; - } - else if (*pData > max) - { - *pData = max; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::InitializeChannelData - -Routine Description: - - Initializes the channel data according to the type, count of channels and a default value - -Arguments: - - channelType - The required channel data format - dataType - The required data type - cChannels - The count of channels defining the color - channelValue - The intial value for all channels - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template -HRESULT -CColorChannelData::InitializeChannelData( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST _T& channelValue - ) -{ - HRESULT hr = S_OK; - - // - // Validate the data size against the current type - // - if (SUCCEEDED(hr = ResetChannelType(channelType)) && - SUCCEEDED(hr = ValidateDataSize<_T>())) - { - if (cChannels <= MAX_CHANNEL_COUNT) - { - m_dataType = dataType; - m_cChannels = cChannels; - _T* pChannelData = reinterpret_cast<_T*>(m_pChannelData); - - for (DWORD cChannel = 0; cChannel < m_cChannels; cChannel++, pChannelData++) - { - *pChannelData = channelValue; - } - } - else - { - hr = E_INVALIDARG; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::SetColorDataType - -Routine Description: - - Sets the color data type - -Arguments: - - dataType - The color data type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::SetColorDataType( - _In_ CONST EColorDataType& dataType - ) -{ - m_dataType = dataType; - - return S_OK; -} - -/*++ - -Routine Name: - - CColorChannelData::GetColorDataType - -Routine Description: - - Retrieves the current color data type - -Arguments: - - pDataType - Pointer to a variable to recieve the color data type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetColorDataType( - _Out_ EColorDataType* pDataType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDataType, E_POINTER))) - { - *pDataType = m_dataType; - } - - return S_OK; -} - -/*++ - -Routine Name: - - CColorChannelData::HasAlpha - -Routine Description: - - Indicates if the color channel data includes an alpha channel - -Arguments: - - None - -Return Value: - - TRUE - An alpha channel is present - FALSE - There is no alpha channel - ---*/ -BOOL -CColorChannelData::HasAlpha( - VOID - ) -{ - // - // If the source or destination is n-channel, or if either sRGB or scRGB have 4 channels, - // we have an alpha channel - // - return m_dataType == nChannel || m_cChannels == 4; -} - -/*++ - -Routine Name: - - CColorChannelData::GetAlphaChannelSize - -Routine Description: - - Retrieves the count of bytes of the alpha channel - -Arguments: - - pcbAlphaChannel - pointer to a variable that recieves the count of bytes of the alpha channel - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetAlphaChannelSize( - _Out_ DWORD* pcbAlphaChan - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbAlphaChan, E_POINTER))) - { - *pcbAlphaChan = 0; - if (HasAlpha()) - { - hr = GetChannelSizeFromType(m_channelType, pcbAlphaChan); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::InitializeAlphaChannel - -Routine Description: - - Initialize the alpha channel based off a source color channel data object - -Arguments: - - pSrcChannelData - Pointer to a source color data channel object - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::InitializeAlphaChannel( - _In_ CColorChannelData* pSrcChannelData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcChannelData, E_POINTER))) - { - if (HasAlpha()) - { - FLOAT alpha = 1.0f; - if (SUCCEEDED(hr) && - pSrcChannelData->HasAlpha() && - SUCCEEDED(hr = pSrcChannelData->GetAlphaAsFloat(&alpha))) - { - // - // Ensure alpha lies between 0.0 and 1.0 - // - if (alpha < 0.0) - { - alpha = 0.0; - } - else if (alpha > 1.0) - { - alpha = 1.0; - } - } - - switch (m_channelType) - { - case COLOR_BYTE: - { - *m_pChannelData = static_cast(alpha * kMaxByteAsFloat); - } - break; - - case COLOR_WORD: - { - *reinterpret_cast(m_pChannelData) = static_cast(alpha * kMaxWordAsFloat); - } - break; - - case COLOR_FLOAT: - { - *reinterpret_cast(m_pChannelData) = alpha; - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised channel data format.\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetColor - -Routine Description: - - Retrieves a COLOR object based of the channel data - -Arguments: - - pColor - Pointer to a color structure to be filled in - pType - Pointer to storage to accept the color type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetColor( - _Out_ PCOLOR pColor, - _Out_ COLORTYPE* pType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pColor, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pType, E_POINTER))) - { - if (m_cChannels == 0) - { - hr = E_PENDING; - } - } - - DWORD cChannels = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels))) - { - if (cChannels <= 4) - { - hr = ColorToWord(reinterpret_cast(pColor), static_cast(sizeof(COLOR))); - } - else if (cChannels <= 8) - { - hr = ColorToByte(reinterpret_cast(pColor), static_cast(sizeof(COLOR))); - } - else - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - if (m_dataType == sRGB || - m_dataType == scRGB) - { - *pType = COLOR_RGB; - } - else if (m_dataType == nChannel) - { - *pType = static_cast(cChannels + 3); - } - else - { - RIP("Unrecognised data type.\n"); - - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::SetColor - -Routine Description: - - Sets the channel data based on a COLOR structure - -Arguments: - - pColor - Pointer to a color structure to set the channel data from - type - The color type described by the color structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::SetColor( - _In_ COLOR* pColor, - _In_ CONST COLORTYPE& type - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pColor, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast(&pData)))) - { - DWORD cSrcChannels = 0; - - switch (type) - { - case COLOR_RGB: - { - if (m_dataType == sRGB || - m_dataType == scRGB) - { - cSrcChannels = 3; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - break; - - case COLOR_3_CHANNEL: - case COLOR_CMYK: - case COLOR_5_CHANNEL: - case COLOR_6_CHANNEL: - case COLOR_7_CHANNEL: - case COLOR_8_CHANNEL: - { - if (m_dataType == nChannel) - { - cSrcChannels = static_cast(type - 3); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - break; - - case COLOR_GRAY: - case COLOR_XYZ: - case COLOR_Yxy: - case COLOR_Lab: - case COLOR_NAMED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - - if (SUCCEEDED(hr)) - { - if (cChannels == cSrcChannels) - { - if (cSrcChannels <= 4) - { - hr = ColorFromWord(reinterpret_cast(pColor), sizeof(COLOR)); - } - else if (cSrcChannels <= 8) - { - hr = ColorFromByte(reinterpret_cast(pColor), sizeof(COLOR)); - } - else - { - RIP("Invalid channel count\n"); - hr = E_FAIL; - } - } - else - { - RIP("Miss-match between source channel count and current channel count\n"); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ColorToByte - -Routine Description: - - Converts the channel data to a 8 bpc COLOR type - -Arguments: - - pDstData - Pointer to the data to be set - cbDstData - Size of the destination buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorToByte( - _Out_writes_bytes_(cbDstData) PBYTE pDstData, - _In_ CONST UINT cbDstData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast(&pData)))) - { - ZeroMemory(pDstData, cbDstData); - - if (cbDstData < cChannels) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - if (SUCCEEDED(hr) && - cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - - if (SUCCEEDED(hr)) - { - if (cbDstData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbDstData >= cbData) - { - // - // Just copy all channels after alpha into the buffer - // - CopyMemory(pDstData, pData, cbData); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbDstData >= cChannels * sizeof(BYTE) && - cbData >= cChannels * sizeof(WORD)) - { - PWORD pSrcData = reinterpret_cast(pData); - - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbDstData); - - pDstData[cCurrChan] = static_cast(MulDiv(pSrcData[cCurrChan], 0xFF, 0xFFFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data runs between 0.0 and 1.0 for nChannel and sRGB and is - // truncated and scaled as follows for scRGB: - // - // 1. Truncate the input color to between -2.0 and +2.0 - // 2. Offset the value by +2.0 to put it into the 0.0 to 4.0 range - // 3. Scale the value down by 4.0 to put it into the range 0.0 to 1.0 - // 4. Set the 16 bit value according to the channel value from 0x00 - // for 0.0 to 0xFF for 1.0 - // - if (cbDstData >= cChannels * sizeof(BYTE) && - cbData >= cChannels * sizeof(FLOAT)) - { - PFLOAT pSrcData = reinterpret_cast(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbDstData); - - FLOAT channelValue = pSrcData[cCurrChan]; - channelValue = channelValue < -2.0f ? -2.0f : channelValue; - channelValue = channelValue > 2.0f ? 2.0f : channelValue; - channelValue += 2.0f; - channelValue /= 4.0f; - pDstData[cCurrChan] = static_cast(channelValue * kMaxByteAsFloat); - } - } - else - { - if (SUCCEEDED(hr = ClampChannelValues(0.0f, 1.0f))) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbDstData); - - pDstData[cCurrChan] = static_cast(pSrcData[cCurrChan] * kMaxByteAsFloat); - } - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ColorToWord - -Routine Description: - - Converts the channel data to a 16 bpc COLOR type - -Arguments: - - pDstData - Pointer to the data to be set - cbDstData - Size of the destination buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorToWord( - _Out_writes_bytes_(cbDstData) PWORD pDstData, - _In_ CONST UINT cbDstData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast(&pData)))) - { - ZeroMemory(pDstData, cbDstData); - - if (cbDstData / sizeof(WORD) < cChannels) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - if (SUCCEEDED(hr) && - cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - - if (SUCCEEDED(hr)) - { - if (cbDstData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbDstData >= cChannels * sizeof(WORD) && - cbData >= cChannels * sizeof(BYTE)) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) <= cbDstData); - - pDstData[cCurrChan] = static_cast(MulDiv(pData[cCurrChan], 0xFFFF, 0xFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbDstData - cbData > 0) - { - // - // Just copy all channels after alpha into the COLOR structure - // - CopyMemory(pDstData, pData, cbData); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data runs between 0.0 and 1.0 for nChannel and sRGB and is - // truncated and scaled as follows for scRGB: - // - // 1. Truncate the input color to between -2.0 and +2.0 - // 2. Offset the value by +2.0 to put it into the 0.0 to 4.0 range - // 3. Scale the value by 4.0 to put it into the range 0.0 to 1.0 - // 4. Set the 16 bit value according to the channel value from 0x0000 - // for 0.0 to 0xFFFF for 1.0 - // - if (cbDstData >= cChannels * sizeof(WORD) && - cbData >= cChannels * sizeof(FLOAT)) - { - PFLOAT pSrcData = reinterpret_cast(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) <= cbDstData); - - FLOAT channelValue = pSrcData[cCurrChan]; - channelValue = channelValue < -2.0f ? -2.0f : channelValue; - channelValue = channelValue > 2.0f ? 2.0f : channelValue; - channelValue += 2.0f; - channelValue /= 4.0f; - pDstData[cCurrChan] = static_cast(channelValue * kMaxWordAsFloat); - } - } - else - { - if (SUCCEEDED(hr = ClampChannelValues(0.0f, 1.0f))) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) <= cbDstData); - - pDstData[cCurrChan] = static_cast(pSrcData[cCurrChan] * kMaxWordAsFloat); - } - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CColorChannelData::ColorFromByte - -Routine Description: - - Uses an 8 bpc COLOR structure to set the channel data - -Arguments: - - pSrcData - Pointer to the source COLOR data - cbSrcData - Size of the source buffer in bytes - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorFromByte( - _In_reads_bytes_(cbSrcData) PBYTE pSrcData, - _In_ CONST UINT& cbSrcData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast(&pData)))) - { - if (cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - } - - if (SUCCEEDED(hr)) - { - ZeroMemory(pData, cbData); - - if (cbSrcData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbData >= cChannels * sizeof(BYTE) && - cbSrcData >= cChannels * sizeof(BYTE)) - { - // - // Just copy src to dst - // - CopyMemory(pData, pSrcData, cChannels * sizeof(BYTE)); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbData >= cChannels * sizeof(WORD) && - cbSrcData >= cChannels * sizeof(BYTE)) - { - PWORD pDstData = reinterpret_cast(pData); - - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbSrcData); - - pDstData[cCurrChan] = static_cast(MulDiv(pSrcData[cCurrChan], 0xFFFF, 0xFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data is scaled to 0.0 and 1.0 for nChannel and sRGB and is - // scaled as follows for scRGB: - // - // 1. Convert the WORD value from 0x00 - 0xFF to 0.0f - 1.0f - // 1. Scale the value up by 4.0 to put it into the range 0.0 to 2.0 - // 2. Offset the value by -2.0 to put it into the -2.0 to 2.0 range - // - if (cbData >= cChannels * sizeof(FLOAT) && - cbSrcData >= cChannels * sizeof(BYTE)) - { - PFLOAT pDstData = reinterpret_cast(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbSrcData); - - pDstData[cCurrChan] = ((static_cast(pSrcData[cCurrChan])*4.0f)/kMaxByteAsFloat) - 2.0f; - } - } - else - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_(cCurrChan < cbSrcData); - - pDstData[cCurrChan] = static_cast(pSrcData[cCurrChan])/kMaxByteAsFloat; - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ColorFromWord - -Routine Description: - - Uses an 16 bpc COLOR structure to set the channel data - -Arguments: - - pSrcData - Pointer to the source COLOR data - cbSrcData - Size of the source buffer in bytes - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::ColorFromWord( - _In_reads_bytes_(cbSrcData) PWORD pSrcData, - _In_ CONST UINT& cbSrcData - ) -{ - HRESULT hr = S_OK; - - DWORD cChannels = 0; - DWORD cbData = 0; - PBYTE pData = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcData, E_POINTER)) && - SUCCEEDED(hr = GetChannelCountNoAlpha(&cChannels)) && - SUCCEEDED(hr = GetChannelDataNoAlpha(&cbData, reinterpret_cast(&pData)))) - { - if (cbData == 0 && - cChannels != 0) - { - hr = E_UNEXPECTED; - } - } - - if (SUCCEEDED(hr)) - { - ZeroMemory(pData, cbData); - - if (cbSrcData > 0) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - if (cbData >= cChannels * sizeof(BYTE) && - cbSrcData >= cChannels * sizeof(WORD)) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) < cbSrcData); - - pData[cCurrChan] = static_cast(MulDiv(pSrcData[cCurrChan], 0xFF, 0xFFFF)); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_WORD: - { - if (cbData >= cChannels * sizeof(WORD) && - cbSrcData >= cChannels * sizeof(WORD)) - { - // - // Just copy src to dst - // - CopyMemory(pData, pSrcData, cChannels * sizeof(WORD)); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_FLOAT: - { - // - // Make sure the float data is scaled to 0.0 and 1.0 for nChannel and sRGB and is - // scaled as follows for scRGB: - // - // 1. Convert the WORD value from 0x0000 - 0xFFFF to 0.0f - 1.0f - // 1. Scale the value up by 4.0 to put it into the range 0.0 to 2.0 - // 2. Offset the value by -2.0 to put it into the -2.0 to 2.0 range - // - if (cbData >= cChannels * sizeof(FLOAT) && - cbSrcData >= cChannels * sizeof(WORD)) - { - PFLOAT pDstData = reinterpret_cast(pData); - - if (m_dataType == scRGB) - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) < cbSrcData); - - pDstData[cCurrChan] = ((static_cast(pSrcData[cCurrChan])*4.0f)/kMaxWordAsFloat) - 2.0f; - } - } - else - { - for (UINT cCurrChan = 0; - cCurrChan < cChannels; - cCurrChan++) - { - _Analysis_assume_((cCurrChan + 1) * sizeof(WORD) < cbSrcData); - - pDstData[cCurrChan] = static_cast(pSrcData[cCurrChan])/kMaxWordAsFloat; - } - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised color type\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::GetChannelSizeFromType - -Routine Description: - - Retrieves the channel data size from the channel data type - -Arguments: - - channelType - The color channel data type - pcbChannelSize - Pointer to storage to recieve the channel data size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetChannelSizeFromType( - _In_ CONST COLORDATATYPE& channelType, - _Out_ DWORD* pcbChannelSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbChannelSize, E_POINTER))) - { - if (channelType < COLOR_BYTE || - channelType > COLOR_S2DOT13FIXED) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - *pcbChannelSize = g_cbChannelType[channelType - 1]; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::ValidateDataSize - -Routine Description: - - Template method that validates the data size given the current channel data type - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template -HRESULT -CColorChannelData::ValidateDataSize( - VOID - ) -{ - HRESULT hr = S_OK; - - DWORD cbDataSize = 0; - if (SUCCEEDED(hr = GetChannelSizeFromType(m_channelType, &cbDataSize))) - { - // - // Make sure the data being added matches the data type in size - // - if (sizeof(_T) != cbDataSize) - { - hr = E_INVALIDARG; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::AllocateChannelBuffers - -Routine Description: - - Allocates the channel data buffer - -Arguments: - - pcbBuffer - Pointer to variable that recieves the allocated buffer size - ppBuffer - Pointer to a pointer that recieves the buffer address - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::AllocateChannelBuffers( - _Out_ UINT* pcbBuffer, - _Outptr_result_bytebuffer_(*pcbBuffer) _At_buffer_(*ppBuffer, _Iter_, *pcbBuffer, _Post_invalid_) - PBYTE* ppBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbBuffer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER))) - { - // - // Allocate a buffer for the channel data MAX_CHANNEL_COUNT x MAX_CHANNEL_SIZE - // This guarantees we have enough storage for the maximum n-channel support - // in WCS - // - *pcbBuffer = MAX_CHANNEL_COUNT*MAX_CHANNEL_SIZE; - *ppBuffer = new(std::nothrow) BYTE[*pcbBuffer]; - - if (*ppBuffer == NULL) - { - *pcbBuffer = 0; - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorChannelData::FreeChannelBuffers - -Routine Description: - - Releases channel buffer - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CColorChannelData::FreeChannelBuffers( - VOID - ) -{ - if (m_pChannelData != NULL) - { - delete[] m_pChannelData; - m_pChannelData = NULL; - } - m_cbChannelData = 0; -} - -/*++ - -Routine Name: - - CColorChannelData::GetAlphaAsFloat - -Routine Description: - - Retrieves the alpha value of the channel data as a float - -Arguments: - - pAlpha - Pointer to a float that recieves the alpha value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorChannelData::GetAlphaAsFloat( - _Out_ PFLOAT pAlpha - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pAlpha, E_POINTER))) - { - *pAlpha = 0.0f; - - if (HasAlpha()) - { - switch (m_channelType) - { - case COLOR_BYTE: - { - *pAlpha = static_cast(*m_pChannelData)/kMaxByteAsFloat; - } - break; - - case COLOR_WORD: - { - *pAlpha = static_cast(*reinterpret_cast(m_pChannelData))/kMaxWordAsFloat; - } - break; - - case COLOR_FLOAT: - { - *pAlpha = *reinterpret_cast(m_pChannelData); - } - break; - - case COLOR_S2DOT13FIXED: - { - hr = E_NOTIMPL; - } - break; - - default: - { - RIP("Unrecognised channel data format.\n"); - hr = E_FAIL; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/colchan.h b/print/XPSDrvSmpl/src/filters/color/colchan.h deleted file mode 100644 index 393261a8..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colchan.h +++ /dev/null @@ -1,289 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colchan.h - -Abstract: - - Color channel class definition. The color channel class is responsible for maintaining - simple single color multiple channel data intialised from color references in the XPS markup. - It provides methods for intialization, access and conversion of the data. - ---*/ - -#pragma once - -enum EColorDataType -{ - sRGB = 0, - scRGB, - nChannel -}; - -class CColorChannelData -{ -public: - CColorChannelData(); - - ~CColorChannelData(); - - template - HRESULT - AddChannelData( - _In_ CONST _T& channelValue - ); - - HRESULT - GetChannelCount( - _Out_ DWORD* pcChannels - ); - - HRESULT - GetChannelCountNoAlpha( - _Out_ DWORD* pcChannels - ); - - HRESULT - GetChannelType( - _Out_ COLORDATATYPE* pChannelType - ); - - HRESULT - ResetChannelType( - _In_ CONST COLORDATATYPE& channelType - ); - - HRESULT - GetChannelData( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ); - - HRESULT - GetChannelDataNoAlpha( - _Out_ DWORD* pcbDataSize, - _Out_ - _When_(*pcbDataSize > 0, _At_(*ppData, _Post_ _Readable_bytes_(*pcbDataSize))) - _When_(*pcbDataSize == 0, _At_(*ppData, _Post_ _Maybenull_)) - PVOID* ppData - ); - - template - HRESULT - ClampChannelValues( - _In_ CONST _T& min, - _In_ CONST _T& max - ); - - template - HRESULT - InitializeChannelData( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST _T& channelValue - ); - - HRESULT - SetColorDataType( - _In_ CONST EColorDataType& dataType - ); - - HRESULT - GetColorDataType( - _Out_ EColorDataType* pDataType - ); - - BOOL - HasAlpha( - VOID - ); - - HRESULT - InitializeAlphaChannel( - _In_ CColorChannelData* pSrcChannelData - ); - - HRESULT - GetColor( - _Out_ PCOLOR pColor, - _Out_ COLORTYPE* pType - ); - - HRESULT - SetColor( - _In_ COLOR* pColor, - _In_ CONST COLORTYPE& type - ); - -private: - HRESULT - GetChannelSizeFromType( - _In_ CONST COLORDATATYPE& channelType, - _Out_ DWORD* pcbChannelSize - ); - - template - HRESULT - ValidateDataSize( - VOID - ); - - HRESULT - AllocateChannelBuffers( - _Out_ UINT* pcbBuffer, - _Outptr_result_bytebuffer_(*pcbBuffer) _At_buffer_(*ppBuffer, _Iter_, *pcbBuffer, _Post_invalid_) - PBYTE* ppBuffer - ); - - VOID - FreeChannelBuffers( - VOID - ); - - HRESULT - GetAlphaAsFloat( - _Out_ PFLOAT pAlpha - ); - - HRESULT - ColorToByte( - _Out_writes_bytes_(cbDstData) PBYTE pDstData, - _In_ CONST UINT cbDstData - ); - - HRESULT - ColorToWord( - _Out_writes_bytes_(cbDstData) PWORD pDstData, - _In_ CONST UINT cbDstData - ); - - HRESULT - ColorFromByte( - _In_reads_bytes_(cbSrcData) PBYTE pSrcData, - _In_ CONST UINT& cbSrcData - ); - - HRESULT - ColorFromWord( - _In_reads_bytes_(cbSrcData) PWORD pSrcData, - _In_ CONST UINT& cbSrcData - ); - - HRESULT - GetAlphaChannelSize( - _Out_ DWORD* pcbAlphaChan - ); - -private: - DWORD m_cChannels; - - COLORDATATYPE m_channelType; - - PBYTE m_pChannelData; - - UINT m_cbChannelData; - - EColorDataType m_dataType; -}; - -// -// Explicitly instantiate the template functions for BYTE, WORD and FLOAT -// -template -HRESULT -CColorChannelData::AddChannelData( - _In_ CONST BYTE& channelValue - ); - -template -HRESULT -CColorChannelData::ClampChannelValues( - _In_ CONST BYTE& min, - _In_ CONST BYTE& max - ); - -template -HRESULT -CColorChannelData::InitializeChannelData( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST BYTE& channelValue - ); - -template -HRESULT -CColorChannelData::ValidateDataSize( - VOID - ); - -template -HRESULT -CColorChannelData::AddChannelData( - _In_ CONST WORD& channelValue - ); - -template -HRESULT -CColorChannelData::ClampChannelValues( - _In_ CONST WORD& min, - _In_ CONST WORD& max - ); - -template -HRESULT -CColorChannelData::InitializeChannelData( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST WORD& channelValue - ); - -template -HRESULT -CColorChannelData::ValidateDataSize( - VOID - ); - -template -HRESULT -CColorChannelData::AddChannelData( - _In_ CONST FLOAT& channelValue - ); - -template -HRESULT -CColorChannelData::ClampChannelValues( - _In_ CONST FLOAT& min, - _In_ CONST FLOAT& max - ); - -template -HRESULT -CColorChannelData::InitializeChannelData( - _In_ CONST COLORDATATYPE& channelType, - _In_ CONST EColorDataType& dataType, - _In_ CONST DWORD& cChannels, - _In_ CONST FLOAT& channelValue - ); - -template -HRESULT -CColorChannelData::ValidateDataSize( - VOID - ); - diff --git a/print/XPSDrvSmpl/src/filters/color/colconv.cpp b/print/XPSDrvSmpl/src/filters/color/colconv.cpp deleted file mode 100644 index 13804f5e..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colconv.cpp +++ /dev/null @@ -1,1138 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colconv.cpp - -Abstract: - - Color conversion manager implementation. The CColorConverter class is responsible - for coordinating the handling of the color conversion process. - - Note regarding transform caching: The color filter provides caching for the last - transform. This aids performance as quite some time can be consumed creating a - transform. The filter may however suffer if source content color profiles are rapidly - switched (e.g. alternating sRGB and scRGB mark-up). This could be mitigated by increasing - the number cached transforms beyond one. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "colconv.h" -#include "cmimg.h" -#include "dictionary.h" - -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -using XDPrintSchema::PageICMRenderingIntent::AbsoluteColorimetric; -using XDPrintSchema::PageICMRenderingIntent::RelativeColorimetric; -using XDPrintSchema::PageICMRenderingIntent::Photographs; -using XDPrintSchema::PageICMRenderingIntent::BusinessGraphics; - -COLORTYPE g_nChannelMap[] = { - COLOR_3_CHANNEL, - COLOR_CMYK, - COLOR_5_CHANNEL, - COLOR_6_CHANNEL, - COLOR_7_CHANNEL, - COLOR_8_CHANNEL -}; - -/*++ - -Routine Name: - - CColorConverter::CColorConverter - -Routine Description: - - Constructor for the base CColorConverter class. Provides common functionality - between the bitmap and color ref converter classes - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface. Used to write out resources - pFixedPage - Pointer to the FixedPage interface. Resource cache uses this when writing - pResCache - Pointer to the resource cache. - pProfManager - Pointer to a profile manager for supplying a suitable color profile - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorConverter::CColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ) : - m_pXpsConsumer(pXpsConsumer), - m_pFixedPage(pFixedPage), - m_pProfManager(pProfManager), - m_pResCache(pResCache), - m_pResDel(pResDel) -{ - HRESULT hr = S_OK; - - if (FAILED(hr = CHECK_POINTER(m_pXpsConsumer, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pProfManager, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pResCache, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pResDel, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CColorConverter::~CColorConverter - -Routine Description: - - Default destructor for the CColorConverter class - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorConverter::~CColorConverter() -{ -} - -/*++ - -Routine Name: - - CBitmapColorConverter::CBitmapColorConverter - -Routine Description: - - Constructor for the CBitmapColorConverter class - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface. Used to write out resources - pFixedPage - Pointer to the FixedPage interface. Resource cache uses this when writing - pResCache - Pointer to the resource cache. - pProfManager - Pointer to a profile manager for supplying a suitable color profile - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CBitmapColorConverter::CBitmapColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ) : - CColorConverter(pXpsConsumer, pFixedPage, pResCache, pProfManager, pResDel) -{ -} - -/*++ - -Routine Name: - - CBitmapColorConverter::~CBitmapColorConverter - -Routine Description: - - Destructor for the CBitmapColorConverter class - -Arguments: - - None - -Return Value: - - None - ---*/ -CBitmapColorConverter::~CBitmapColorConverter() -{ -} - -/*++ - -Routine Name: - - CColorConverter::ConvertBitmap - -Routine Description: - - Method which performs the color conversion process to a bitmap resource and sets - the resource URI to contain the URI of the converted bitmap resource - -Arguments: - - pbstrBmpURI - Pointer to a string containing the bitmap resource path and name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBitmapColorConverter::Convert( - _Inout_ BSTR* pbstrBmpURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrBmpURI, E_POINTER))) - { - try - { - // - // Create a color managed image object - // - CColorManagedImage bmpColManaged(*pbstrBmpURI, m_pProfManager, m_pFixedPage, m_pResDel); - - // - // Write out the cached bitmap and get a keyname for the written bitmap - // - CComBSTR bstrKey; - if (SUCCEEDED(hr = m_pResCache->WriteResource(m_pXpsConsumer, m_pFixedPage, &bmpColManaged)) && - SUCCEEDED(hr = bmpColManaged.GetKeyName(&bstrKey))) - { - hr = m_pResCache->GetURI(bstrKey, pbstrBmpURI); - - ASSERTMSG(SUCCEEDED(hr), "Failed to process image"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::CColorRefConverter - -Routine Description: - - Constructor for the base CColorRefConverter class which handles parsing and - conversion of a color string within XPS mark-up - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface. Used to write out resources - pFixedPage - Pointer to the FixedPage interface. Resource cache uses this when writing - pResCache - Pointer to the resource cache. - pProfManager - Pointer to a profile manager for supplying a suitable color profile - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorRefConverter::CColorRefConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ) : - CColorConverter(pXpsConsumer, pFixedPage, pResCache, pProfManager, pResDel) -{ -} - -/*++ - -Routine Name: - - CColorRefConverter::~CColorRefConverter - -Routine Description: - - Destructor for the CColorRefConverter class - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorRefConverter::~CColorRefConverter() -{ -} - -/*++ - -Routine Name: - - CColorRefConverter::ConvertColor - -Routine Description: - - Method which performs the color conversion process to an XPS color ref element - -Arguments: - - pbstrColorRef - Pointer to a string containing the color data to be converted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::Convert( - _Inout_ BSTR* pbstrColorRef - ) -{ - HRESULT hr = S_OK; - - BOOL bIsResourceReference = FALSE; - if (SUCCEEDED(hr = CHECK_POINTER(pbstrColorRef, E_POINTER)) && - SUCCEEDED(hr = ParseColorString(*pbstrColorRef, &m_srcData, &bIsResourceReference)) && - !bIsResourceReference) - { - // - // If the source and destination types are the same (e.g. scRGB in and scRGB out) - // we need go no further - simply return the existing string. This does not apply - // to nChannel as ContextColors specify their own profile and we cannot prove that - // this matches our output. The color space for sRGB and scRGB are implicit however. - // - EColorDataType srcType = sRGB; - EColorDataType dstType = sRGB; - if (SUCCEEDED(hr = InitDstChannels(&m_srcData, &m_dstData)) && - SUCCEEDED(hr = m_srcData.GetColorDataType(&srcType)) && - SUCCEEDED(hr = m_dstData.GetColorDataType(&dstType))) - { - if (dstType == nChannel || - dstType != srcType) - { - if (SUCCEEDED(hr = TransformColor(&m_srcData, &m_dstData))) - { - hr = CreateColorString(&m_dstData, pbstrColorRef); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::InitDstChannels - -Routine Description: - - Initialise the destination color channel data based on the destination color - profile - -Arguments: - - pChannelDataDst - Pointer to a color channel data object to be intialised - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::InitDstChannels( - _In_ CColorChannelData* pChannelDataSrc, - _Inout_ CColorChannelData* pChannelDataDst - ) -{ - HRESULT hr = S_OK; - - EProfileOption profileType = RGB; - if (SUCCEEDED(hr = CHECK_POINTER(pChannelDataSrc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pChannelDataDst, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pProfManager, E_FAIL)) && - SUCCEEDED(hr = m_pProfManager->GetDstProfileType(&profileType))) - { - // - // Initialize the channel data based on the destination color profile - // settings: - // RGB = 3 channel with no src alpha - // 4 channel with src alpha - // CMYK = 5 channel (nChannel always has an alpha channel) - // - // The color type is based off the OS. XP does not have access to WCS - // and therefore floating point formats are converted to 16 bits per channel - // - // The conversion process for downlevel handling depends on the source format. - // If we are color matching for scRGB we convert the floating point value as - // follows: - // - // 1. Truncate the input color to between -2.0 and +2.0 - // 2. Offset the value by +2.0 to put it into the 0.0 to 4.0 range - // 3. Scale the value by 4.0 to put it into the range 0.0 to 1.0 - // 4. Set the 16 bit value according to the channel value from 0x0000 - // for 0.0 to 0xFFFF for 1.0 - // 5. Call TranslateColors passing the 16 bit value - // 6. Reverse steps 1 - 4 to retrieve the floating point value - // - // If we are color matching for context colors we apply the following conversion - // - // 1. Truncate the input color to between 0.0 and +1.0 - // 2. Set the 16 bit value according to the channel value from 0x0000 - // for 0.0 to 0xFFFF for 1.0 - // 3. Call TranslateColors passing the 16 bit value - // 4. Reverse steps 1 - 2 to retrieve the floating point value - // - // Note: We do not modify the gamma during the scRGB conversion process as this will - // be applied by WCS/ICM as the gamma is encapsulated by the relevant ICC - // profile. i.e. The gamma is maintained linear as that is what the transform - // is expecting. - // - COLORDATATYPE colorDataType = COLOR_FLOAT; - EColorDataType dataType = sRGB; - - DWORD cChannels = 0; - if (profileType == RGB) - { - dataType = scRGB; - cChannels = 3; - if (pChannelDataSrc->HasAlpha()) - { - cChannels++; - } - } - else if (profileType == CMYK) - { - dataType = nChannel; - cChannels = 5; - } - else - { - RIP("Unsupported color channel format\n"); - hr = E_FAIL; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pChannelDataDst->InitializeChannelData(colorDataType, dataType, cChannels, 0.0f))) - { - hr = pChannelDataDst->InitializeAlphaChannel(pChannelDataSrc); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::GetFloatChannelData - -Routine Description: - - Method which converts a comma delimited set of floating point values - defining color channels into floating point values in a list - -Arguments: - - szColorRef - The srting containing the comma seperated color values - pChannelData - Pointer to the color channels object - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::GetFloatChannelData( - _In_ LPCWSTR szColorRef, - _Inout_ CColorChannelData* pChannelData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(szColorRef, E_POINTER)) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_FLOAT))) - { - try - { - CStringXDW cstrColorRef(szColorRef); - cstrColorRef.Trim(); - cstrColorRef.MakeLower(); - - INT cTokenIndex = 0; - INT cChars = cstrColorRef.GetLength(); - while (SUCCEEDED(hr) && - cTokenIndex < cChars && - cTokenIndex != -1) - { - CStringXDW cstrChannel(cstrColorRef.Tokenize(L",", cTokenIndex)); - hr = pChannelData->AddChannelData(static_cast(_wtof(cstrChannel))); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::SetFloatChannelData - -Routine Description: - - Method which converts channel data object into a comma delimited set of - floating point values - -Arguments: - - pChannelData - Pointer to the color channel data - pcstrChannelData - Pointer to the color string to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::SetFloatChannelData( - _In_ CColorChannelData* pChannelData, - _Inout_ CStringXDW* pcstrChannelData - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcstrChannelData, E_POINTER))) - { - try - { - // - // Over all channels, write out comma seperated float values - // - DWORD cbData = 0; - PFLOAT pData = NULL; - DWORD cChanCount = 0; - if (SUCCEEDED(hr = pChannelData->GetChannelData(&cbData, reinterpret_cast(&pData))) && - SUCCEEDED(hr = pChannelData->GetChannelCount(&cChanCount))) - { - if (cChanCount == 0) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr) && - cbData >= cChanCount * sizeof(FLOAT)) - { - CStringXDW cstrChannel; - cstrChannel.Format(L"%f", pData[0]); - pcstrChannelData->Append(cstrChannel); - for (DWORD cChan = 1; cChan < cChanCount; cChan++) - { - cstrChannel.Format(L",%f", pData[cChan]); - pcstrChannelData->Append(cstrChannel); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::ParseColorString - -Routine Description: - - Method which converts a XML formatted color string into useable color data - -Arguments: - - bstrColorRef - The color ref string to be parsed - pChannelData - Pointer to the color channel data object to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::ParseColorString( - _In_ BSTR bstrColorRef, - _Inout_ CColorChannelData* pChannelData, - _Out_ BOOL* pbIsResourceReference - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pChannelData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbIsResourceReference, E_POINTER))) - { - *pbIsResourceReference = FALSE; - - if (SysStringLen(bstrColorRef) <= 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CStringXDW cstrColRef(bstrColorRef); - cstrColRef.Trim(); - - if (0 == cstrColRef.Find(L"sc#")) - { - // - // Strip the "sc#" prefix ready to parse the floating point channels - // - cstrColRef.Delete(0, 3); - - // - // Set the src profile to xdwscRGB.icc - this is an ICC profile with - // the system wcsRGB profile embedded so should work down-level - // Set the color data type and retrieve the channel data - // - if (SUCCEEDED(hr = m_pProfManager->SetSrcProfileFromColDir(L"xdwscRGB.icc")) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_FLOAT)) && - SUCCEEDED(hr = pChannelData->SetColorDataType(scRGB))) - { - hr = GetFloatChannelData(cstrColRef, pChannelData); - } - } - else if (0 == cstrColRef.Find(L"ContextColor")) - { - // - // Context colors always have an associated profile - retrieve - // this and set it in the profile manager - // - cstrColRef.Delete(0, countof(L"ContextColor ")); - cstrColRef.Trim(); - CStringXDW cstrProfile(cstrColRef.Left(cstrColRef.Find(L" "))); - cstrColRef.Delete(0, cstrProfile.GetLength()); - - // - // Set the source profile ready to create the transform, retrieve the channel data - // and clamp between 0.0 and 1.0. - // - if (SUCCEEDED(hr = m_pProfManager->SetSrcProfileFromContainer(cstrProfile.GetBuffer())) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_FLOAT)) && - SUCCEEDED(hr = pChannelData->SetColorDataType(nChannel)) && - SUCCEEDED(hr = GetFloatChannelData(cstrColRef, pChannelData)) && - SUCCEEDED(hr = pChannelData->ClampChannelValues(0.0f, 1.0f))) - { - // - // Mark the color profile for deletion - // - (*m_pResDel)[cstrProfile] = TRUE; - } - } - else if (0 == cstrColRef.Find(L"#")) - { - // - // Delete the # symbol so we are just left with the RGB values - // - cstrColRef.Delete(0, 1); - - // - // Set the source profile to sRGB rather than assume the default is set to - // sRGB. - // - if (SUCCEEDED(hr = m_pProfManager->SetSrcProfileFromColDir(L"sRGB Color Space Profile.icm")) && - SUCCEEDED(hr = pChannelData->ResetChannelType(COLOR_BYTE)) && - SUCCEEDED(hr = pChannelData->SetColorDataType(sRGB))) - { - while (SUCCEEDED(hr) && - cstrColRef.GetLength() > 0) - { - // - // Add the channel data - // - hr = pChannelData->AddChannelData(static_cast(wcstol(cstrColRef.Left(2), NULL, 16))); - - // - // Delete the channel from the color ref string - // - cstrColRef.Delete(0, 2); - } - } - } - else if (0 == cstrColRef.Find(L"{StaticResource")) - { - *pbIsResourceReference = TRUE; - } - else - { - // - // Unrecognised type - // - RIP("Unrecognised color syntax."); - hr = E_FAIL; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::TransformColor - -Routine Description: - - Method which applies a color transform to a set of color data - -Arguments: - - pSrcData - Pointer to the source color channel data - pDstData - Pointer to the destination color channel data - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::TransformColor( - _In_ CColorChannelData* pSrcData, - _Inout_ CColorChannelData* pDstData - ) -{ - HRESULT hr = S_OK; - - HTRANSFORM hColorTrans = NULL; - - BOOL bUseWCS = FALSE; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrcData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = m_pProfManager->GetColorTransform(&hColorTrans, &bUseWCS))) - { - if (bUseWCS) - { - DWORD cSrcChan = 0; - DWORD cDstChan = 0; - - COLORDATATYPE srcDataType = COLOR_FLOAT; - COLORDATATYPE dstDataType = COLOR_FLOAT; - - DWORD cbSrcChan = 0; - DWORD cbDstChan = 0; - - PBYTE pSrcBuff = NULL; - PBYTE pDstBuff = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(hColorTrans, E_HANDLE)) && - SUCCEEDED(hr = pSrcData->GetChannelCountNoAlpha(&cSrcChan)) && - SUCCEEDED(hr = pSrcData->GetChannelType(&srcDataType)) && - SUCCEEDED(hr = pSrcData->GetChannelDataNoAlpha(&cbSrcChan, reinterpret_cast(&pSrcBuff))) && - SUCCEEDED(hr = pDstData->GetChannelCountNoAlpha(&cDstChan)) && - SUCCEEDED(hr = pDstData->GetChannelType(&dstDataType)) && - SUCCEEDED(hr = pDstData->GetChannelDataNoAlpha(&cbDstChan, reinterpret_cast(&pDstBuff)))) - { - if (cbDstChan > 0) - { - if (!WcsTranslateColorsXD(hColorTrans, - 1, - cSrcChan, - srcDataType, - cbSrcChan, - pSrcBuff, - cDstChan, - dstDataType, - cbDstChan, - pDstBuff)) - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = E_FAIL; - } - } - } - else - { - COLOR srcColor; - COLOR dstColor; - - COLORTYPE srcType; - COLORTYPE dstType; - - if (SUCCEEDED(hr = pSrcData->GetColor(&srcColor, &srcType)) && - SUCCEEDED(hr = pDstData->GetColor(&dstColor, &dstType))) - { - if (TranslateColors(hColorTrans, - &srcColor, - 1, - srcType, - &dstColor, - dstType)) - { - hr = pDstData->SetColor(&dstColor, dstType); - } - else - { - hr = GetLastErrorAsHResult(); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorRefConverter::CreateColorString - -Routine Description: - - Method which creates a XML formatted string descripting a transformed set of colors - -Arguments: - - pDstData - Pointer to destination color channel data - pbstrColorRef - Pointer to a string to contain the XML formatted color data - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorRefConverter::CreateColorString( - _In_ CColorChannelData* pDstData, - _Inout_ BSTR* pbstrColorRef - ) -{ - CComBSTR bstrTmpHolder; - - HRESULT hr = S_OK; - - EColorDataType colDataType = sRGB; - if (SUCCEEDED(hr = CHECK_POINTER(pDstData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbstrColorRef, E_POINTER)) && - SUCCEEDED(hr = pDstData->GetColorDataType(&colDataType))) - { - try - { - CStringXDW cstrChannelData; - - if (colDataType == scRGB) - { - // - // scRGB - // - cstrChannelData += L"sc#"; - hr = SetFloatChannelData(pDstData, &cstrChannelData); - } - else if (colDataType == nChannel) - { - // - // CMYK - // - cstrChannelData += L"ContextColor "; - - // - // Add the ICC profile and retrieve the URI - // - CComBSTR bstrKey; - CComBSTR bstrICCURI; - if (SUCCEEDED(hr = m_pResCache->WriteResource(m_pXpsConsumer, m_pFixedPage, m_pProfManager)) && - SUCCEEDED(hr = m_pProfManager->GetKeyName(&bstrKey)) && - SUCCEEDED(hr = m_pResCache->GetURI(bstrKey, &bstrICCURI))) - { - // - // Append the URI and a space - // - cstrChannelData += bstrICCURI; - cstrChannelData += L" "; - - hr = SetFloatChannelData(pDstData, &cstrChannelData); - } - } - else if (colDataType == sRGB) - { - // - // sRGB - // - cstrChannelData += L"#"; - - // - // Over all channels, write out hex byte values - // - DWORD cbData = 0; - PBYTE pData = NULL; - DWORD cChanCount = 0; - if (SUCCEEDED(hr = pDstData->GetChannelData(&cbData, reinterpret_cast(&pData))) && - SUCCEEDED(hr = pDstData->GetChannelCount(&cChanCount))) - { - if (cbData >= cChanCount * sizeof(BYTE)) - { - for (DWORD cChan = 0; cChan < cChanCount; cChan++) - { - _Analysis_assume_(cChan < cbData); - - CStringXDW cstrChannel; - cstrChannel.Format(L"%02x", pData[cChan]); - cstrChannelData.Append(cstrChannel); - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - } - else - { - RIP("Invalid color type\n"); - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - SysFreeString(*pbstrColorRef); - *pbstrColorRef = cstrChannelData.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CResourceDictionaryConverter::CResourceDictionaryConverter - -Routine Description: - - CResourceDictionaryConverter constructir - -Arguments: - - pXpsConsumer - Pointer to the XPS consumer interface - pFixedPage - Pointer to the fixed page interface - pResCache - Pointer to the resource cache - pProfManager - Pointer to the color profile manager - pResDel - Pointer to the list of resources to delete from the page - pBmpConv - Pointer to the bitmap conversion class - pRefConv - Pointer to the color reference conversion class - -Return Value: - - None - Throws an exception on error. - ---*/ -CResourceDictionaryConverter::CResourceDictionaryConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel, - _In_ CBitmapColorConverter* pBmpConv, - _In_ CColorRefConverter* pRefConv - ) : - CColorConverter(pXpsConsumer, pFixedPage, pResCache, pProfManager, pResDel), - m_pBmpConv(pBmpConv), - m_pRefConv(pRefConv) -{ - if (m_pBmpConv == NULL || - m_pRefConv == NULL) - { - throw CXDException(E_POINTER); - } -} - -/*++ - -Routine Name: - - CResourceDictionaryConverter::~CResourceDictionaryConverter - -Routine Description: - - CResourceDictionaryConverter destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CResourceDictionaryConverter::~CResourceDictionaryConverter() -{ -} - -/*++ - -Routine Name: - - CResourceDictionaryConverter::Convert - -Routine Description: - - Applies color conversion on a remote resource dictionary. This is achieved - by creating a color SAX parser passing a stream based off the resource - -Arguments: - - pbstrDictionaryURI - The remote dictionary URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CResourceDictionaryConverter::Convert( - _Inout_ BSTR* pbstrDictionaryURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrDictionaryURI, E_POINTER))) - { - try - { - CStringXDW cstrOriginalURI(*pbstrDictionaryURI); - - // - // Create a color managed dictionary object and pass to the cache manager - // - CRemoteDictionary newDictionary(m_pFixedPage, m_pBmpConv, m_pRefConv, *pbstrDictionaryURI); - - CComBSTR bstrKey; - if (SUCCEEDED(hr = m_pResCache->WriteResource(m_pXpsConsumer, m_pFixedPage, &newDictionary)) && - SUCCEEDED(hr = newDictionary.GetKeyName(&bstrKey)) && - SUCCEEDED(hr = m_pResCache->GetURI(bstrKey, pbstrDictionaryURI))) - { - (*m_pResDel)[cstrOriginalURI] = TRUE; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/colconv.h b/print/XPSDrvSmpl/src/filters/color/colconv.h deleted file mode 100644 index a658df7f..00000000 --- a/print/XPSDrvSmpl/src/filters/color/colconv.h +++ /dev/null @@ -1,167 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colconv.h - -Abstract: - - Color conversion class definition. The CColorConverter class is responsible - for managing the color conversion process for vector objects and bitmaps. - ---*/ - -#pragma once - -#include "colchan.h" -#include "rescache.h" -#include "profman.h" -#include "wcsapiconv.h" -#include "cmflt.h" - -class CColorConverter -{ -public: - CColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ); - - virtual ~CColorConverter(); - - virtual HRESULT - Convert( - _Inout_ BSTR* pbstr - ) = 0; - -protected: - CComPtr m_pXpsConsumer; - - CComPtr m_pFixedPage; - - CProfileManager* m_pProfManager; - - CFileResourceCache* m_pResCache; - - ResDeleteMap* m_pResDel; -}; - -class CBitmapColorConverter : public CColorConverter -{ -public: - CBitmapColorConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ); - - virtual ~CBitmapColorConverter(); - - HRESULT - Convert( - _Inout_ BSTR* pbstrBmpURI - ); -}; - -class CColorRefConverter : public CColorConverter -{ -public: - CColorRefConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel - ); - - virtual ~CColorRefConverter(); - - HRESULT - Convert( - _Inout_ BSTR* pbstrColorRef - ); - -private: - HRESULT - InitDstChannels( - _In_ CColorChannelData* pChannelDataSrc, - _Inout_ CColorChannelData* pChannelDataDst - ); - - HRESULT - GetFloatChannelData( - _In_ LPCWSTR szColorRef, - _Inout_ CColorChannelData* pChannelData - ); - - HRESULT - SetFloatChannelData( - _In_ CColorChannelData* pChannelData, - _Inout_ CStringXDW* pcstrChannelData - ); - - HRESULT - ParseColorString( - _In_ BSTR bstrColorRef, - _Inout_ CColorChannelData* pChannelData, - _Out_ BOOL* pbIsResourceReference - ); - - HRESULT - TransformColor( - _In_ CColorChannelData* pSrcData, - _Inout_ CColorChannelData* pDstData - ); - - HRESULT - CreateColorString( - _In_ CColorChannelData* pDstData, - _Inout_ BSTR* pbstrColorRef - ); - -private: - CColorChannelData m_srcData; - - CColorChannelData m_dstData; -}; - -class CResourceDictionaryConverter : public CColorConverter -{ -public: - CResourceDictionaryConverter( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache, - _In_ CProfileManager* pProfManager, - _In_ ResDeleteMap* pResDel, - _In_ CBitmapColorConverter* pBmpConv, - _In_ CColorRefConverter* pRefConv - ); - - virtual ~CResourceDictionaryConverter(); - - HRESULT - Convert( - _Inout_ BSTR* pbstrDictionaryURI - ); - -private: - CBitmapColorConverter* m_pBmpConv; - - CColorRefConverter* m_pRefConv; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/dictionary.cpp b/print/XPSDrvSmpl/src/filters/color/dictionary.cpp deleted file mode 100644 index efd15760..00000000 --- a/print/XPSDrvSmpl/src/filters/color/dictionary.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dict.cpp - -Abstract: - - Dictionary class implementation. The CRemoteDictionary class is responsible - for representing a single dictionay including managing any color - transforms in that dictionary and writing the dictionary out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "dictionary.h" -#include "cmsax.h" - -/*++ - -Routine Name: - - CRemoteDictionary::CRemoteDictionary - -Routine Description: - - Constructor for the CRemoteDictionary class which registers the URI to the resource - being represented and pointers to suitable color transformation objects - for use with color elements within that resource - -Arguments: - - bstrResURI - String containing the URI to the resource to be handled - pBmpConverter - Pointer to a bitmap color conversion object - pRefConverter - Pointer to a vector color conversion object - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CRemoteDictionary::CRemoteDictionary( - _In_ IFixedPage* pFixedPage, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_ BSTR bstrResURI - ) : - m_pFixedPage(pFixedPage), - m_pBmpConverter(pBmpConverter), - m_pRefConverter(pRefConverter), - m_bstrDictionaryURI(bstrResURI) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pRefConverter, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pBmpConverter, E_POINTER))) - { - if (m_bstrDictionaryURI.Length() == 0) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CRemoteDictionary::~CRemoteDictionary - -Routine Description: - - Destructor for the CRemoteDictionary class - -Arguments: - - None - -Return Value: - - None - ---*/ -CRemoteDictionary::~CRemoteDictionary() -{ -} - -/*++ - -Routine Name: - - CRemoteDictionary::WriteData - -Routine Description: - - This method handles the parsing of a new dictionary and - the writing out the new dictionary - -Arguments: - - pWriter - Pointer to a stream to write the resource out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRemoteDictionary::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - try - { - CComPtr pRead(NULL); - CComPtr pResDictPart(NULL); - CComPtr pReader(NULL); - - if (SUCCEEDED(hr = m_pFixedPage->GetPagePart(m_bstrDictionaryURI, &pRead)) && - SUCCEEDED(hr = pRead->QueryInterface(&pResDictPart)) && - SUCCEEDED(hr = pResDictPart->GetStream(&pReader))) - { - // - // Create a SAX handler to parse the markup in the fixed page - // - CCMSaxHandler cmSaxHndlr(pWriter, m_pBmpConverter, m_pRefConverter, NULL); - - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr pSaxRdr(NULL); - - if (SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&cmSaxHndlr))) - { - CComPtr pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast(pReadStreamToSeq))); - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CRemoteDictionary::GetKeyName - -Routine Description: - - Method to obtain a unique key for the resource being handled - -Arguments: - - pbstrKeyName - Pointer to a string to hold the generated key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRemoteDictionary::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - if (m_bstrDictionaryURI.Length() > 0) - { - *pbstrKeyName = NULL; - - // - // The full URI to the resource is a suitable key - // - if (SUCCEEDED(hr = m_bstrDictionaryURI.CopyTo(pbstrKeyName)) && - !*pbstrKeyName) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRemoteDictionary::GetResURI - -Routine Description: - - Method to obtain the URI of the resource being handled - -Arguments: - - pbstrResURI - Pointer to a string to hold the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRemoteDictionary::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - try - { - // - // Create a unique name for the dictionary for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"%s_%u.dict", static_cast(m_bstrDictionaryURI), GetUniqueNumber()); - - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/dictionary.h b/print/XPSDrvSmpl/src/filters/color/dictionary.h deleted file mode 100644 index 42e4e974..00000000 --- a/print/XPSDrvSmpl/src/filters/color/dictionary.h +++ /dev/null @@ -1,65 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dict.h - -Abstract: - - Dictionary class definition. The CRemoteDictionary class is responsible - for representing a single dictionay including managing any color - transforms in that dictionary and writing the dictionary out. - ---*/ - -#pragma once - -#include "colconv.h" - -class CRemoteDictionary : public IResWriter -{ -public: - CRemoteDictionary( - _In_ IFixedPage* pFixedPage, - _In_ CBitmapColorConverter* pBmpConverter, - _In_ CColorRefConverter* pRefConverter, - _In_ BSTR bstrResURI - ); - - ~CRemoteDictionary(); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - CComBSTR m_bstrDictionaryURI; - - CBitmapColorConverter* m_pBmpConverter; - - CColorRefConverter* m_pRefConverter; - - CComPtr m_pFixedPage; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/dllentry.cpp b/print/XPSDrvSmpl/src/filters/color/dllentry.cpp deleted file mode 100644 index fff45c12..00000000 --- a/print/XPSDrvSmpl/src/filters/color/dllentry.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the color management filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "clasfact.h" -#include "cmflt.h" -#include "xdexcept.h" -#include "xdstring.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the color management filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 21934A6D-EA30-480a-8DAD-C8045807F737 - // - CLSID colorCLSID = {0x21934A6D, 0xEA30, 0x480a, {0x8D, 0xAD, 0xC8, 0x04, 0x58, 0x07, 0xF7, 0x37}}; - - return GetFilterClassFactory(rclsid, riid, colorCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/color/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/color/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/color/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/color/profile.cpp b/print/XPSDrvSmpl/src/filters/color/profile.cpp deleted file mode 100644 index e3a8368c..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profile.cpp +++ /dev/null @@ -1,709 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - profile.cpp - -Abstract: - - Profile class implementation. The profile class is responsible for loading and maintaining - colo profile resources. The class provides methods for loading profiles from filename or - URI and is responsible for limited caching based off the file name and the (WCS)OpenProfile - options. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "profile.h" -#include "wcsapiconv.h" - -DWORD g_tagWCSProfile = 'MS00'; - -/*++ - -Routine Name: - - CProfile::CProfile - -Routine Description: - - CProfile constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CProfile::CProfile() : - m_hProfile(NULL), - m_dwDesiredAccess(PROFILE_READ), - m_dwShareMode(FILE_SHARE_READ), - m_dwCreationMode(OPEN_EXISTING), - m_dwWCSFlags(0) -{ -} - -/*++ - -Routine Name: - - CProfile::~CProfile - -Routine Description: - - CProfile destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CProfile::~CProfile() -{ - FreeProfile(); -} - -/*++ - -Routine Name: - - CProfile::SetProfile - -Routine Description: - - Sets the current profile from the fixed page using the specified resoure URI - -Arguments: - - pFP - Pointer to the fixed page interface - szURI - URI to the ICC profile to load - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::SetProfile( - _In_ IFixedPage* pFP, - _In_ LPCWSTR szURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(szURI, E_POINTER))) - { - try - { - CStringXDW cstrKey; - - if (SUCCEEDED(hr = CreateProfileKey(szURI, NULL, NULL, &cstrKey)) && - (m_hProfile == NULL || - m_cstrProfileKey != cstrKey)) - { - FreeProfile(); - - // - // Get the read stream for the URI - // - CComPtr pPart(NULL); - CComPtr pProfilePart(NULL); - CComPtr pRead(NULL); - CComBSTR bstrProfileURI(szURI); - - ULONGLONG cbEnd = 0; - - // - // Get the profile part and a read stream. Seek to the end to find the - // size of the profile data - // - if (SUCCEEDED(hr = pFP->GetPagePart(bstrProfileURI, &pPart)) && - SUCCEEDED(hr = pPart.QueryInterface(&pProfilePart)) && - SUCCEEDED(hr = pProfilePart->GetStream(&pRead)) && - SUCCEEDED(hr = pRead->Seek(0, STREAM_SEEK_END, &cbEnd))) - { - // - // Allocate the buffer and copy - // - UINT cbProfileData = static_cast(cbEnd); - PBYTE pProfileData = new(std::nothrow) BYTE[cbProfileData]; - - ULONG cbRead; - BOOL bEOF = FALSE; - if (SUCCEEDED(hr = CHECK_POINTER(pProfileData, E_OUTOFMEMORY)) && - SUCCEEDED(hr = pRead->Seek(0, STREAM_SEEK_SET, &cbEnd)) && - SUCCEEDED(hr = pRead->ReadBytes(pProfileData, cbProfileData, &cbRead, &bEOF))) - { - if (cbProfileData != cbRead) - { - RIP("Failed to read all profile data\n"); - - hr = E_FAIL; - } - } - - // - // Create the transform from the buffer - // - if (SUCCEEDED(hr)) - { - PROFILE profile = { - PROFILE_MEMBUFFER, - pProfileData, - cbProfileData - }; - - if (SUCCEEDED(hr = OpenProfile(&profile, &m_hProfile))) - { - m_cstrProfileKey = cstrKey; - } - } - - if (pProfileData != NULL) - { - delete[] pProfileData; - pProfileData = NULL; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::SetProfile - -Routine Description: - - Sets a profile from the specified file name - -Arguments: - - szFileName - File name of the profile to open - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::SetProfile( - _In_ LPCWSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - CStringXDW cstrKey; - - if (SUCCEEDED(hr = CreateProfileKey(szFileName, NULL, NULL, &cstrKey)) && - (m_hProfile == NULL || - m_cstrProfileKey != cstrKey)) - { - FreeProfile(); - - CStringXDW profileFileName(szFileName); - PROFILE profile = { - PROFILE_FILENAME, - profileFileName.GetBuffer(), - profileFileName.GetLength() * sizeof(WCHAR) - }; - - if (SUCCEEDED(hr = OpenProfile(&profile, &m_hProfile))) - { - m_cstrProfileKey = cstrKey; - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::SetProfile - -Routine Description: - - Sets a color profile from memory - -Arguments: - - szProfile - Name of the profile. This is used for caching puproses - pBuffer - Buffer containing the profile data - cbBuffer - Size of the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::SetProfile( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_POINTER))) - { - try - { - CStringXDW cstrKey; - - if (SUCCEEDED(hr = CreateProfileKey(szProfile, NULL, NULL, &cstrKey)) && - (m_hProfile == NULL || - m_cstrProfileKey != cstrKey)) - { - FreeProfile(); - - PROFILE profile = { - PROFILE_MEMBUFFER, - pBuffer, - cbBuffer - }; - - if (SUCCEEDED(hr = OpenProfile(&profile, &m_hProfile))) - { - m_cstrProfileKey = cstrKey; - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::GetProfileHandle - -Routine Description: - - Retrieves the current profile handle - -Arguments: - - phProfile - Pointer to a HPROFILE that accepts the current profile handle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::GetProfileHandle( - _Out_ HPROFILE* phProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(phProfile, E_POINTER))) - { - *phProfile = NULL; - if (SUCCEEDED(hr = CHECK_HANDLE(m_hProfile, E_PENDING))) - { - *phProfile = m_hProfile; - } - } - - ERR_ON_HR_EXC(hr, E_PENDING); - return hr; -} - -/*++ - -Routine Name: - - CProfile::IsWCSCompatible - -Routine Description: - - Checks if the current profile is suitable for use with WCS - -Arguments: - - pbWCSCompat - Pointer to BOOL the accepts the result - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::IsWCSCompatible( - _Out_ BOOL* pbWCSCompat - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbWCSCompat, E_POINTER)) && - SUCCEEDED(hr = CHECK_HANDLE(m_hProfile, E_PENDING))) - { - // - // Assume true as the GetColorProfileHeader documentation states: "This function - // does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP.", therefore - // if the profile is loaded and it is not ICC (i.e. no header) it should be WCS compatible - // - *pbWCSCompat = TRUE; - - PROFILEHEADER profileHeader = {0}; - if (GetColorProfileHeader(m_hProfile, &profileHeader)) - { - if (profileHeader.phClass == CLASS_LINK || - profileHeader.phClass == CLASS_NAMED) - { - *pbWCSCompat = FALSE; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CProfile::GetProfileKey - -Routine Description: - - Retrieves a key identifying the current profile. This is composed of the profile name - and the options used to create the profile - -Arguments: - - pcstrProfileKey - Pointer to a CStringXDW object that recieves the key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::GetProfileKey( - _Out_ CStringXDW* pcstrProfileKey - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrProfileKey, E_POINTER))) - { - try - { - *pcstrProfileKey = m_cstrProfileKey; - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::operator== - -Routine Description: - - CProfile equality operator - -Arguments: - - cstrProfileKey - the key to compare against - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -BOOL -CProfile::operator==( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST -{ - BOOL bEqual = TRUE; - - try - { - if (m_cstrProfileKey != cstrProfileKey) - { - bEqual = FALSE; - } - } - catch (CXDException&) - { - bEqual = FALSE; - } - - return bEqual; -} - -/*++ - -Routine Name: - - CProfile::operator!= - -Routine Description: - - CProfile inequality operator - -Arguments: - - cstrProfileKey - profile key to compare against - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -BOOL -CProfile::operator!=( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST -{ - return !operator==(cstrProfileKey); -} - -/*++ - -Routine Name: - - CProfile::FreeProfile - -Routine Description: - - Frees the current profile - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CProfile::FreeProfile( - VOID - ) -{ - try - { - m_cstrProfileKey.Empty(); - } - catch (CXDException&) - { - } - - if (m_hProfile != NULL) - { - CloseColorProfile(m_hProfile); - m_hProfile = NULL; - } -} - -/*++ - -Routine Name: - - CProfile::OpenProfile - -Routine Description: - - Opens the current profile based off the current OS. Vista uses WCSOpenProfile while - earlier Windows use OpenProfile - -Arguments: - - pProfile - Pointer to the profile structure used to open the profile - phProfile - Pointer to a HPROFILE to recieve the opened profile handle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::OpenProfile( - _In_ PROFILE* pProfile, - _Out_ HPROFILE* phProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(phProfile, E_POINTER))) - { - // - // Get a handle to the color profile using WCS in Vista or the XP API in earlier operating systems - // - if (IsVista()) - { - *phProfile = WcsOpenColorProfileXD(pProfile, NULL, NULL, m_dwDesiredAccess, m_dwShareMode, m_dwCreationMode, m_dwWCSFlags); - } - else - { - *phProfile = OpenColorProfile(pProfile, m_dwDesiredAccess, m_dwShareMode, m_dwCreationMode); - } - - if (FAILED(CHECK_POINTER(*phProfile, E_POINTER))) - { - hr = GetLastErrorAsHResult(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfile::CreateProfileKey - -Routine Description: - - Creates a profile key based on the possible profile names used to construct the - profile and the settings used to open the profile - -Arguments: - - - pszCDMP - Device model profile name - pszCAMP - Color adjustment model profile name - pszGMMP - Gamut model profile name - pcstrKey - Pointer to a CStringXDW that recieves the key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfile::CreateProfileKey( - _In_ LPCWSTR pszCDMP, - _In_opt_ LPCWSTR pszCAMP, - _In_opt_ LPCWSTR pszGMMP, - _Out_ CStringXDW* pcstrKey - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszCDMP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcstrKey, E_POINTER))) - { - try - { - pcstrKey->Empty(); - pcstrKey->Append(pszCDMP); - - if (pszCAMP != NULL) - { - pcstrKey->Append(pszCAMP); - } - - if (pszGMMP != NULL) - { - pcstrKey->Append(pszGMMP); - } - - CStringXDW cstrOpenOptions; - cstrOpenOptions.Format(L"%x%x%x%x", m_dwDesiredAccess, m_dwShareMode, m_dwCreationMode, m_dwWCSFlags); - - pcstrKey->Append(cstrOpenOptions); - pcstrKey->MakeLower(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/profile.h b/print/XPSDrvSmpl/src/filters/color/profile.h deleted file mode 100644 index 46fa46fa..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profile.h +++ /dev/null @@ -1,124 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - profile.h - -Abstract: - - Profile class definition. The profile class is responsible for loading and maintaining - colo profile resources. The class provides methods for loading profiles from filename or - URI and is responsible for limited caching based off the file name and the (WCS)OpenProfile - options. - ---*/ - -#pragma once - -class CProfile -{ -public: - CProfile(); - - ~CProfile(); - - HRESULT - SetProfile( - _In_ IFixedPage* pFP, - _In_ LPCWSTR szURI - ); - - HRESULT - SetProfile( - _In_ LPCWSTR szURI - ); - - HRESULT - SetProfile( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ); - - HRESULT - GetProfileHandle( - _Out_ HPROFILE* phProfile - ); - - HRESULT - IsWCSCompatible( - _Out_ BOOL* pbWCSCompat - ); - - HRESULT - GetProfileKey( - _Out_ CStringXDW* pcstrProfileURI - ); - - BOOL - operator==( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST; - - BOOL - operator!=( - _In_ CONST CStringXDW& cstrProfileKey - ) CONST; - -private: - HRESULT - CreateProfileBuffer( - VOID - ); - - VOID - FreeProfile( - VOID - ); - - HRESULT - OpenProfile( - _In_ PROFILE* pProfile, - _Out_ HPROFILE* phProfile - ); - - HRESULT - CreateProfileKey( - _In_ LPCWSTR pszCDMP, - _In_opt_ LPCWSTR pszCAMP, - _In_opt_ LPCWSTR pszGMMP, - _Out_ CStringXDW* pcstrKey - ); - -private: - HPROFILE m_hProfile; - - DWORD m_dwDesiredAccess; - - DWORD m_dwShareMode; - - DWORD m_dwCreationMode; - - DWORD m_dwWCSFlags; - - // - // We define a key for a profile as the URI(s) plus any options used when - // creating the profile. This allows anything that uses this profile in - // combination with other profiles to identify the constituents of the - // transform and hence cache that transform without needing to store the - // profile handles. - // - // Note: Do not cache against the handle as handles can be re-used - // - CStringXDW m_cstrProfileKey; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/profman.cpp b/print/XPSDrvSmpl/src/filters/color/profman.cpp deleted file mode 100644 index 16ee9dc2..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profman.cpp +++ /dev/null @@ -1,818 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - profman.cpp - -Abstract: - - Color profile class implementation. The CProfileManager class represents - a color profile and provides a transform from the system default profile - to the supplied profile. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "profman.h" - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -using XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData; -using XDPrintSchema::PageICMRenderingIntent::AbsoluteColorimetric; -using XDPrintSchema::PageICMRenderingIntent::RelativeColorimetric; -using XDPrintSchema::PageICMRenderingIntent::Photographs; -using XDPrintSchema::PageICMRenderingIntent::BusinessGraphics; - - -/*++ - -Routine Name: - - CProfileManager::CProfileManager - -Routine Description: - - Constructor for the CProfileManager class which records internally the device name, - color profile structure, color intents data and initialises the CProfileManager - ready to supply suitable color transforms - -Arguments: - - pszDeviceName - Pointer to a string containing the device name - cmProfData - Structure containing color profile settings from the PrintTicket - cmIntData - Structure containing color intents settings from the PrintTicket - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CProfileManager::CProfileManager( - _In_ LPCWSTR pszDeviceName, - _In_ PageSourceColorProfileData cmProfData, - _In_ PageICMRenderingIntentData cmIntData, - _In_ IFixedPage* pFP - ) : - m_strDeviceName(pszDeviceName), - m_cmProfData(cmProfData), - m_cmIntData(cmIntData), - m_pFixedPage(pFP) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszDeviceName, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(m_pFixedPage, E_POINTER))) - { - if(m_strDeviceName.GetLength() <= 0) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(E_INVALIDARG); - } -} - -/*++ - -Routine Name: - - CProfileManager::~CProfileManager - -Routine Description: - - Default destructor for the CProfileManager class which performs and clean up - -Arguments: - - None - -Return Value: - - None - ---*/ -CProfileManager::~CProfileManager() -{ -} - -/*++ - -Routine Name: - - CProfileManager::GetColorTransform - -Routine Description: - - Method which supplies a color transform based on the settings in the PrintTicket - -Arguments: - - phColorTrans - Pointer to a color transform handle which will contain - a transform based off the settings in the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetColorTransform( - _Out_ HTRANSFORM* phColorTrans, - _Out_ BOOL* pbUseWCS - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbUseWCS, E_POINTER)) && - SUCCEEDED(hr = CHECK_HANDLE(phColorTrans, E_POINTER)) && - SUCCEEDED(hr = m_dstProfile.SetProfile(m_cmProfData.cmProfileName))) - { - *pbUseWCS = IsVista(); - - try - { - // - // Construct and populate a profile list for the transform object - // - ProfileList profileList; - - // - // Check the source profile has been set. GetProfileHandle will return an error - // if it has not been. - // - HPROFILE hProfile = NULL; - if (SUCCEEDED(hr = m_srcProfile.GetProfileHandle(&hProfile))) - { - profileList.push_back(&m_srcProfile); - profileList.push_back(&m_dstProfile); - - // - // Map the PrintTicket intents option to the ICM option - // - DWORD intents = INTENT_ABSOLUTE_COLORIMETRIC; - switch (m_cmIntData.cmOption) - { - case AbsoluteColorimetric: - { - intents = INTENT_ABSOLUTE_COLORIMETRIC; - } - break; - - case RelativeColorimetric: - { - intents = INTENT_RELATIVE_COLORIMETRIC; - } - break; - - case Photographs: - { - intents = INTENT_PERCEPTUAL; - } - break; - - case BusinessGraphics: - default: - { - intents = INTENT_SATURATION; - } - break; - } - - DWORD flRender = BEST_MODE; - - // - // Check if the source and destination profiles are compatible with WCS - // - if (*pbUseWCS && - SUCCEEDED(hr = m_srcProfile.IsWCSCompatible(pbUseWCS))) - { - if (*pbUseWCS) - { - hr = m_dstProfile.IsWCSCompatible(pbUseWCS); - } - } - - if (SUCCEEDED(hr) && - *pbUseWCS) - { - // - // Everything is in place for using WCS - // - flRender |= WCS_ALWAYS; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_colorTrans.CreateTransform(&profileList, intents, flRender))) - { - hr = m_colorTrans.GetTransformHandle(phColorTrans); - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetDstProfileType - -Routine Description: - - Method to return the color profile type as read from the PrintTicket - -Arguments: - - pType - Pointer to the profile type to be filled in - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetDstProfileType( - _Out_ EProfileOption* pType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pType, E_POINTER))) - { - *pType = m_cmProfData.cmProfile; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetDstProfileName - -Routine Description: - - Method which returns the systems default colour profile name - -Arguments: - - pbstrProfileName - Pointer to string to hold the profile name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetDstProfileName( - _Inout_ BSTR* pbstrProfileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrProfileName, E_POINTER))) - { - try - { - CStringXDW cstrURI; - - if (m_cmProfData.cmProfile == RGB || - m_cmProfData.cmProfile == CMYK) - { - if (SUCCEEDED(hr = GetColDir(&cstrURI))) - { - cstrURI += L"\\"; - cstrURI += m_cmProfData.cmProfileName; - } - } - else - { - hr = E_NOTIMPL; - } - SysFreeString(*pbstrProfileName); - *pbstrProfileName = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetSrcProfileFromContainer - -Routine Description: - - Method which sets the source colour profile from a profile within the - XPS container - -Arguments: - - pszProfileURI - Pointer to string holding the profile URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetSrcProfileFromContainer( - _In_ LPWSTR szProfileURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfileURI, E_POINTER))) - { - hr = m_srcProfile.SetProfile(m_pFixedPage, szProfileURI); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetSrcProfileFromColDir - -Routine Description: - - Method which sets the source colour profile from the color directory - -Arguments: - - pszProfile - Pointer to string holding the profile name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetSrcProfileFromColDir( - _In_ LPWSTR szProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER))) - { - hr = SetProfileFromColDir(&m_srcProfile, szProfile); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetSrcProfileFromBuffer - -Routine Description: - - Method which sets the source colour profile from a buffer - -Arguments: - - pszProfile - Pointer to string holding the profile name - pBuffer - Pointer to buffer holding the profile data - cbBuffer - Count of bytes in the profile buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetSrcProfileFromBuffer( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_POINTER))) - { - hr = m_srcProfile.SetProfile(szProfile, pBuffer, cbBuffer); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetProfileOption - -Routine Description: - - This method retrieves the profile option set in the PrintTicket - -Arguments: - - pProfileOption - Pointer to a profile option enumeration type to recieve the option - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetProfileOption( - _Out_ EProfileOption* pProfileOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfileOption, E_POINTER))) - { - *pProfileOption = m_cmProfData.cmProfile; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::WriteData - -Routine Description: - - This method handles writing the destination profile to the container - -Arguments: - - pStream - Pointer to a stream to write the resource out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - HANDLE hFile = INVALID_HANDLE_VALUE; - - // - // Open the destination profile file from disk. We could use the - // handle however we do not know whether we will get the ICC or DMP. - // - CComBSTR bstrProfile; - if (SUCCEEDED(hr = GetDstProfileName(&bstrProfile))) - { - hFile = CreateFile(bstrProfile, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - hr = GetLastErrorAsHResult(); - } - } - - if (SUCCEEDED(hr)) - { - // - // Write profile data to stream - // - PBYTE pBuff = new(std::nothrow) BYTE[CB_COPY_BUFFER]; - hr = CHECK_POINTER(pBuff, E_OUTOFMEMORY); - - DWORD cbRead = 0; - - while (SUCCEEDED(hr)) - { - if (ReadFile(hFile, pBuff, CB_COPY_BUFFER, &cbRead, NULL)) - { - if (cbRead > 0) - { - ULONG cbWritten = 0; - hr = pStream->WriteBytes(reinterpret_cast(pBuff), cbRead, &cbWritten); - - if (cbRead != cbWritten) - { - RIP("Failed to write all profile data.\n"); - - hr = E_FAIL; - } - } - else - { - break; - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - delete[] pBuff; - pBuff = NULL; - } - - if (hFile != INVALID_HANDLE_VALUE) - { - CloseHandle(hFile); - hFile = INVALID_HANDLE_VALUE; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetKeyName - -Routine Description: - - Method to obtain a unique key for the resource being handled - -Arguments: - - pbstrKeyName - Pointer to a string to hold the generated key - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetKeyName( - _Inout_ _At_(*pbstrKeyName, _Pre_maybenull_ _Post_valid_) BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - SysFreeString(*pbstrKeyName); - - if (SUCCEEDED(hr = m_cmProfData.cmProfileName.CopyTo(pbstrKeyName)) && - !*pbstrKeyName) - { - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetResURI - -Routine Description: - - Method to obtain the URI of the resource being handled - -Arguments: - - pbstrResURI - Pointer to a string to hold the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - try - { - CStringXDW cstrFileName(m_cmProfData.cmProfileName); - CStringXDW cstrFileExt(PathFindExtension(cstrFileName)); - - INT indFileExt = cstrFileName.Find(cstrFileExt); - - if (indFileExt > -1) - { - cstrFileName.Delete(indFileExt, cstrFileExt.GetLength()); - } - - // - // Create a unique name for the profile for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"/%s_%u%s", static_cast(cstrFileName), GetUniqueNumber(), static_cast(cstrFileExt)); - - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::SetProfileFromColDir - -Routine Description: - - Set the named profile from the color directory. The method appends the specified - file name to the color directory path and instructs the profile class to open the - profile - -Arguments: - - pProfile - Pointer to the profile class that actually opens the profile - szProfile - The profile file name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::SetProfileFromColDir( - _In_ CProfile* pProfile, - _In_ LPWSTR szProfile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfile, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(szProfile, E_POINTER))) - { - try - { - CStringXDW cstrProfile; - - if (SUCCEEDED(hr = GetColDir(&cstrProfile))) - { - cstrProfile += L"\\"; - cstrProfile += szProfile; - - hr = pProfile->SetProfile(cstrProfile.GetBuffer()); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CProfileManager::GetColDir - -Routine Description: - - Retrieves the color directory path - -Arguments: - - pcstrColDir - Pointer to a string class that accepts the color directory path - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CProfileManager::GetColDir( - _Out_ CStringXDW* pcstrColDir - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrColDir, E_POINTER))) - { - try - { - pcstrColDir->Empty(); - DWORD cbColDir = 0; - if (!GetColorDirectory(NULL, NULL, &cbColDir)) - { - pcstrColDir->Preallocate(cbColDir/sizeof(WCHAR)); - if (!GetColorDirectory(NULL, pcstrColDir->GetBuffer(), &cbColDir)) - { - hr = GetLastErrorAsHResult(); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/profman.h b/print/XPSDrvSmpl/src/filters/color/profman.h deleted file mode 100644 index 4246a0c2..00000000 --- a/print/XPSDrvSmpl/src/filters/color/profman.h +++ /dev/null @@ -1,126 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - profman.h - -Abstract: - - Color profile manager definition. The CProfileManager class is responsible - for managing the color profile set in the driver. - ---*/ - -#pragma once - -#include "cmprofiledata.h" -#include "cmintentsdata.h" -#include "rescache.h" -#include "transform.h" - -class CProfileManager : public IResWriter -{ -public: - CProfileManager( - _In_ LPCWSTR pszDeviceName, - _In_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData cmProfData, - _In_ XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData cmIntData, - _In_ IFixedPage* pFP - ); - - virtual ~CProfileManager(); - - HRESULT - GetColorTransform( - _Out_ HTRANSFORM* phColorTrans, - _Out_ BOOL* pbUseWCS - ); - - HRESULT - GetDstProfileType( - _Out_ XDPrintSchema::PageSourceColorProfile::EProfileOption* pType - ); - - HRESULT - GetDstProfileName( - _Inout_ BSTR* pbstrProfileName - ); - - HRESULT - SetSrcProfileFromContainer( - _In_ LPWSTR szProfileURI - ); - - HRESULT - SetSrcProfileFromColDir( - _In_ LPWSTR szProfile - ); - - HRESULT - SetSrcProfileFromBuffer( - _In_ LPWSTR szProfile, - _In_reads_bytes_(cbBuffer) PBYTE pBuffer, - _In_ UINT cbBuffer - ); - - HRESULT - GetProfileOption( - _Out_ XDPrintSchema::PageSourceColorProfile::EProfileOption* pProfileOption - ); - - // - // IResWriter interface - // - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Inout_ _At_(*pbstrKeyName, _Pre_maybenull_ _Post_valid_) BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - HRESULT - SetProfileFromColDir( - _In_ CProfile* pProfile, - _In_ LPWSTR szProfile - ); - - HRESULT - GetColDir( - _Out_ CStringXDW* pcstrColDir - ); - -private: - CStringXDW m_strDeviceName; - - XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData m_cmProfData; - - XDPrintSchema::PageICMRenderingIntent::PageICMRenderingIntentData m_cmIntData; - - CProfile m_srcProfile; - - CProfile m_dstProfile; - - CTransform m_colorTrans; - - CComPtr m_pFixedPage; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/scaniter.cpp b/print/XPSDrvSmpl/src/filters/color/scaniter.cpp deleted file mode 100644 index 541554ab..00000000 --- a/print/XPSDrvSmpl/src/filters/color/scaniter.cpp +++ /dev/null @@ -1,604 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - scaniter.cpp - -Abstract: - - CScanIterator class implementation. The scan iterator class provides a convenient - interface for iterating over WIC data and retrieving scanline data approriate for - consumption in WCS/ICM. For example, the WIC pixel formats do not have alpha channel - positions that correspond with the WCS/ICM BMFORMAT types so this class is responsible - for presenting bitmap data without the alpha channel and for copying alpha data from - source to destination when scnaline changes are commited to the underlying WIC bitmap. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "xdexcept.h" -#include "globals.h" -#include "scaniter.h" - -/*++ - -Routine Name: - - CScanIterator::CScanIterator - -Routine Description: - - CScanIterator constructor - -Arguments: - - - bmpConv - Bitmap converter class encapsulating the underlying WIC bitmap - pRect - The rectangular area of the bitmap over which we want to iterate scanlines - -Return Value: - - None - Throws an exception on error. - ---*/ -CScanIterator::CScanIterator( - _In_ CONST CBmpConverter& bmpConv, - _In_opt_ WICRect* pRect - ) : - CBmpConverter(bmpConv), - m_bSrcLine(TRUE), - m_cbWICStride(0), - m_cWICWidth(0), - m_cWICHeight(0), - m_cbWICData(0), - m_pbWICData(NULL) -{ - HRESULT hr = S_OK; - - UINT cWidth = 0; - UINT cHeight = 0; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pBitmap, E_POINTER)) && - SUCCEEDED(hr = m_pBitmap->GetSize(&cWidth, &cHeight))) - { - if (pRect == NULL) - { - // - // We want to iterate over the entire surface - // - m_rectTotal.X = 0; - m_rectTotal.Y = 0; - m_rectTotal.Width = static_cast(cWidth); - m_rectTotal.Height = static_cast(cHeight); - } - else - { - if (pRect->X >= 0 && - pRect->Y >= 0 && - pRect->Width <= static_cast(cWidth) && - pRect->Height <= static_cast(cHeight)) - { - m_rectTotal = *pRect; - } - else - { - hr = E_INVALIDARG; - } - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CScanIterator::~CScanIterator - -Routine Description: - - CScanIterator destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CScanIterator::~CScanIterator() -{ - UnlockSurface(); -} - -/*++ - -Routine Name: - - CScanIterator::Initialize - -Routine Description: - - Initialize the iterator. Here we are going to: - - 1. Convert to a suitable WIC format for processing - 2. Allocate an intermediate color buffer (if required) for processing - 3. Allocate an intermediate alpha buffer (if required) for processing - 4. Reset and lock the iterator rect ready for processing - -Arguments: - - bSrcLine - true if this is a source scanline (i.e. read only) - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::Initialize( - _In_ CONST BOOL& bSrcLine - ) -{ - HRESULT hr = S_OK; - m_bSrcLine = bSrcLine; - - // - // Look up the pixel format to convert to so that the bitmap is appropriate - // for consumption by WCS/ICM. - // - // Note: we are not dealing with the limitations of ICM downlevel. Downlevel - // we need to convert floating and fixed point values to values appropriate - // to ICM then back again before writing out so the underlying bitmap type is - // unmodified. - // - EWICPixelFormat eConversionFormat = kWICPixelFormatDontCare; - if (m_ePixelFormat > 0 && - m_ePixelFormat < kWICPixelFormatMax) - { - eConversionFormat = g_lutWICToBMFormat[m_ePixelFormat].m_pixFormTarget; - } - else - { - RIP("Unrecognised pixel format.\n"); - hr = E_FAIL; - } - - // - // Apply the conversion if required - // - BOOL bCanConvert = FALSE; - if (eConversionFormat != m_ePixelFormat && - SUCCEEDED(hr) && - SUCCEEDED(hr = Convert(eConversionFormat, &bCanConvert))) - { - if (!bCanConvert) - { - RIP("Cannot convert to target type.\n"); - hr = E_FAIL; - } - } - - // - // Set the current iteration data ready for processing - // - if (SUCCEEDED(hr)) - { - // - // Ensure the iterator is reset to the start of the area to be processed. This - // ensures that the current rect lock is valid so that we can initialise the - // first scanline to process - // - Reset(); - - // - // Initialise the WIC <-> BM scan line converter - // - if (SUCCEEDED(hr = m_currScan.Initialize(g_lutWICToBMFormat[m_ePixelFormat]))) - { - hr = SetCurrentIterationData(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScanIterator::Reset - -Routine Description: - - Resets the current rect to the first scanline in the buffer. - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CScanIterator::Reset( - VOID - ) -{ - m_rectCurrLock.X = m_rectTotal.X; - m_rectCurrLock.Y = m_rectTotal.Y; - m_rectCurrLock.Width = m_rectTotal.Width; - m_rectCurrLock.Height = 1; -} - -/*++ - -Routine Name: - - CScanIterator::operator++ - -Routine Description: - - Iterate to the next scan line. - -Arguments: - - None - -Return Value: - - Reference to this iterator - ---*/ -CScanIterator& -CScanIterator::operator++(INT) -{ - HRESULT hr = S_OK; - - m_rectCurrLock.Y++; - if (!Finished()) - { - if (FAILED(hr = SetCurrentIterationData())) - { - throw CXDException(hr); - } - } - - return *this; -} - -/*++ - -Routine Name: - - CScanIterator::GetScanBuffer - -Routine Description: - - Retrieves the scanline buffer appropriate for WCS/ICM consumption - -Arguments: - - ppData - Pointer to pointer that recieves the address of the data buffer - Note: the buffer is only valid for the lifetime of the CScanIterator object. - pBmFormat - Pointer to a BMFORMAT enumeration that recieves the format - pcWidth - Pointer to storage that recieves the pixel width - pcHeight - Pointer to storage that recieves the pixel height - pcbStride - Pointer to storage that recieves the stride - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::GetScanBuffer( - _Outptr_result_buffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Out_ UINT* pcbStride - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBmFormat, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcHeight, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbStride, E_POINTER))) - { - *ppData = NULL; - *pcWidth = 0; - *pcHeight = 1; - *pcbStride = 0; - *pBmFormat = BM_RGBTRIPLETS; - - // - // Get the data from the WIC <-> BMFORMAT scanline converter - // - hr = m_currScan.GetData(ppData, pBmFormat, pcWidth, pcbStride); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScanIterator::Commit - -Routine Description: - - Commits the current color buffer to the surface if required and applies an optional alpha - channel passed in from a source iterator - -Arguments: - - alphaSource - Scan iterator instance with any potential alpha data to copy - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::Commit( - _In_ CONST CScanIterator& alphaSource - ) -{ - HRESULT hr = S_OK; - - COLORDATATYPE srcDataType = COLOR_BYTE; - COLORDATATYPE dstDataType = COLOR_BYTE; - - if (m_bSrcLine) - { - RIP("Cannot commit to readonly surface.\n"); - - hr = E_FAIL; - } - else if (alphaSource.m_ePixelFormat >= kWICPixelFormatMax || - alphaSource.m_ePixelFormat < kWICPixelFormatMin || - m_ePixelFormat >= kWICPixelFormatMax || - m_ePixelFormat < kWICPixelFormatMin) - { - RIP("Invalid pixel format.\n"); - - hr = E_FAIL; - } - else - { - srcDataType = g_lutWICToBMFormat[alphaSource.m_ePixelFormat].m_colDataType; - dstDataType = g_lutWICToBMFormat[m_ePixelFormat].m_colDataType; - - if (srcDataType > COLOR_S2DOT13FIXED || - srcDataType < COLOR_BYTE || - dstDataType > COLOR_S2DOT13FIXED || - dstDataType < COLOR_BYTE) - { - RIP("Invalid data type.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr) && - alphaSource.HasAlphaChannel() && - HasAlphaChannel()) - { - // - // Convert and copy alpha data into destination - // - PBYTE pDst = m_pbWICData; - size_t cbDstChannel = g_lutColorDataSize[dstDataType]; - size_t cbDstAlphaOffset = g_lutWICToBMFormat[m_ePixelFormat].m_cAlphaOffset * cbDstChannel; - UINT cDstChannels = g_lutWICToBMFormat[m_ePixelFormat].m_cChannels; - - PBYTE pSrc = alphaSource.m_pbWICData; - size_t cbSrcChannel = g_lutColorDataSize[srcDataType]; - size_t cbSrcAlphaOffset = g_lutWICToBMFormat[alphaSource.m_ePixelFormat].m_cAlphaOffset * cbSrcChannel; - UINT cSrcChannels = g_lutWICToBMFormat[alphaSource.m_ePixelFormat].m_cChannels; - - if (m_cWICWidth * cDstChannels * cbDstChannel <= m_cbWICStride && - alphaSource.m_cWICWidth * cSrcChannels * cbSrcChannel <= alphaSource.m_cbWICStride) - { - // - // Move the source and destination to the first alpha channel - // - pDst += cbDstAlphaOffset; - pSrc += cbSrcAlphaOffset; - - // - // Call the appropriate convert copy function by casting the src pointer - // to the underlying data type - // - switch (srcDataType) - { - case COLOR_BYTE: - hr = ConvertCopyAlphaChannels(reinterpret_cast(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - case COLOR_WORD: - hr = ConvertCopyAlphaChannels(reinterpret_cast(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - case COLOR_FLOAT: - hr = ConvertCopyAlphaChannels(reinterpret_cast(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - case COLOR_S2DOT13FIXED: - hr = ConvertCopyAlphaChannels(reinterpret_cast(pSrc), - m_cWICWidth, - cSrcChannels, - dstDataType, - pDst, - m_cWICWidth, - cDstChannels); - break; - - default: - { - RIP("Unrecognized source format.\n"); - - hr = E_FAIL; - } - break; - } - } - else - { - RIP("Insufficient buffer sizes.\n"); - - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - - // - // Commit the scanline - // - if (SUCCEEDED(hr)) - { - hr = m_currScan.Commit(m_pbWICData, m_cbWICStride); - } - - // - // Release the lock - // - UnlockSurface(); - - m_cbWICStride = 0; - m_cWICWidth = 0; - m_cWICHeight = 0; - m_cbWICData = 0; - m_pbWICData = NULL; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScanIterator::Finished - -Routine Description: - - We are done once all scanlines have been processed. - -Arguments: - - None - -Return Value: - - TRUE - We have iterated over all requested scanlines - FALSE - There are scanlines remaining - ---*/ -BOOL -CScanIterator::Finished( - VOID - ) -{ - return m_rectCurrLock.Y >= (m_rectTotal.Y + m_rectTotal.Height); -} - -/*++ - -Routine Name: - - CScanIterator::SetCurrentIterationData - -Routine Description: - - Sets up the current iteration data by locking the relevant area of the WIC bitmap - source and getting the WIC to BMFORMAT converter class to apply any conversion required - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CScanIterator::SetCurrentIterationData( - VOID - ) -{ - HRESULT hr = S_OK; - - m_cbWICStride = 0; - m_cWICWidth = 0; - m_cWICHeight = 0; - m_cbWICData = 0; - m_pbWICData = NULL; - - if (SUCCEEDED(hr = LockSurface(&m_rectCurrLock, - m_bSrcLine, - &m_cbWICStride, - &m_cWICWidth, - &m_cWICHeight, - &m_cbWICData, - &m_pbWICData)) && - SUCCEEDED(hr = CHECK_POINTER(m_pbWICData, E_FAIL))) - { - hr = m_currScan.SetData(m_bSrcLine, m_pbWICData, m_cbWICStride, m_cWICWidth); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/scaniter.h b/print/XPSDrvSmpl/src/filters/color/scaniter.h deleted file mode 100644 index de4b725e..00000000 --- a/print/XPSDrvSmpl/src/filters/color/scaniter.h +++ /dev/null @@ -1,218 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - scaniter.h - -Abstract: - - CScanIterator class definition. The scan iterator class provides a convenient - interface for iterating over WIC data and retrieving scanline data approriate for - consumption in WCS/ICM. For example, the WIC pixel formats do not have alpha channel - positions that correspond with the WCS/ICM BMFORMAT types so this class is responsible - for presenting bitmap data without the alpha channel and for copying alpha data from - source to destination when scnaline changes are commited to the underlying WIC bitmap. - ---*/ - -#pragma once - -#include "bmpconv.h" -#include "wictobmscn.h" - -/* -Iterates through all scanlines in a bitmap creating a buffer appropriate -to color modification. These are: - - RGB channels (in that order) as byte, word, float or fixed - no alpha - CMYK channels (order as the source bitmap) as byte, word, float or fixed - no alpha - nChannel (order as the source bitmap) as byte - no alpha - -*/ -class CScanIterator : public CBmpConverter -{ -public: - CScanIterator( - _In_ CONST CBmpConverter& bmpConv, - _In_opt_ WICRect* pRect - ); - - virtual ~CScanIterator(); - - HRESULT - Initialize( - _In_ CONST BOOL& bReadOnly - ); - - VOID - Reset( - VOID - ); - - CScanIterator& - operator++( - INT - ); - - virtual HRESULT - GetScanBuffer( - _Outptr_result_buffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcHeight, - _Out_ UINT* pcbStride - ); - - HRESULT - Commit( - _In_ CONST CScanIterator& cbAlphaBuffer - ); - - BOOL - Finished( - VOID - ); - -private: - HRESULT - SetCurrentIterationData( - VOID - ); - - template - HRESULT - ConvertCopyAlphaChannels( - _In_reads_(cSrcPix) _T* pSrc, - _In_ CONST UINT& cSrcPix, - _In_ CONST UINT& cSrcChan, - _Out_writes_(cDstPix) _U* pDst, - _In_ CONST UINT& cDstPix, - _In_ CONST UINT& cDstChan - ) - { - HRESULT hr = S_OK; - - if (cDstPix == cSrcPix) - { - for (UINT cCurPix = 0; - cCurPix < cDstPix; - cCurPix++, pSrc += cSrcChan, pDst += cDstChan) - { - ConvertCopy(*pDst, *pSrc); - } - } - else - { - hr = E_INVALIDARG; - } - - ERR_ON_HR(hr); - return hr; - } - - template - HRESULT - ConvertCopyAlphaChannels( - _In_reads_(cSrcPix) _T* pSrc, - _In_ CONST UINT& cSrcPix, - _In_ CONST UINT& cSrcChan, - _In_ CONST COLORDATATYPE& dstColType, - _When_(dstColType == COLOR_BYTE, _Out_writes_bytes_(cDstPix)) - _When_(dstColType == COLOR_WORD, _At_((PWORD)pDst, _Out_writes_(cDstPix))) - _When_(dstColType == COLOR_FLOAT, _At_((PFLOAT)pDst, _Out_writes_bytes_(cDstPix * sizeof(FLOAT)))) // Esp:1154 - _When_(dstColType == COLOR_S2DOT13FIXED, _At_((PS2DOT13FIXED)pDst, _Out_writes_(cDstPix))) - PBYTE pDst, - _In_ CONST UINT& cDstPix, - _In_ CONST UINT& cDstChan - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSrc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDst, E_POINTER))) - { - // - // Call the appropriate convert copy function by casting the dst pointer - // to the underlying data type - // - switch (dstColType) - { - case COLOR_BYTE: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast(pDst), - cDstPix, - cDstChan); - break; - - case COLOR_WORD: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast(pDst), - cDstPix, - cDstChan); - break; - - case COLOR_FLOAT: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast(pDst), - cDstPix, - cDstChan); - break; - - case COLOR_S2DOT13FIXED: - hr = ConvertCopyAlphaChannels(reinterpret_cast<_T*>(pSrc), - cSrcPix, - cSrcChan, - reinterpret_cast(pDst), - cDstPix, - cDstChan); - break; - - default: - { - RIP("Unrecognized destination format.\n"); - - hr = E_INVALIDARG; - } - break; - } - } - - ERR_ON_HR(hr); - return hr; - } - -private: - WICRect m_rectTotal; - - WICRect m_rectCurrLock; - - BOOL m_bSrcLine; - - CWICToBMFormatScan m_currScan; - - UINT m_cbWICStride; - - UINT m_cWICWidth; - - UINT m_cWICHeight; - - UINT m_cbWICData; - - PBYTE m_pbWICData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/transform.cpp b/print/XPSDrvSmpl/src/filters/color/transform.cpp deleted file mode 100644 index adbf5b45..00000000 --- a/print/XPSDrvSmpl/src/filters/color/transform.cpp +++ /dev/null @@ -1,666 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - transform.cpp - -Abstract: - - CTransform class implementation. This class creates and manages color transforms providing - limited caching functionality based off the source profile keys. - - This file also contains a utility class for handling profile lists. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "transform.h" - -class CProfileList -{ -public: - /*++ - - Routine Name: - - CProfileList - - Routine Description: - - CProfileList constructor - - Arguments: - - pProfiles - pointer to a vector of profiles - - Return Value: - - None - Throws an exception on error. - - --*/ - CProfileList( - _In_ ProfileList* pProfiles - ) : - m_cProfiles(0), - m_phProfiles(NULL) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER))) - { - hr = CreateHandleBuffer(pProfiles); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - ~CProfileList - - Routine Description: - - CProfileList destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - ~CProfileList() - { - FreeHandleBuffer(); - } - - /*++ - - Routine Name: - - GetProfileData - - Routine Description: - - Retrieves - - Arguments: - - pphProfiles - Pointer to pointer that recieves the address of an array of profile handles - Note: the buffer is only valid for the lifetime of the CProfileList object. - pcProfiles - Pointer to storage that recieves the count of profiles in the array - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - GetProfileData( - _When_(*pcProfiles > 0, _Outptr_result_buffer_(*pcProfiles)) - _When_(*pcProfiles == 0, _Outptr_result_maybenull_) - HPROFILE** pphProfiles, - _Out_ DWORD* pcProfiles - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pphProfiles, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcProfiles, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_phProfiles, E_PENDING))) - { - *pphProfiles = 0; - *pcProfiles = 0; - - if (m_cProfiles > 0) - { - *pphProfiles = m_phProfiles; - *pcProfiles = m_cProfiles; - } - } - - ERR_ON_HR(hr); - return hr; - } - -private: - /*++ - - Routine Name: - - CreateHandleBuffer - - Routine Description: - - Creates the buffer that holds the profile handles - - Arguments: - - pProfiles - Pointer to the vector of CProfile objects that have the individual profile data - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - CreateHandleBuffer( - _In_ ProfileList* pProfiles - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER))) - { - try - { - FreeHandleBuffer(); - - m_cProfiles = static_cast(pProfiles->size()); - if (m_cProfiles > 0) - { - m_phProfiles = new(std::nothrow) HPROFILE[m_cProfiles]; - - if (SUCCEEDED(hr = CHECK_POINTER(m_phProfiles, E_OUTOFMEMORY))) - { - ProfileList::iterator iterProfiles = pProfiles->begin(); - - for (UINT cProfile = 0; - SUCCEEDED(hr) && iterProfiles != pProfiles->end() && cProfile < m_cProfiles; - iterProfiles++, cProfile++) - { - hr = (*iterProfiles)->GetProfileHandle(&m_phProfiles[cProfile]); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - FreeHandleBuffer - - Routine Description: - - Frees up the profile handle buffer - - Arguments: - - None - - Return Value: - - None - - --*/ - VOID - FreeHandleBuffer( - VOID - ) - { - if (m_phProfiles != NULL) - { - delete[] m_phProfiles; - m_phProfiles = NULL; - } - - m_cProfiles = 0; - } - -private: - HPROFILE* m_phProfiles; - - DWORD m_cProfiles; -}; - -/*++ - -Routine Name: - - CTransform::CTransform - -Routine Description: - - CTransform constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CTransform::CTransform() : - m_hColorTrans(NULL), - m_intents(INTENT_ABSOLUTE_COLORIMETRIC), - m_renderFlags(0), - m_pcstrProfileKeys(NULL), - m_cProfiles(0) -{ -} - -/*++ - -Routine Name: - - CTransform::~CTransform - -Routine Description: - - CTransform destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CTransform::~CTransform() -{ - FreeTransform(); -} - -/*++ - -Routine Name: - - CTransform::CreateTransform - -Routine Description: - - Creates the transform from a vector of CProfile objects - -Arguments: - - pProfiles - Pointer to the vector of CProfile objects that have the individual profile data - intent - Intent flags to be applied when creating transform - renderFlags - Render flags to be applied when creating transform - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::CreateTransform( - _In_ ProfileList* pProfiles, - _In_ CONST DWORD intent, - _In_ CONST DWORD renderFlags - ) -{ - HRESULT hr = S_OK; - - if (intent <= INTENT_ABSOLUTE_COLORIMETRIC) - { - BOOL bFreeTransform = FALSE; - - if (m_intents != intent) - { - m_intents = intent; - bFreeTransform = TRUE; - } - - if (m_renderFlags != renderFlags) - { - m_renderFlags = renderFlags; - bFreeTransform = TRUE; - } - - if (bFreeTransform) - { - FreeTransform(); - } - } - else - { - hr = E_INVALIDARG; - } - - BOOL bUpdate = FALSE; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER)) && - SUCCEEDED(hr = UpdateProfiles(pProfiles, &bUpdate))) - { - try - { - if (bUpdate) - { - HPROFILE* phProfiles = NULL; - DWORD cProfiles = 0; - CProfileList profileList(pProfiles); - - if (SUCCEEDED(hr = profileList.GetProfileData(&phProfiles, &cProfiles))) - { - m_hColorTrans = CreateMultiProfileTransform(phProfiles, - cProfiles, - &m_intents, - 1, - m_renderFlags, - INDEX_DONT_CARE); - - if (m_hColorTrans == NULL) - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = E_INVALIDARG; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTransform::GetTransformHandle - -Routine Description: - - Retrieves the current transform handle - -Arguments: - - phTrans - Pointer to a HTRANSFORM that recieves the transform handle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::GetTransformHandle( - _Out_ HTRANSFORM* phTrans - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(phTrans, E_POINTER))) - { - *phTrans = NULL; - - if (SUCCEEDED(hr = CHECK_HANDLE(m_hColorTrans, E_PENDING))) - { - *phTrans = m_hColorTrans; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTransform::FreeTransform - -Routine Description: - - Free the current transform - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CTransform::FreeTransform( - VOID - ) -{ - FreeProfileKeysBuffer(); - if (m_hColorTrans != NULL) - { - DeleteColorTransform(m_hColorTrans); - m_hColorTrans = NULL; - } -} - -/*++ - -Routine Name: - - CTransform::CreateProfileKeysBuffer - -Routine Description: - - Creates a buffer to recieve the keys to the profiles that compse the current - trnasform - -Arguments: - - cProfiles - the count of profiles that compose the transform - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::CreateProfileKeysBuffer( - _In_ CONST UINT& cProfiles - ) -{ - HRESULT hr = S_OK; - - FreeProfileKeysBuffer(); - - if (cProfiles > 0) - { - m_pcstrProfileKeys = new(std::nothrow) CStringXDW[cProfiles]; - if (SUCCEEDED(hr = CHECK_POINTER(m_pcstrProfileKeys, E_OUTOFMEMORY))) - { - m_cProfiles = cProfiles; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTransform::FreeProfileKeysBuffer - -Routine Description: - - Frees the profile key buffer - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CTransform::FreeProfileKeysBuffer( - VOID - ) -{ - if (m_pcstrProfileKeys != NULL) - { - delete[] m_pcstrProfileKeys; - m_pcstrProfileKeys = NULL; - } - - m_cProfiles = 0; -} - -/*++ - -Routine Name: - - CTransform::UpdateProfiles - -Routine Description: - - Updates the profile list and checks whether the transform needs to be generated - (i.e. is the current transform the same as the requested transform) - -Arguments: - - pProfiles - Pointer to the vector of CProfile objects that have the individual profile data - pbUpdate - Pointer to BOOL that recieves whether the transform requires updating - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTransform::UpdateProfiles( - _In_ ProfileList* pProfiles, - _Out_ BOOL* pbUpdate - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pProfiles, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pbUpdate, E_POINTER))) - { - *pbUpdate = FALSE; - - try - { - // - // If we already have a transform, a list of profile keys and matching - // number of profiles, check our keys against the incoming list of profiles - // and note if we need to create a new transform - // - CStringXDW* pcstrProfileKeys = NULL; - if (m_hColorTrans != NULL && - m_pcstrProfileKeys != NULL && - m_cProfiles > 0 && - m_cProfiles == static_cast(pProfiles->size())) - { - pcstrProfileKeys = m_pcstrProfileKeys; - ProfileList::iterator iterProfiles = pProfiles->begin(); - - for (; - iterProfiles != pProfiles->end() && !*pbUpdate; - iterProfiles++) - { - if (*(*iterProfiles) != *pcstrProfileKeys++) - { - *pbUpdate = TRUE; - } - } - } - else - { - *pbUpdate = TRUE; - } - - if (*pbUpdate) - { - // - // We need to create a new transform. Free any current transform and cache the keys - // to the profiles that constitute the transform - // - FreeTransform(); - if (SUCCEEDED(hr = CreateProfileKeysBuffer(static_cast(pProfiles->size())))) - { - pcstrProfileKeys = m_pcstrProfileKeys; - ProfileList::iterator iterProfiles = pProfiles->begin(); - - for (; - SUCCEEDED(hr) && iterProfiles != pProfiles->end(); - iterProfiles++, pcstrProfileKeys++) - { - // - // If CreateProfileKeysBuffer succeeds, it fills - // in m_pcstrProfileKeys with pProfiles->size() - // elements. Hence the _Analysis_assume_. - // - _Analysis_assume_(pcstrProfileKeys != NULL); - hr = (*iterProfiles)->GetProfileKey(pcstrProfileKeys); - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/transform.h b/print/XPSDrvSmpl/src/filters/color/transform.h deleted file mode 100644 index 4d3034fd..00000000 --- a/print/XPSDrvSmpl/src/filters/color/transform.h +++ /dev/null @@ -1,83 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - transform.h - -Abstract: - - CTransform class definition. This class creates and manages color transforms providing - limited caching functionality based off the source profile keys. - - ---*/ - -#pragma once - -#include "profile.h" - -typedef vector ProfileList; - -class CTransform -{ -public: - CTransform(); - - ~CTransform(); - - HRESULT - CreateTransform( - _In_ ProfileList* pProfiles, - _In_ CONST DWORD intent, - _In_ CONST DWORD renderFlags - ); - - HRESULT - GetTransformHandle( - _Out_ HTRANSFORM* phTrans - ); - - -private: - VOID - FreeTransform( - VOID - ); - - HRESULT - CreateProfileKeysBuffer( - _In_ CONST UINT& cProfiles - ); - - VOID - FreeProfileKeysBuffer( - VOID - ); - - HRESULT - UpdateProfiles( - _In_ ProfileList* pProfiles, - _Out_ BOOL* pbUpdate - ); - -private: - HTRANSFORM m_hColorTrans; - - DWORD m_intents; - - DWORD m_renderFlags; - - CStringXDW* m_pcstrProfileKeys; - - DWORD m_cProfiles; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp b/print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp deleted file mode 100644 index b53efb15..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.cpp +++ /dev/null @@ -1,813 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wcsapiconv.cpp - -Abstract: - - Implementation of the wrapper to the WCS API's - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "wcsapiconv.h" - -CWCSApiConv g_WCSApiConv; - -/*++ - -Routine Name: - - CWCSApiConv::CWCSApiConv - -Routine Description: - - CWCSApiConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWCSApiConv::CWCSApiConv() -{ - m_dllHandle = LoadLibrary(L"mscms.dll"); - - // - // If running on Vista, record the proc address for each WCS API - // - if (m_dllHandle != NULL && - IsVista()) - { - m_WcsAssociateColorProfileWithDevice = GetProcAddress(m_dllHandle,"WcsAssociateColorProfileWithDevice"); - m_WcsDisassociateColorProfileFromDevice = GetProcAddress(m_dllHandle, "WcsDisassociateColorProfileFromDevice"); - m_WcsEnumColorProfilesSize = GetProcAddress(m_dllHandle, "WcsEnumColorProfilesSize"); - m_WcsGetDefaultColorProfileSize = GetProcAddress(m_dllHandle, "WcsGetDefaultColorProfileSize"); - m_WcsGetDefaultColorProfile = GetProcAddress(m_dllHandle, "WcsGetDefaultColorProfile"); - m_WcsSetDefaultColorProfile = GetProcAddress(m_dllHandle, "WcsSetDefaultColorProfile"); - m_WcsSetDefaultRenderingIntent = GetProcAddress(m_dllHandle, "WcsSetDefaultRenderingIntent"); - m_WcsGetUsePerUserProfiles = GetProcAddress(m_dllHandle, "WcsGetUsePerUserProfiles"); - m_WcsSetUsePerUserProfiles = GetProcAddress(m_dllHandle, "WcsSetUsePerUserProfiles"); - m_WcsTranslateColors = GetProcAddress(m_dllHandle, "WcsTranslateColors"); - m_WcsCheckColors = GetProcAddress(m_dllHandle, "WcsCheckColors"); - m_WcsOpenColorProfileA = GetProcAddress(m_dllHandle, "WcsOpenColorProfileA"); - m_WcsOpenColorProfileW = GetProcAddress(m_dllHandle, "WcsOpenColorProfileW"); - m_WcsCreateIccProfile = GetProcAddress(m_dllHandle, "WcsCreateIccProfile"); - - ASSERTMSG(m_WcsAssociateColorProfileWithDevice != NULL && - m_WcsDisassociateColorProfileFromDevice != NULL && - m_WcsEnumColorProfilesSize != NULL && - m_WcsGetDefaultColorProfileSize != NULL && - m_WcsGetDefaultColorProfile != NULL && - m_WcsSetDefaultColorProfile != NULL && - m_WcsSetDefaultRenderingIntent != NULL && - m_WcsGetUsePerUserProfiles != NULL && - m_WcsSetUsePerUserProfiles != NULL && - m_WcsTranslateColors != NULL && - m_WcsCheckColors != NULL && - m_WcsOpenColorProfileA != NULL && - m_WcsOpenColorProfileW != NULL && - m_WcsCreateIccProfile != NULL, - "Failed to load WCS APIs correctly.\n"); - } -} - -/*++ - -Routine Name: - - CWCSApiConv::~CWCSApiConv - -Routine Description: - - CWCSApiConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWCSApiConv::~CWCSApiConv() -{ - FreeLibrary(m_dllHandle); -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsAssociateColorProfileWithDevice - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pProfileName - Points to the file name of the profile to associate. - - pDeviceName - Points to the name of the device to associate. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsAssociateColorProfileWithDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsAssociateColorProfileWithDevice != NULL) - { - bResult = m_WcsAssociateColorProfileWithDevice.GetFunc()(scope, pProfileName, pDeviceName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsDisassociateColorProfileFromDevice - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pProfileName - Pointer to the file name of the profile to disassociate. - - pDeviceName - Pointer to the name of the device to disassociate. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsDisassociateColorProfileFromDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsDisassociateColorProfileFromDevice != NULL) - { - bResult = m_WcsDisassociateColorProfileFromDevice.GetFunc()(scope, pProfileName, pDeviceName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsEnumColorProfilesSize - -Routine Description: - - -Arguments: - - scope - management scope for this operation, which could be system wide or for current user. - - pEnumRecord - Pointer to the structure specifying the enumeration criteria. - - pdwSize - Returns the size in bytes required for the buffer to receive the set of profile names in WcsEnumColorProfiles. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -_Success_(return) -BOOL -#pragma warning(suppress: 6001 6101) // PREFast can't see through templated forwarder function call -CWCSApiConv::WcsEnumColorProfilesSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PENUMTYPEW pEnumRecord, - _Out_ PDWORD pdwSize - ) -{ - BOOL bResult = FALSE; - - if (m_WcsEnumColorProfilesSize != NULL) - { - bResult = m_WcsEnumColorProfilesSize.GetFunc()(scope, pEnumRecord, pdwSize); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsGetDefaultColorProfileSize - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pDeviceName - Pointer to the name of the device to get the default profile for. NULL implies device-independent default. - - cptColorProfileType - Specifies the color profile type value. - - cpstColorProfileSubType - Specifies the color profile subtype value. - - dwProfileID - Specifies the ID of the color space that the profile represents. - - pcbProfileName - the size in bytes for receiving the default profile in WcsGetDefaultColorProfile. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -_Success_(return) -BOOL -#pragma warning(suppress: 6001 6101) // PREFast can't see through templated forwarder function call -CWCSApiConv::WcsGetDefaultColorProfileSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _Out_ PDWORD pcbProfileName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsGetDefaultColorProfileSize != NULL) - { - bResult = m_WcsGetDefaultColorProfileSize.GetFunc()(scope, - pDeviceName, - cptColorProfileType, - cpstColorProfileSubType, - dwProfileID, - pcbProfileName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsGetDefaultColorProfile - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pDeviceName - Pointer to the name of the device to get the default profile for. NULL implies device-independent default. - - cptColorProfileType - Specifies the color profile type value. - - cpstColorProfileSubType - Specifies the color profile subtype value. - - dwProfileID - Specifies the ID of the color space that the profile represents. - - cbProfileName - The size in bytes of the buffer pointed to by pProfileName. - - pProfileName - Pointer to the buffer in which the name of the profile is to be placed. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -#pragma warning(suppress: 6001 6054 6101) // PREFast can't see through templated forwarder function call -_Success_(return) -BOOL -CWCSApiConv::WcsGetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_ DWORD cbProfileName, - _Out_writes_bytes_(cbProfileName) LPWSTR pProfileName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsGetDefaultColorProfile != NULL) - { - bResult = m_WcsGetDefaultColorProfile.GetFunc()(scope, - pDeviceName, - cptColorProfileType, - cpstColorProfileSubType, - dwProfileID, - cbProfileName, - pProfileName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsSetDefaultColorProfile - -Routine Description: - - -Arguments: - - scope - Profile management scope for this operation, which could be system wide or for current user. - - pDeviceName - Pointer to the name of the device to set the default profile for. NULL implies device-independent default. - - cptColorProfileType - Specifies the color profile type value. - - cpstColorProfileSubType - Specifies the color profile subtype value. - - dwProfileID - Specifies the ID of the color space that the profile represents. - - pProfileName - Pointer to the buffer in which contains the name of the profile. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsSetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_opt_ LPCWSTR pProfileName - ) -{ - BOOL bResult = FALSE; - - if (m_WcsSetDefaultColorProfile != NULL) - { - bResult = m_WcsSetDefaultColorProfile.GetFunc()(scope, - pDeviceName, - cptColorProfileType, - cpstColorProfileSubType, - dwProfileID, - pProfileName); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsSetDefaultRenderingIntent - -Routine Description: - - -Arguments: - - scope - management scope for this operation, which could be system wide or for current user. - - dwRenderingIntent - The rendering intent to set. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsSetDefaultRenderingIntent( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ DWORD dwRenderingIntent - ) -{ - BOOL bResult = FALSE; - - if (m_WcsSetDefaultRenderingIntent != NULL) - { - bResult = m_WcsSetDefaultRenderingIntent.GetFunc()(scope, dwRenderingIntent); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsGetUsePerUserProfiles - -Routine Description: - - -Arguments: - - pDeviceName - The friendly name of the device. - - dwDeviceClass - The class of the device: CLASS_SCANNER for a capture device, - CLASS_MONITOR for a display device, or CLASS_PRINTER for a printer. - - pUsePerUserProfiles - Pointer to a location to receive the result. - This location receives TRUE if the user has chosen to use a - per-user profile association list for the specified device; otherwise FALSE. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -_Success_(return) -BOOL -#pragma warning(suppress: 6001 6101) // PREFast can't see through templated forwarder function call -CWCSApiConv::WcsGetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _Out_ PBOOL pUsePerUserProfiles - ) -{ - BOOL bResult = FALSE; - - if (m_WcsGetUsePerUserProfiles != NULL) - { - bResult = m_WcsGetUsePerUserProfiles.GetFunc()(pDeviceName, dwDeviceClass, pUsePerUserProfiles); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsSetUsePerUserProfiles - -Routine Description: - - -Arguments: - - pDeviceName - The friendly name of the device. - - dwDeviceClass - The class of the device: CLASS_SCANNER for a capture device, - CLASS_MONITOR for a display device, or CLASS_PRINTER for a printer. - - usePerUserProfiles - TRUE is the user wishes to use a per-user profile association - list for the specified device; otherwise FALSE. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsSetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _In_ BOOL usePerUserProfiles - ) -{ - BOOL bResult = FALSE; - - if (m_WcsSetUsePerUserProfiles != NULL) - { - bResult = m_WcsSetUsePerUserProfiles.GetFunc()(pDeviceName, dwDeviceClass, usePerUserProfiles); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsTranslateColors - -Routine Description: - - -Arguments: - - hColorTransform - Identifies the WCS color transform to use. - - nColors - Contains the number of elements in the arrays pointed to by pInputData and pOutputData. - - nInputChannels - Contains the number of channels per element in the array pointed to by pInputData - - cdtInput - Specifies the input COLORDATATYPTE. - - cbInput - Contains buffer size of pInputData. - - pInputData - Pointer to array of input colors. - - nOutputChannels - Contains the number of channels per element in the array pointed to by pOutputData. - - cdtOutput - Specifies the output COLORDATATYPTE. - - cbOutput - Contains buffer size of pOutputData. - - pOutputData - Pointer to array of output colors. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WcsTranslateColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _In_ DWORD nOutputChannels, - _In_ COLORDATATYPE cdtOutput, - _In_ DWORD cbOutput, - _Out_writes_bytes_(cbOutput) PVOID pOutputData - ) -{ - BOOL bResult = FALSE; - - if (m_WcsTranslateColors != NULL) - { - bResult = m_WcsTranslateColors.GetFunc()(hColorTransform, - nColors, - nInputChannels, - cdtInput, - cbInput, - pInputData, - nOutputChannels, - cdtOutput, - cbOutput, - pOutputData); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WCSCheckColors - -Routine Description: - - -Arguments: - - hColorTransform - Identifies the WCS color transform to use. - - nColors - Contains the number of elements in the arrays pointed to by pInputData and pResult. - - nInputChannels - Contains the number of channels per element in the array pointed to by pInputData - - cdtInput - Specifies the input COLORDATATYPTE. - - cbInput - Contains buffer size of pInputData. - - pInputData - Pointer to array of input colors. - - pResult - Pointer to array of nColor results of the test. - -Return Value: - - BOOL - If this function succeeds, the return value is TRUE. - ---*/ -BOOL -CWCSApiConv::WCSCheckColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _Out_writes_bytes_(nColors)PBYTE pResult -) -{ - BOOL bResult = FALSE; - - if (m_WcsCheckColors != NULL) - { - bResult = m_WcsCheckColors.GetFunc()(hColorTransform, - nColors, - nInputChannels, - cdtInput, - cbInput, - pInputData, - pResult); - } - - return bResult; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsOpenColorProfileA - -Routine Description: - - -Arguments: - - pCDMPProfile - Pointer to a WCS DMP or an ICC color profile structure specifying the profile. - - pCAMPProfile - Pointer to a WCS CAMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default CAMP is used. - - pGMMPProfile - Pointer to a WCS GMMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default GMMP is used. - - dwDesireAccess - Specifies how to access the given profile. This parameter must take one the following constant values. - - dwShareMode - Specifies how the profile should be shared, if the profile is contained in a file. - A value of zero prevents the profile from being shared at all. - - dwCreationMode - Specifies which actions to take on the profile while opening it, if it is contained in a file. - - -Return Value: - - HPROFILE - Handle to the opened color profile - ---*/ -HPROFILE -CWCSApiConv::WcsOpenColorProfileA( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ) -{ - HPROFILE hProfile = NULL; - - if (m_WcsOpenColorProfileA != NULL) - { - hProfile = m_WcsOpenColorProfileA.GetFunc()(pCDMPProfile, - pCAMPProfile, - pGMMPProfile, - dwDesireAccess, - dwShareMode, - dwCreationMode, - dwFlags); - } - - return hProfile; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsOpenColorProfileW - -Routine Description: - - -Arguments: - - pCDMPProfile - Pointer to a WCS DMP or an ICC color profile structure specifying the profile. - - pCAMPProfile - Pointer to a WCS CAMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default CAMP is used. - - pGMMPProfile - Pointer to a WCS GMMP color profile structure specifying the profile. - If this parameter is NULL, then the standard default GMMP is used. - - dwDesireAccess - Specifies how to access the given profile. This parameter must take one the following constant values. - - dwShareMode - Specifies how the profile should be shared, if the profile is contained in a file. - A value of zero prevents the profile from being shared at all. - - dwCreationMode - Specifies which actions to take on the profile while opening it, if it is contained in a file. - - -Return Value: - - HPROFILE - Handle to the opened color profile - ---*/ -HPROFILE -CWCSApiConv::WcsOpenColorProfileW( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ) -{ - HPROFILE hProfile = NULL; - - if (m_WcsOpenColorProfileW != NULL) - { - hProfile = m_WcsOpenColorProfileW.GetFunc()(pCDMPProfile, - pCAMPProfile, - pGMMPProfile, - dwDesireAccess, - dwShareMode, - dwCreationMode, - dwFlags); - } - - return hProfile; -} - -/*++ - -Routine Name: - - CWCSApiConv::WcsCreateIccProfile - -Routine Description: - - -Arguments: - - hWcsProfile - handle to a WCS profile which contains a combination - of a WCS DMP, and optionally a CAMP and/or GMMP. - - dwOptions - Options flag values from WCS_DEFAULT and WCS_ICCONLY - -Return Value: - - HPROFILE - Handle to the newly created color profile - ---*/ -HPROFILE -CWCSApiConv::WcsCreateIccProfile( - _In_ HPROFILE hWcsProfile, - _In_ DWORD dwOptions - ) -{ - HPROFILE hProfile = NULL; - - if (m_WcsCreateIccProfile != NULL) - { - hProfile = m_WcsCreateIccProfile.GetFunc()(hWcsProfile, dwOptions); - } - - return hProfile; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.h b/print/XPSDrvSmpl/src/filters/color/wcsapiconv.h deleted file mode 100644 index 1e63cd6a..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wcsapiconv.h +++ /dev/null @@ -1,280 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wcsapiconv.h - -Abstract: - - Provides a wrapper to the WCS API's - ---*/ - -#pragma once - -class CWCSApiConv; -extern CWCSApiConv g_WCSApiConv; - -typedef BOOL (CALLBACK* WCSASSOCIATECOLORPROFILEWITHDEVICE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, PCWSTR); -typedef BOOL (CALLBACK* WCSDISASSOCIATECOLORPROFILEFROMDEVICE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, PCWSTR); -typedef BOOL (CALLBACK* WCSENUMCOLORPROFILESSIZE)(WCS_PROFILE_MANAGEMENT_SCOPE, PENUMTYPEW, PDWORD); -typedef BOOL (CALLBACK* WCSGETDEFAULTCOLORPROFILESIZE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, COLORPROFILETYPE, COLORPROFILESUBTYPE, DWORD, PDWORD); -typedef BOOL (CALLBACK* WCSGETDEFAULTCOLORPROFILE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, COLORPROFILETYPE, COLORPROFILESUBTYPE, DWORD, DWORD, LPWSTR); -typedef BOOL (CALLBACK* WCSSETDEFAULTCOLORPROFILE)(WCS_PROFILE_MANAGEMENT_SCOPE, PCWSTR, COLORPROFILETYPE, COLORPROFILESUBTYPE, DWORD, LPCWSTR); -typedef BOOL (CALLBACK* WCSSETDEFAULTRENDERINGINTENT)(WCS_PROFILE_MANAGEMENT_SCOPE, DWORD); -typedef BOOL (CALLBACK* WCSGETUSEPERUSERPROFILES)(LPCWSTR, DWORD, PBOOL); -typedef BOOL (CALLBACK* WCSSETUSEPERUSERPROFILES)(LPCWSTR, DWORD, BOOL); -typedef BOOL (CALLBACK* WCSTRANSLATECOLORS)(HTRANSFORM, DWORD, DWORD, COLORDATATYPE, DWORD, PVOID, DWORD, COLORDATATYPE, DWORD, PVOID); -typedef BOOL (CALLBACK* WCSCHECKCOLORS)(HTRANSFORM, DWORD, DWORD, COLORDATATYPE, DWORD, PVOID, PBYTE); -typedef HPROFILE (CALLBACK* WCSOPENCOLORPROFILE)(PPROFILE, PPROFILE, PPROFILE, DWORD, DWORD, DWORD, DWORD); -typedef HPROFILE (CALLBACK* WCSCREATEICCPROFILE)(HPROFILE, DWORD); - -#define WcsAssociateColorProfileWithDeviceXD g_WCSApiConv.WcsAssociateColorProfileWithDevice -#define WcsDisassociateColorProfileFromDeviceXD g_WCSApiConv.WcsDisassociateColorProfileFromDevice -#define WcsEnumColorProfilesSizeXD g_WCSApiConv.WcsEnumColorProfilesSize -#define WcsGetDefaultColorProfileSizeXD g_WCSApiConv.WcsGetDefaultColorProfileSize -#define WcsGetDefaultColorProfileXD g_WCSApiConv.WcsGetDefaultColorProfile -#define WcsSetDefaultColorProfileXD g_WCSApiConv.WcsSetDefaultColorProfile -#define WcsSetDefaultRenderingIntentXD g_WCSApiConv.WcsSetDefaultRenderingIntent -#define WcsGetUsePerUserProfilesXD g_WCSApiConv.WcsGetUsePerUserProfiles -#define WcsSetUsePerUserProfilesXD g_WCSApiConv.WcsSetUsePerUserProfiles -#define WcsTranslateColorsXD g_WCSApiConv.WcsTranslateColors -#define WCSCheckColorsXD g_WCSApiConv.WCSCheckColors -#define WcsOpenColorProfileWXD g_WCSApiConv.WcsOpenColorProfileW -#define WcsOpenColorProfileAXD g_WCSApiConv.WcsOpenColorProfileA -#define WcsCreateIccProfileXD g_WCSApiConv.WcsCreateIccProfile - -#ifdef _UNICODE -#define WcsOpenColorProfileXD WcsOpenColorProfileWXD -#else -#define WcsOpenColorProfileXD WcsOpenColorProfileAXD -#endif - -template -class CEncodedFuncPtr -{ -public: - CEncodedFuncPtr() : - m_pFunc(NULL) - { - } - - ~CEncodedFuncPtr(){} - - CEncodedFuncPtr<_T>& - operator=( - _In_ FARPROC pFunc - ) - { - m_pFunc = EncodePointer(pFunc); - return *this; - } - - BOOL - operator==( - _In_opt_ PVOID pv - ) const - { - return m_pFunc == pv; - } - - BOOL - operator!=( - _In_opt_ PVOID pv - ) const - { - return !operator==(pv); - } - - _T - GetFunc( - VOID - ) - { - return reinterpret_cast<_T>(DecodePointer(m_pFunc)); - } - -private: - __field_encoded_pointer PVOID m_pFunc; -}; - -class CWCSApiConv -{ -public: - CWCSApiConv(); - - ~CWCSApiConv(); - - BOOL - WcsAssociateColorProfileWithDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ); - - BOOL - WcsDisassociateColorProfileFromDevice( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PCWSTR pProfileName, - _In_ PCWSTR pDeviceName - ); - - _Success_(return) - BOOL - WcsEnumColorProfilesSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ PENUMTYPEW pEnumRecord, - _Out_ PDWORD pdwSize - ); - - _Success_(return) - BOOL - WcsGetDefaultColorProfileSize( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _Out_ PDWORD pcbProfileName - ); - - _Success_(return) - BOOL - WcsGetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_ DWORD cbProfileName, - _Out_writes_bytes_(cbProfileName) LPWSTR pProfileName - ); - - BOOL - WcsSetDefaultColorProfile( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_opt_ PCWSTR pDeviceName, - _In_ COLORPROFILETYPE cptColorProfileType, - _In_ COLORPROFILESUBTYPE cpstColorProfileSubType, - _In_ DWORD dwProfileID, - _In_opt_ LPCWSTR pProfileName - ); - - BOOL - WcsSetDefaultRenderingIntent( - _In_ WCS_PROFILE_MANAGEMENT_SCOPE scope, - _In_ DWORD dwRenderingIntent - ); - - _Success_(return) - BOOL - WcsGetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _Out_ PBOOL pUsePerUserProfiles - ); - - BOOL - WcsSetUsePerUserProfiles( - _In_ LPCWSTR pDeviceName, - _In_ DWORD dwDeviceClass, - _In_ BOOL usePerUserProfiles - ); - - BOOL - WcsTranslateColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _In_ DWORD nOutputChannels, - _In_ COLORDATATYPE cdtOutput, - _In_ DWORD cbOutput, - _Out_writes_bytes_(cbOutput)PVOID pOutputData - ); - - BOOL - WCSCheckColors( - _In_ HTRANSFORM hColorTransform, - _In_ DWORD nColors, - _In_ DWORD nInputChannels, - _In_ COLORDATATYPE cdtInput, - _In_ DWORD cbInput, - _In_reads_bytes_(cbInput) PVOID pInputData, - _Out_writes_bytes_(nColors)PBYTE pResult - ); - - HPROFILE WINAPI - WcsOpenColorProfileA( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ); - - HPROFILE WINAPI - WcsOpenColorProfileW( - _In_ PPROFILE pCDMPProfile, - _In_opt_ PPROFILE pCAMPProfile, - _In_opt_ PPROFILE pGMMPProfile, - _In_ DWORD dwDesireAccess, - _In_ DWORD dwShareMode, - _In_ DWORD dwCreationMode, - _In_ DWORD dwFlags - ); - - HPROFILE - WcsCreateIccProfile( - _In_ HPROFILE hWcsProfile, - _In_ DWORD dwOptions - ); - -private: - HINSTANCE m_dllHandle; - - // - // WCS API - // - CEncodedFuncPtr m_WcsAssociateColorProfileWithDevice; - - CEncodedFuncPtr m_WcsDisassociateColorProfileFromDevice; - - CEncodedFuncPtr m_WcsEnumColorProfilesSize; - - CEncodedFuncPtr m_WcsGetDefaultColorProfileSize; - - CEncodedFuncPtr m_WcsGetDefaultColorProfile; - - CEncodedFuncPtr m_WcsSetDefaultColorProfile; - - CEncodedFuncPtr m_WcsSetDefaultRenderingIntent; - - CEncodedFuncPtr m_WcsGetUsePerUserProfiles; - - CEncodedFuncPtr m_WcsSetUsePerUserProfiles; - - CEncodedFuncPtr m_WcsTranslateColors; - - CEncodedFuncPtr m_WcsCheckColors; - - CEncodedFuncPtr m_WcsOpenColorProfileA; - - CEncodedFuncPtr m_WcsOpenColorProfileW; - - CEncodedFuncPtr m_WcsCreateIccProfile; -}; - diff --git a/print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp b/print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp deleted file mode 100644 index ca6058aa..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wictobmscn.cpp +++ /dev/null @@ -1,751 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wictobmscn.cpp - -Abstract: - - WIC pixel format to BMFORMAT conversion class implementation. This class provides methods - for converting between a source WIC scanline to a target destination BMFORMAT scanline. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "wictobmscn.h" - -/*++ - -Routine Name: - - CWICToBMFormatScan::CWICToBMFormatScan - -Routine Description: - - CWICToBMFormatScan constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWICToBMFormatScan::CWICToBMFormatScan() : - m_pScanBuffer(NULL), - m_cbScanBuffer(0), - m_cWidth(0), - m_pData(NULL), - m_cbData(0), - m_bInitialized(FALSE) -{ -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::~CWICToBMFormatScan - -Routine Description: - - CWICToBMFormatScan destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWICToBMFormatScan::~CWICToBMFormatScan() -{ - FreeScanBuffer(); -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::Initialize - -Routine Description: - - Initializes the WIC to BMFORMAT transform data from the WICToBMFORMAT structure - -Arguments: - - WICToBM - Structure containing WIC pixel format to BMFORMAT conversion information - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::Initialize( - _In_ CONST WICToBMFORMAT& WICToBM - ) -{ - HRESULT hr = S_OK; - - m_convData = WICToBM; - - if (m_convData.m_pixFormTarget <= kWICPixelFormatMin || - m_convData.m_pixFormTarget >= kWICPixelFormatMax || - m_convData.m_bmFormTarget < kICMPixelFormatMin || - m_convData.m_bmFormTarget >= kICMPixelFormatMax) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - !IsVista()) - { - // - // When processing color data down-level from Vista, we cannot use fixed or float - // BMFORMAT types. In these circumstances we need to convert to a 16 bpc equivalent, - // then back again. - // - if (m_convData.m_bmFormTarget == kBM_32b_scRGB || - m_convData.m_bmFormTarget == kBM_32b_scARGB || - m_convData.m_bmFormTarget == kBM_S2DOT13FIXED_scRGB || - m_convData.m_bmFormTarget == kBM_S2DOT13FIXED_scARGB) - { - m_convData.m_bNeedsScanBuffer = TRUE; - m_convData.m_bmFormTarget = kBM_16b_RGB; - } - } - - if (SUCCEEDED(hr)) - { - m_bInitialized = TRUE; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::SetData - -Routine Description: - - Set the current WIC data. This method takes the WIC scanline data and - applies any necessary conversion to achieve the required BMFORMAT - -Arguments: - - bIsSrc - Indicates if this is a source scanline (i.e. is the conversion required as the scanline is input) - pWicPxData - Pointer to the WIC data - cbWicPxData - Count of bytes in the WIC data buffer - cWidth - Count of pixels inthe scanline - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::SetData( - _In_ CONST BOOL bIsSrc, - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData, - _In_ CONST UINT cWidth - ) -{ - HRESULT hr = m_bInitialized ? S_OK : E_PENDING; - - COLORDATATYPE srcColType = COLOR_BYTE; - EICMPixelFormat eICMFormSrc = kBM_RGBTRIPLETS; - - COLORDATATYPE dstColType = COLOR_BYTE; - EICMPixelFormat eICMFormDst = kBM_RGBTRIPLETS; - - // - // Validate input - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pWicPxData, E_POINTER))) - { - if (m_convData.m_pixFormTarget >= kWICPixelFormatMin && - m_convData.m_pixFormTarget < kWICPixelFormatMax) - { - // - // Set up the destination and source formats - // - eICMFormSrc = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_bmFormTarget; - srcColType = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_colDataType; - - if (m_convData.m_bmFormTarget < kICMPixelFormatMax && - m_convData.m_bmFormTarget >= kICMPixelFormatMin) - { - dstColType = g_lutBMFormatData[m_convData.m_bmFormTarget].m_colDataType; - eICMFormDst = m_convData.m_bmFormTarget; - } - else - { - hr = E_FAIL; - } - } - else - { - hr = E_FAIL; - } - } - - // - // Validate source and destination formats - // - if (SUCCEEDED(hr)) - { - if (eICMFormSrc < kICMPixelFormatMin || - eICMFormSrc >= kICMPixelFormatMax || - eICMFormDst < kICMPixelFormatMin || - eICMFormDst >= kICMPixelFormatMax) - { - RIP("Invalid pixel format.\n"); - - hr = E_FAIL; - } - else if (srcColType < COLOR_BYTE || - srcColType > COLOR_S2DOT13FIXED || - dstColType < COLOR_BYTE || - dstColType > COLOR_S2DOT13FIXED) - { - RIP("Invalid color data type.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - m_cWidth = cWidth; - if (m_convData.m_bNeedsScanBuffer) - { - // - // We need to convert in one way or another - create a buffer to - // hold the intermediate scanline data - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateScanBuffer(m_cWidth, - g_lutColorDataSize[dstColType], - g_lutBMFormatData[eICMFormDst].m_cChannels))) - { - if (bIsSrc) - { - // - // We need to initialise the buffer from the WIC buffer passed in. Here we - // are doing one of two things: - // - // 1. Copying data directly as we have parity between the WIC and - // ICM pixel formats - // 2. Convert from the WIC format to the ICM format and copy. - // - - // - // Set up the source and destination pointers - // - PBYTE pSrc = pWicPxData; - UINT cSrcChannels = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_cChannels; - size_t cbSrcBytesPerPixel = g_lutColorDataSize[srcColType] * cSrcChannels; - - PBYTE pDst = m_pScanBuffer; - UINT cDstChannels = g_lutBMFormatData[eICMFormDst].m_cChannels; - size_t cbDstBytesPerPixel = g_lutColorDataSize[dstColType] * cDstChannels; - - PBYTE pSrcEnd = pSrc + cbWicPxData; - PBYTE pDstEnd = pDst + m_cbScanBuffer; - - if (dstColType == m_convData.m_colDataType) - { - while (pSrc < pSrcEnd && - pDst < pDstEnd) - { - if (pSrc + cbDstBytesPerPixel < pSrcEnd) - { - CopyMemory(pDst, pSrc, cbDstBytesPerPixel); - } - pSrc += cbSrcBytesPerPixel; - pDst += cbDstBytesPerPixel; - } - } - else - { - // - // We should only ever be required to convert from floating point and fixed point - // scRGB formats to 16 bpc RGB - // - if (eICMFormDst == kBM_16b_RGB && - (eICMFormSrc == kBM_32b_scRGB || - eICMFormSrc == kBM_32b_scARGB)) - { - FLOAT* pSrcData = reinterpret_cast(pSrc); - WORD* pDstData = reinterpret_cast(pDst); - - while (pSrcData <= reinterpret_cast(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast(pDstEnd) - cDstChannels) - { - for (UINT cChan = 0; - cChan < cDstChannels && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting from FLOAT and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - if (pSrcData[cChan] <= -2.0f) - { - pDstData[cChan] = 0; - } - else if (pSrcData[cChan] >= 2.0f) - { - pDstData[cChan] = 0xFFFF; - } - else - { - pDstData[cChan] = static_cast(kMaxWordAsFloat * (pSrcData[cChan] + 2.0) / 4.0f); - } - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels; - } - } - else if (eICMFormDst == kBM_16b_RGB && - (eICMFormSrc == kBM_S2DOT13FIXED_scRGB || - eICMFormSrc == kBM_S2DOT13FIXED_scARGB)) - { - WORD* pSrcData = reinterpret_cast(pSrc); - WORD* pDstData = reinterpret_cast(pDst); - - while (pSrcData <= reinterpret_cast(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast(pDstEnd) - cDstChannels) - { - for (UINT cChan = 0; - cChan < cDstChannels && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting from S2DOT13FIXED and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - pDstData[cChan] = pSrcData[cChan] & kS2Dot13Neg ? pSrcData[cChan] ^ 0xFFFF : pSrcData[cChan] | kS2Dot13Neg; - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels; - } - } - else - { - hr = E_NOTIMPL; - } - } - } - - // - // Set the out buffer pointer and size to the copy buffer - // - if (SUCCEEDED(hr)) - { - m_pData = m_pScanBuffer; - m_cbData = m_cbScanBuffer; - } - } - } - else - { - // - // Set the out buffer pointer and size to the WIC pixel data - // - m_pData = pWicPxData; - m_cbData = cbWicPxData; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::Commit - -Routine Description: - - Commits the internal scanline data to the WIC data buffer - -Arguments: - - pWicPxData - Pointer to the WIC data - cbWicPxData - Count of bytes in the WIC data buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::Commit( - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData - ) -{ - HRESULT hr = m_bInitialized ? S_OK : E_PENDING; - - COLORDATATYPE srcColType = COLOR_BYTE; - EICMPixelFormat eICMFormSrc = kBM_RGBTRIPLETS; - - COLORDATATYPE dstColType = COLOR_BYTE; - EICMPixelFormat eICMFormDst = kBM_RGBTRIPLETS; - - // - // Validate input - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pWicPxData, E_POINTER))) - { - if (m_convData.m_pixFormTarget >= kWICPixelFormatMin && - m_convData.m_pixFormTarget < kWICPixelFormatMax) - { - // - // Set up the destination and source formats - // - eICMFormDst = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_bmFormTarget; - dstColType = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_colDataType; - - if (m_convData.m_bmFormTarget < kICMPixelFormatMax && - m_convData.m_bmFormTarget >= kICMPixelFormatMin) - { - eICMFormSrc = m_convData.m_bmFormTarget; - srcColType = g_lutBMFormatData[eICMFormSrc].m_colDataType; - } - else - { - hr = E_FAIL; - } - } - else - { - hr = E_FAIL; - } - } - - // - // Validate source and destination formats - // - if (SUCCEEDED(hr)) - { - if (eICMFormSrc < kICMPixelFormatMin || - eICMFormSrc >= kICMPixelFormatMax || - eICMFormDst < kICMPixelFormatMin || - eICMFormDst >= kICMPixelFormatMax) - { - RIP("Invalid pixel format.\n"); - - hr = E_FAIL; - } - else if (srcColType < COLOR_BYTE || - srcColType > COLOR_S2DOT13FIXED || - dstColType < COLOR_BYTE || - dstColType > COLOR_S2DOT13FIXED) - { - RIP("Invalid color data type.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - if (pWicPxData != m_pData) - { - // - // We need to convert the scan buffer and write back into the WIC buffer - // - PBYTE pDst = pWicPxData; - UINT cDstChannels = g_lutWICToBMFormat[m_convData.m_pixFormTarget].m_cChannels; - size_t cbDstBytesPerPixel = g_lutColorDataSize[dstColType] * cDstChannels; - - PBYTE pSrc = m_pScanBuffer; - UINT cSrcChannels = g_lutBMFormatData[eICMFormSrc].m_cChannels; - size_t cbSrcBytesPerPixel = g_lutColorDataSize[srcColType] * cSrcChannels; - - PBYTE pSrcEnd = pSrc + m_cbScanBuffer; - PBYTE pDstEnd = pDst + cbWicPxData; - - if (srcColType == m_convData.m_colDataType) - { - while (pSrc < pSrcEnd && - pDst < pDstEnd) - { - if (pDst + cbSrcBytesPerPixel < pDstEnd) - { - CopyMemory(pDst, pSrc, cbSrcBytesPerPixel); - } - - pSrc += cbSrcBytesPerPixel; - pDst += cbDstBytesPerPixel; - } - } - else - { - // - // We should only ever be required to convert from 16 bpc RGB to floating point - // and fixed point scRGB formats - // - if (eICMFormSrc == kBM_16b_RGB && - (eICMFormDst == kBM_32b_scRGB || - eICMFormDst == kBM_32b_scARGB)) - { - WORD* pSrcData = reinterpret_cast(pSrc); - FLOAT* pDstData = reinterpret_cast(pDst); - UINT cAlpha = eICMFormDst == kBM_32b_scARGB ? 1 : 0; - - while (pSrcData <= reinterpret_cast(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast(pDstEnd) - cDstChannels) - { - pDstData += cAlpha; - - for (UINT cChan = 0; - cChan < (cDstChannels - cAlpha) && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting to FLOAT and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - pDstData[cChan] = (4.0f * static_cast(pSrcData[cChan]) / kMaxWordAsFloat) - 2.0f; - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels - cAlpha; - } - } - else if (eICMFormSrc == kBM_16b_RGB && - (eICMFormDst == kBM_S2DOT13FIXED_scRGB || - eICMFormDst == kBM_S2DOT13FIXED_scARGB)) - { - WORD* pSrcData = reinterpret_cast(pSrc); - WORD* pDstData = reinterpret_cast(pDst); - UINT cAlpha = eICMFormDst == kBM_S2DOT13FIXED_scARGB ? 1 : 0; - - while (pSrcData <= reinterpret_cast(pSrcEnd) - cSrcChannels && - pDstData <= reinterpret_cast(pDstEnd) - cDstChannels) - { - pDstData += cAlpha; - - for (UINT cChan = 0; - cChan < (cDstChannels - cAlpha) && cChan < cSrcChannels; - cChan++) - { - // - // Note: We are only converting to S2DOT13FIXED and not applying gamma modification - // as the transform should account for this given the input scRGB ICC source profile. - // - pDstData[cChan] = pSrcData[cChan] & kS2Dot13Neg ? - pSrcData[cChan] ^ kS2Dot13Neg : pSrcData[cChan] ^ 0xFFFF; - } - - pSrcData += cSrcChannels; - pDstData += cDstChannels - cAlpha; - } - } - else - { - hr = E_NOTIMPL; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::GetData - -Routine Description: - - Retrieves the BMFORMAT buffer ready for processing - -Arguments: - - ppData - Pointer to a pointer that recieves the address of the data buffer. - Note: the buffer is only valid for the lifetime of the CWICToBMFormatScan object. - pBmFormat - Pointer to a BMFORMAT enum that recieves the type - pcWidth - Pointer to storage that recieves the pixel width - pcbStride - Pointer to storage that recieves the scanline stride - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::GetData( - _Outptr_result_bytebuffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcbStride - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBmFormat, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcWidth, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbStride, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pData, E_PENDING))) - { - if (m_convData.m_bmFormTarget >= kICMPixelFormatMin && - m_convData.m_bmFormTarget < kICMPixelFormatMax) - { - *pBmFormat = g_lutBMFormatData[m_convData.m_bmFormTarget].m_bmFormat; - *pcWidth = m_cWidth; - *ppData = m_pData; - *pcbStride = static_cast(m_cbData); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::CreateScanBuffer - -Routine Description: - - Creates the intermediate scanline buffer - -Arguments: - - cWidth - Pixel width of the scanline - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWICToBMFormatScan::CreateScanBuffer( - _In_ CONST UINT cWidth, - _In_ CONST SIZE_T cbDataType, - _In_ CONST UINT cChannels - ) -{ - HRESULT hr = S_OK; - - if (cWidth > MAX_PIXELWIDTH_COUNT || - cbDataType > MAX_COLDATATYPE_SIZE || - cChannels > MAX_COLCHANNEL_COUNT) - { - hr = E_INVALIDARG; - } - - size_t cbScanBuffer = 0; - - if (SUCCEEDED(hr)) - { - if (FAILED(SizeTMult(cWidth, cbDataType, &cbScanBuffer)) || - FAILED(SizeTMult(cbScanBuffer, cChannels, &cbScanBuffer))) - { - hr = HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); - } - - } - - if (SUCCEEDED(hr)) - { - if (cbScanBuffer != m_cbScanBuffer) - { - FreeScanBuffer(); - m_pScanBuffer = new(std::nothrow) BYTE[cbScanBuffer]; - if (SUCCEEDED(hr = CHECK_POINTER(m_pScanBuffer, E_OUTOFMEMORY))) - { - m_cbScanBuffer = cbScanBuffer; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWICToBMFormatScan::FreeScanBuffer - -Routine Description: - - Free the intermediate scanline buffer - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CWICToBMFormatScan::FreeScanBuffer( - VOID - ) -{ - if (m_pScanBuffer != NULL) - { - delete[] m_pScanBuffer; - m_pScanBuffer = NULL; - } - - m_cbScanBuffer = 0; -} - diff --git a/print/XPSDrvSmpl/src/filters/color/wictobmscn.h b/print/XPSDrvSmpl/src/filters/color/wictobmscn.h deleted file mode 100644 index 6ac780be..00000000 --- a/print/XPSDrvSmpl/src/filters/color/wictobmscn.h +++ /dev/null @@ -1,88 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wictobmscn.h - -Abstract: - - WIC pixel format to BMFORMAT conversion class implementation. This class provides methods - for converting between a source WIC scanline to a target destination BMFORMAT scanline. - ---*/ - -#pragma once - -#include "bmpdata.h" - -class CWICToBMFormatScan -{ -public: - CWICToBMFormatScan(); - - virtual ~CWICToBMFormatScan(); - - HRESULT - Initialize( - _In_ CONST WICToBMFORMAT& WICToBM - ); - - HRESULT - SetData( - _In_ CONST BOOL bIsSrc, - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData, - _In_ CONST UINT cWidth - ); - - HRESULT - Commit( - _In_reads_bytes_(cbWicPxData) PBYTE pWicPxData, - _In_ CONST UINT cbWicPxData - ); - - HRESULT - GetData( - _Outptr_result_bytebuffer_(*pcbStride) PBYTE* ppData, - _Out_ BMFORMAT* pBmFormat, - _Out_ UINT* pcWidth, - _Out_ UINT* pcbStride - ); - -private: - HRESULT - CreateScanBuffer( - _In_ CONST UINT cWidth, - _In_ CONST SIZE_T cbDataType, - _In_ CONST UINT cChannels - ); - - VOID - FreeScanBuffer( - VOID - ); - -private: - WICToBMFORMAT m_convData; - - PBYTE m_pScanBuffer; - - size_t m_cbScanBuffer; - - UINT m_cWidth; - - PBYTE m_pData; - - size_t m_cbData; - - BOOL m_bInitialized; -}; diff --git a/print/XPSDrvSmpl/src/filters/common/clasfact.h b/print/XPSDrvSmpl/src/filters/common/clasfact.h deleted file mode 100644 index 409fc9bc..00000000 --- a/print/XPSDrvSmpl/src/filters/common/clasfact.h +++ /dev/null @@ -1,202 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - clasfact.h - -Abstract: - - This file defines a template IClassFactory implementation - to be returned by each filter's DllGetClassObject() function. - - Also, a routine to return one of these class factories so that - this code does not need to be duplicated in every filter's - DllGetClassObject(). - ---*/ - -#pragma once - -#include "cunknown.h" -#include "globals.h" - -template -class CClassFactory : public CUnknown -{ -public: - // - // Constructor and Destruction - // - CClassFactory() : - CUnknown(IID_IClassFactory) - { } - - virtual ~CClassFactory() - { } - - // - // IClassFactory methods - // - virtual HRESULT STDMETHODCALLTYPE - CreateInstance( - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _Outptr_ PVOID* ppvObject - ) - { - HRESULT hr = S_OK; - - if (ppvObject == NULL) - { - hr = E_POINTER; - goto Exit; - } - *ppvObject = NULL; - - if (pUnkOuter == NULL) - { - // - // Create Filter - // - _T* pFilter = NULL; - - try - { - pFilter = new(std::nothrow) _T; - hr = CHECK_POINTER(pFilter, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - if (pFilter != NULL) - { - delete pFilter; - pFilter = NULL; - } - - hr = e; - } - catch(...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface - // - hr = pFilter->QueryInterface(riid, ppvObject) ; - - // - // Release the IUnknown pointer. If QueryInterface failed - // the Release() call will clean up - // - pFilter->Release(); - } - } - else - { - // - // Cannot aggregate - // - hr = CLASS_E_NOAGGREGATION; - } - - Exit: - ERR_ON_HR(hr); - return hr; - } - - virtual HRESULT STDMETHODCALLTYPE - LockServer( - _In_ BOOL bLock - ) - { - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - - return S_OK; - } -}; - -template -HRESULT -GetFilterClassFactory( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _In_ REFCLSID expectedclsid, - _Out_ VOID** ppv - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER))) - { - *ppv = NULL; - - // - // Make sure the appropriate class factory is being requested - // - if (rclsid == expectedclsid) - { - CClassFactory<_T>* pFactory = NULL; - - try - { - pFactory = new(std::nothrow) CClassFactory<_T>(); - hr = CHECK_POINTER(pFactory, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - if (pFactory != NULL) - { - delete pFactory; - pFactory = NULL; - } - - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface. - // - hr = pFactory->QueryInterface(riid, ppv); - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pFactory->Release(); - } - } - else - { - hr = CLASS_E_CLASSNOTAVAILABLE; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/common/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/common/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp b/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp deleted file mode 100644 index fa50170f..00000000 --- a/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp +++ /dev/null @@ -1,1216 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ptmanage.cpp - -Abstract: - - PrintTicket management class implementation. This class encapsulate - PrintTicket handling algorithm defined in the XPS Document specification. - It provides a simple set and get interace for to filters and handles - merging of tickets and the use of the Win32 PrintTicket provider API. - The algorithm for determining the PrintTicket applies as follows: - - 1. Validate and merge the PrintTicket from the FDS with the default - printicket converted from the property bag. - The resultant ticket will be the Job level ticket. - - 2. Validate and merge the PrintTicket from the current FD with the Job - level ticket from step 1. The resultant ticket will be the document - level ticket. - - 3. Validate and merge the PrintTicket from the current FP with the Doc - level ticket from step 2. The resultant ticket will be the page - level ticket. - - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "ptmanage.h" -#include "streamcnv.h" - -/*++ - -Routine Name: - - CPTManager::CPTManager - -Routine Description: - - CPTManager class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTManager::CPTManager() : - m_pDefaultPT(NULL), - m_pJobPT(NULL), - m_pDocPT(NULL), - m_pPagePT(NULL), - m_hProvider(NULL), - m_hToken(INVALID_HANDLE_VALUE) -{ -} - -/*++ - -Routine Name: - - CPTManager::~CPTManager - -Routine Description: - - CPTManager class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPTManager::~CPTManager() -{ - // - // Close the PT provider - // - CloseProvider(); -} - -/*++ - -Routine Name: - - CPTManager::Initialise - -Routine Description: - - This routine Initialises the PrintTicket manager with the default PrintTicket - and the device name. - -Arguments: - - pDefaultTicketStream - Pointer to the default user PrintTicket as an IStream - bstrPrinterName - The name of the printer - userToken - The user's security token - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::Initialise( - _In_ IPrintReadStream* pDefaultTicketStream, - _In_z_ BSTR bstrPrinterName, - _In_ HANDLE userToken - ) -{ - HRESULT hr = S_OK; - - m_hToken = userToken; - - // - // If the provider is already open close it - // - CloseProvider(); - - if (SUCCEEDED(hr = CHECK_POINTER(pDefaultTicketStream, E_POINTER))) - { - if (SysStringLen(bstrPrinterName) <= 0) - { - hr = E_INVALIDARG; - } - } - - // - // We need to impersonate the user who submitted the job - // in order to always have sufficient rights to call - // PTOpenProvider. - // - if (SUCCEEDED(hr)) - { - if (SetThreadToken(NULL, m_hToken)) - { - // - // Open the PT interface and initialise PrintTickets - // - if (SUCCEEDED(hr = PTOpenProvider(bstrPrinterName, 1, &m_hProvider))) - { - CComPtr pPTStream(NULL); - pPTStream.Attach(new(std::nothrow) CPrintReadStreamToIStream(pDefaultTicketStream)); - - if (SUCCEEDED(hr = CHECK_POINTER(pPTStream, E_OUTOFMEMORY))) - { - hr = InitialisePrintTickets(pPTStream); - } - } - - // - // Always revert back to the default security context - // - if (!SetThreadToken(NULL, NULL)) - { - // - // We couldn't revert the security context. The filter pipeline - // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can - // continue to run. - // - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - This routine sets the Job level PrintTicket from the PrintTicket held in the - FixedDocumentSequence. If there is no PrintTicket associated with the FDS, the - default PrintTicket is used to set the Job level PrintTicket. - -Arguments: - - pFDS - Pointer to the FixedDocumentSequence interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST IFixedDocumentSequence* pFDS - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - CComPtr pPTRef(NULL); - - // - // If a PrintTicket is available merge it at the job level - // - if (SUCCEEDED(hr = const_cast(pFDS)->GetPrintTicket(&pPTRef))) - { - hr = MergeTicket(kPTJobScope, pPTRef); - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) - { - // - // This indicates there is no print-ticket associated with - // the job. Free the tickets from this scope upward and - // reintialise the defaults - // - FreePrintTickets(kPTJobScope); - hr = UpdateDefaultPTs(kPTJobScope); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - This routine sets the Socument level PrintTicket from the PrintTicket held in the - FixedDocument. If there is no PrintTicket associated with the FD, the - FixedDocumentSequence PrintTicket is used to set the Docuemnt level PrintTicket. - -Arguments: - - pFD - Pointer to the FixedDocument interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST IFixedDocument* pFD - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER))) - { - CComPtr pPTRef(NULL); - - // - // If a PrintTicket is available merge it at the doc level - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = const_cast(pFD)->GetPrintTicket(&pPTRef))) - { - hr = MergeTicket(kPTDocumentScope, pPTRef); - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) - { - // - // This indicates there is no print-ticket associated with - // the job. Free the tickets from this scope upward and - // reintialise the defaults - // - FreePrintTickets(kPTDocumentScope); - hr = UpdateDefaultPTs(kPTDocumentScope); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - This routine sets the Page level PrintTicket from the PrintTicket held in the - FixedPage. If there is no PrintTicket associated with the FP, the - FixedDocument PrintTicket is used to set the Page level PrintTicket. - -Arguments: - - pFP - Pointer to the FixedPage interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST IFixedPage* pFP - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - CComPtr pPTRef(NULL); - - // - // If a PrintTicket is available merge it at the page level - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = const_cast(pFP)->GetPrintTicket(&pPTRef))) - { - hr = MergeTicket(kPTPageScope, pPTRef); - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) - { - // - // This indicates there is no print-ticket associated with - // the job. Free the tickets from this scope upward and - // reintialise the defaults - // - FreePrintTickets(kPTPageScope); - hr = UpdateDefaultPTs(kPTPageScope); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPTManager::SetTicket - -Routine Description: - - Sets the PrintTicket at the specified scope given a PrintTicket defined - as a DOM document - -Arguments: - - ptScope - The scope of the PrintTicket to be set - pPT - Pointer to an IXMLDOMDocument2 interface that contains the PrintTicket to be set - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_opt_ CONST IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - // - // Free the tickets from this scope upward and reintialise - // from the appropriate default. This ensures we are not - // using an old PrintTicket from the same scope - // - FreePrintTickets(ptScope); - - if (SUCCEEDED(hr = UpdateDefaultPTs(ptScope))) - { - if (pPT) - { - hr = MergeTicket(ptScope, pPT); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::GetTicket - -Routine Description: - - This routine retrieves the PrintTicket at the requested scope - -Arguments: - - ptScope - The scope of the PrintTicket to be retrieved - ppTicket - Pointer to an IXMLDOMDocument2 interface pointer that recieves the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::GetTicket( - _In_ CONST EPrintTicketScope ptScope, - _Outptr_ IXMLDOMDocument2** ppTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppTicket, E_POINTER)) && - SUCCEEDED(hr = UpdateDefaultPTs(ptScope))) - { - *ppTicket = NULL; - - switch (ptScope) - { - case kPTPageScope: - { - // - // Pointer should either be default or FP ticket but never NULL - // - ASSERTMSG(m_pPagePT != NULL, "NULL Page PrintTicket.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPagePT, E_PENDING))) - { - *ppTicket = m_pPagePT; - } - } - break; - - case kPTDocumentScope: - { - // - // Pointer should either be default or FD ticket but never NULL - // - ASSERTMSG(m_pDocPT != NULL, "NULL Document PrintTicket.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDocPT, E_PENDING))) - { - *ppTicket = m_pDocPT; - } - } - break; - - case kPTJobScope: - { - // - // Pointer should either be default or FDS ticket but never NULL - // - ASSERTMSG(m_pJobPT != NULL, "NULL Job PrintTicket.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pJobPT, E_PENDING))) - { - *ppTicket = m_pJobPT; - } - } - break; - - default: - { - RIP("Unrecognised PT scope\n"); - - hr = E_INVALIDARG; - } - break; - } - - if (*ppTicket == NULL) - { - RIP("Failed to retrieve a valid PrintTicket\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPTManager::GetCapabilities - -Routine Description: - - This routine retrieves a PrintCapabilities document given a PrintTicket - -Arguments: - - pTicket - Pointer to the PrintTicket as a DOM document - pTicket - Pointer to a DOM document pointer that recieves the PrintCapabilities - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::GetCapabilities( - _In_ IXMLDOMDocument2* pTicket, - _Outptr_ IXMLDOMDocument2** ppCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppCapabilities, E_POINTER))) - { - *ppCapabilities = NULL; - - CComBSTR bstrError; - CComPtr pPTIn(NULL); - CComPtr pPCOut(NULL); - CComPtr pCapabilitiesDoc(NULL); - - // - // Create the PrintCapabilities DOM document, retrieve the IStreams from the - // DOM documents and call the PT api to retrieve the capabilities document - // - if (SUCCEEDED(hr = pCapabilitiesDoc.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = pTicket->QueryInterface(IID_IStream, reinterpret_cast(&pPTIn))) && - SUCCEEDED(hr = pCapabilitiesDoc->QueryInterface(IID_IStream, reinterpret_cast(&pPCOut)))) - { - if (SetThreadToken(NULL, m_hToken)) - { - if (SUCCEEDED(hr = PTGetPrintCapabilities(m_hProvider, pPTIn, pPCOut, &bstrError))) - { - LARGE_INTEGER cbMove = {0}; - if (SUCCEEDED(hr = pPCOut->Seek(cbMove, STREAM_SEEK_SET, NULL))) - { - *ppCapabilities = pCapabilitiesDoc.Detach(); - } - } - else - { - try - { - CStringXDA cstrError(bstrError); - ERR(cstrError.GetBuffer()); - } - catch (CXDException&) - { - } - } - - // - // Always revert back to the default security context - // - if (!SetThreadToken(NULL, NULL)) - { - // - // We couldn't revert the security context. The filter pipeline - // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can - // continue to run. - // - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - - // - // If SetThreadToken fails, GetLastError will return an error - // - _Analysis_assume_(FAILED(hr)); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::InitialisePrintTickets - -Routine Description: - - This routine intialises the PrintTickets at the default, job, document and page scope - using an IStream containing the default PrintTicket mark-up - -Arguments: - - pDefaultPTStream - Pointer to an IStream interface that contains the default PrintTicket data - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::InitialisePrintTickets( - _In_ IStream* pDefaultPTStream - ) -{ - ASSERTMSG(m_hProvider != NULL, "NULL PrintTicket provider interface detected.\n"); - - HRESULT hr = S_OK; - - // - // Make sure all print tickets are released - // - m_pDefaultPT = NULL; - m_pJobPT = NULL; - m_pDocPT = NULL; - m_pPagePT = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pDefaultPTStream, E_POINTER))) - { - // - // Create the DOM documents for default PT - // - hr = SetPTFromStream(pDefaultPTStream, &m_pDefaultPT); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetPTFromDOMDoc - -Routine Description: - - This routine copies one DOM document representation of the PrintTicket to another - -Arguments: - - pPTDOMDoc - Pointer to the source PrintTicket as a DOM document - ppDomDoc - Pointer to an IXMLDOMDOcument pointer that recieves the copied PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetPTFromDOMDoc( - _In_ IXMLDOMDocument2* pPTDOMDoc, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPTDOMDoc, E_POINTER))) - { - // - // Get the IStream from the DOM doc and pass to SetPTFromStream - // - CComPtr pStream(NULL); - if (SUCCEEDED(hr = pPTDOMDoc->QueryInterface(IID_IStream, reinterpret_cast(&pStream)))) - { - hr = SetPTFromStream(pStream, ppDomDoc); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::SetPTFromStream - -Routine Description: - - This routine copies an IStream representation of the PrintTicket to a DOM document - -Arguments: - - pPTStream - Pointer to the source PrintTicket as an IStream - ppDomDoc - Pointer to an IXMLDOMDOcument pointer that recieves the copied PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::SetPTFromStream( - _In_ IStream* pPTStream, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPTStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppDomDoc, E_POINTER))) - { - *ppDomDoc = NULL; - - LARGE_INTEGER cbMoveFromStart = {0}; - CComPtr pDOMDoc(NULL); - VARIANT_BOOL fLoaded = VARIANT_FALSE; - - // - // Create the DOM document instance, seek to the start of the - // PT stream and load into the dom document - // - if (SUCCEEDED(hr = pDOMDoc.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = pPTStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL)) && - SUCCEEDED(hr = pDOMDoc->load(CComVariant(pPTStream), &fLoaded))) - { - if (fLoaded == VARIANT_TRUE) - { - // - // Assign the outgoing element pointer - detach from CComPtr to release ownership - // - *ppDomDoc = pDOMDoc.Detach(); - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::MergeTicket - -Routine Description: - - This routine merges a PrintTicket (supplied as a IPartPrintTicket pointer) into - the DOM representation of the PrintTicket at the requested scope - -Arguments: - - ptScope - The scope at which the PrintTicket is to be merged - pPTRef - Pointer to an IPartPrintTicket interface containing the PrintTicket to be merged - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IPartPrintTicket* pPTRef - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPTRef, E_POINTER))) - { - // - // Create a DOM document from the PT ref stream - // - CComPtr pNewPT(NULL); - CComPtr pRead(NULL); - - if (SUCCEEDED(hr = pNewPT.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = const_cast(pPTRef)->GetStream(&pRead))) - { - CComPtr pReadStreamToSeq(NULL); - VARIANT_BOOL fLoaded = VARIANT_FALSE; - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pRead)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY)) && - SUCCEEDED(hr = pNewPT->load(CComVariant(pReadStreamToSeq), &fLoaded))) - { - if (fLoaded == VARIANT_TRUE) - { - hr = MergeTicket(ptScope, pNewPT); - } - else - { - hr = E_FAIL; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::MergeTicket - -Routine Description: - - This routine merges a PrintTicket (supplied as a IXMLDOMDocument2 pointer) into - the DOM representation of the PrintTicket at the requested scope - -Arguments: - - ptScope - The scope at which the PrintTicket is to be merged - pPT - Pointer to an IXMLDOMDocument2 interface containing the PrintTicket to be merged - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPT, E_POINTER))) - { - CComPtr pPTLevelUp(NULL); - CComPtr pResult(NULL); - - switch (ptScope) - { - case kPTJobScope: - { - pPTLevelUp = m_pDefaultPT; - } - break; - - case kPTDocumentScope: - { - pPTLevelUp = m_pJobPT; - } - break; - - case kPTPageScope: - { - pPTLevelUp = m_pDocPT; - } - break; - - default: - { - RIP("Unrecognised PT scope\n"); - - hr = E_INVALIDARG; - } - break; - } - - ASSERTMSG(pPTLevelUp != NULL, "PrintTicket at the level up has not been set (check part handler is attempting to)\n"); - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPTLevelUp, E_PENDING)) && - SUCCEEDED(hr = GetMergedTicket(ptScope, pPT, pPTLevelUp, &pResult))) - { - switch (ptScope) - { - case kPTJobScope: - { - m_pJobPT = pResult; - } - break; - - case kPTDocumentScope: - { - m_pDocPT = pResult; - } - break; - - case kPTPageScope: - { - m_pPagePT = pResult; - } - break; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::GetMergedTicket - -Routine Description: - - This routine retrieves a merged PrintTicket at the requested scope given the base - and delta PrintTickets as IXMLDOMDocument2 interface pointers - -Arguments: - - ptScope - The scope at which the merge should take place - pDelta - The delta PrintTicket as an IXMLDOMDocument2 pointer - pBase - The base PrintTicket as an IXMLDOMDocument2 pointer - ppResult - The resulting PrintTicket after the merge has completed - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::GetMergedTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pDelta, - _In_ IXMLDOMDocument2* pBase, - _Outptr_ IXMLDOMDocument2** ppResult - ) -{ - ASSERTMSG(pDelta != NULL, "NULL PT reference part passed.\n"); - ASSERTMSG(pBase != NULL, "NULL base PT passed.\n"); - ASSERTMSG(ppResult != NULL, "NULL out PT passed.\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(m_hProvider, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(ppResult, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDelta, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBase, E_POINTER))) - { - *ppResult = NULL; - } - - CComPtr pResultStream(NULL); - CComPtr pBaseStream(NULL); - CComPtr pDeltaStream(NULL); - - CComPtr pNewPT(NULL); - - // - // Create a new DOM doc based off the result ticket and - // assign to the resultant DOM doc - // - try - { - CComBSTR bstrErrorMessage; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &pResultStream)) && - SUCCEEDED(hr = pBase->QueryInterface(IID_IStream, reinterpret_cast(&pBaseStream))) && - SUCCEEDED(hr = const_cast(pDelta)->QueryInterface(IID_IStream, reinterpret_cast(&pDeltaStream)))) - { - if (SetThreadToken(NULL, m_hToken)) - { - if (SUCCEEDED(hr = PTMergeAndValidatePrintTicket(m_hProvider, - pBaseStream, - pDeltaStream, - ptScope, - pResultStream, - &bstrErrorMessage))) - { - if (SUCCEEDED(hr = SetPTFromStream(pResultStream, &pNewPT))) - { - // - // Assign the outgoing element pointer - detach from CComPtr to release ownership - // - *ppResult = pNewPT.Detach(); - } - } - else - { - CStringXDA cstrMessage; - CStringXDA cstrError(bstrErrorMessage); - cstrMessage.Format("PTMergeAndValidatePrintTicket failed with message: %s\n", static_cast(cstrError)); - - ERR(cstrMessage.GetBuffer()); - } - - // - // Always revert back to the default security context - // - if (!SetThreadToken(NULL, NULL)) - { - // - // We couldn't revert the security context. The filter pipeline - // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can - // continue to run. - // - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - - // - // If SetThreadToken fails, GetLastError will return an error - // - _Analysis_assume_(FAILED(hr)); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::CloseProvider - -Routine Description: - - This routine closes the PrintTicket provider - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::CloseProvider( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_hProvider != NULL) - { - hr = PTCloseProvider(m_hProvider); - m_hProvider = NULL; - } - - return hr; -} - -/*++ - -Routine Name: - - CPTManager::UpdateDefaultPTs - -Routine Description: - - This routine updates the default PrintTicket at a given scope. This routine updates - the Job PrintTicket with the default, the Document with the Job and the Page with the - Document if they are not set and are within the requested scope. - -Arguments: - - ptScope - The scope of the PrintTicket to update - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPTManager::UpdateDefaultPTs( - _In_ CONST EPrintTicketScope ptScope - ) -{ - HRESULT hr = S_OK; - - // - // We need at least the default ticket in place - // - ASSERTMSG(m_pDefaultPT != NULL, "The default PrintTicket is not correctly set\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDefaultPT, E_PENDING))) - { - if (ptScope <= kPTJobScope && - m_pJobPT == NULL) - { - hr = SetPTFromDOMDoc(m_pDefaultPT, &m_pJobPT); - } - - if (SUCCEEDED(hr) && - ptScope <= kPTDocumentScope && - m_pDocPT == NULL) - { - hr = SetPTFromDOMDoc(m_pJobPT, &m_pDocPT); - } - - if (SUCCEEDED(hr) && - ptScope == kPTPageScope && - m_pPagePT == NULL) - { - hr = SetPTFromDOMDoc(m_pDocPT, &m_pPagePT); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPTManager::FreePrintTickets - -Routine Description: - - This routine releases the PrintTicket at a given scope and all PrintTickets - that depend on it. - -Arguments: - - ptScope - The scope from which the PrintTickets should be released - -Return Value: - - None - ---*/ -VOID -CPTManager::FreePrintTickets( - _In_ CONST EPrintTicketScope ptScope - ) -{ - if (ptScope >= kPTPageScope) - { - m_pPagePT = NULL; - } - - if (ptScope >= kPTDocumentScope) - { - m_pDocPT = NULL; - } - - if (ptScope >= kPTJobScope) - { - m_pJobPT = NULL; - } -} - diff --git a/print/XPSDrvSmpl/src/filters/common/ptmanage.h b/print/XPSDrvSmpl/src/filters/common/ptmanage.h deleted file mode 100644 index 1c1e3f67..00000000 --- a/print/XPSDrvSmpl/src/filters/common/ptmanage.h +++ /dev/null @@ -1,153 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ptmanage.cpp - -Abstract: - - PrintTicket management class definition. This class encapsulate - PrintTicket handling algorithm defined in the XPS Document specification. - It provides a simple set and get interace for to filters and handles - merging of tickets and the use of the Win32 PrintTicket provider API. - The algorithm for determining the PrintTicket applies as follows: - - 1. Validate and merge the PrintTicket from the FDS with the default - printicket converted from the default devmode in the property bag. - The resultant ticket will be the Job level ticket. - - 2. Validate and merge the PrintTicket from the current FD with the Job - level ticket from step 1. The resultant ticket will be the document - level ticket. - - 3. Validate and merge the PrintTicket from the current FP with the Doc - level ticket from step 2. The resultant ticket will be the page - level ticket. - ---*/ - -#pragma once - -class CPTManager -{ -public: - CPTManager(); - - virtual ~CPTManager(); - - HRESULT - Initialise( - _In_ IPrintReadStream* pDefaultTicketStream, - _In_z_ BSTR bstrPrinterName, - _In_ HANDLE userToken - ); - - HRESULT - SetTicket( - _In_ CONST IFixedDocumentSequence* pFDS - ); - - HRESULT - SetTicket( - _In_ CONST IFixedDocument* pFD - ); - - HRESULT - SetTicket( - _In_ CONST IFixedPage* pFP - ); - - HRESULT - SetTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_opt_ CONST IXMLDOMDocument2* pPT - ); - - HRESULT - GetTicket( - _In_ CONST EPrintTicketScope ptScope, - _Outptr_ IXMLDOMDocument2** ppTicket - ); - - HRESULT - GetCapabilities( - _In_ IXMLDOMDocument2* pTicket, - _Outptr_ IXMLDOMDocument2** ppCapabilities - ); - -private: - HRESULT - InitialisePrintTickets( - _In_ IStream* pDefaultPTStream - ); - - HRESULT - SetPTFromDOMDoc( - _In_ IXMLDOMDocument2* pPTDOMDoc, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ); - - HRESULT - SetPTFromStream( - _In_ IStream* pPTStream, - _Outptr_ IXMLDOMDocument2** ppDomDoc - ); - - HRESULT - MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IPartPrintTicket* pPTRef - ); - - HRESULT - MergeTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pPT - ); - - HRESULT - GetMergedTicket( - _In_ CONST EPrintTicketScope ptScope, - _In_ CONST IXMLDOMDocument2* pDelta, - _In_ IXMLDOMDocument2* pBase, - _Outptr_ IXMLDOMDocument2** ppResult - ); - - HRESULT - CloseProvider( - VOID - ); - - HRESULT - UpdateDefaultPTs( - _In_ CONST EPrintTicketScope ptScope - ); - - VOID - FreePrintTickets( - _In_ CONST EPrintTicketScope ptScope - ); - -private: - CComPtr m_pDefaultPT; - - CComPtr m_pJobPT; - - CComPtr m_pDocPT; - - CComPtr m_pPagePT; - - HPTPROVIDER m_hProvider; - - HANDLE m_hToken; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/rescache.cpp b/print/XPSDrvSmpl/src/filters/common/rescache.cpp deleted file mode 100644 index 32b206e2..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescache.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - rescache.cpp - -Abstract: - - File resource cache implementation. Filters that need to add resources - may be required to add the same resource to numerous pages in a job. To - prevent the same resource being sent repeatedly, the file resource cache - class implements an interface that filters can use to add resources - without needing to keep track of whether they have been sent. For specific - filter functionality, a class should be created that implements a resource - writer interface. This should be able to write the resource to a stream. The - filter can then add this class to the the resource cache and it will take - care of writing the resource via the IResWriter::WriteData method if it has - not already been written. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "rescache.h" - -/*++ - -Routine Name: - - CFileResourceCache::CFileResourceCache - -Routine Description: - - CFileResourceCache class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFileResourceCache::CFileResourceCache() -{ -} - -/*++ - -Routine Name: - - CFileResourceCache::~CFileResourceCache - -Routine Description: - - CFileResourceCache class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFileResourceCache::~CFileResourceCache() -{ -} - -/*++ - -Routine Name: - - CFileResourceCache::WriteResource - -Routine Description: - - This template function writes a resource to a fixed page. The type - of resource is supplied as an argument to the template. The resource - data is written via the IResWriter interface passed to the method. - -Arguments: - - pXpsConsumer - The XPS consumer to create the new resource part - pFixedPage - The FixedPage to send the resource to - pResWriter - The resource writer (hides the resource type behind a generic write interface) - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -template -HRESULT -CFileResourceCache::WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsConsumer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResWriter, E_POINTER))) - { - CComBSTR bstrKeyName; - CComBSTR bstrURI; - - // - // Check if the resource has already been written - // - if (SUCCEEDED(hr = pResWriter->GetKeyName(&bstrKeyName)) && - SUCCEEDED(hr = pResWriter->GetResURI(&bstrURI))) - { - if (!Cached(bstrKeyName)) - { - // - // The resource is not cached: - // 1. Create the resource part - // 2. Write data to part - // 3. Cache URI and new part against the resource name - // - CComPtr<_T> pRes(NULL); - CComPtr pWrite(NULL); - - if (SUCCEEDED(hr = pXpsConsumer->GetNewEmptyPart(bstrURI, - __uuidof(_T), - reinterpret_cast(&pRes), - &pWrite))) - { - hr = pResWriter->WriteData(pRes, pWrite); - - pWrite->Close(); - - try - { - CComPtr pPartBase(NULL); - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pRes.QueryInterface(&pPartBase))) - { - m_resMap[CComBSTR(bstrKeyName)].first = bstrURI; - m_resMap[CComBSTR(bstrKeyName)].second = pPartBase; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - // - // Set the resource so relationships are updated - // - try - { - if (SUCCEEDED(hr)) - { - hr = pFixedPage->SetPagePart(m_resMap[CComBSTR(bstrKeyName)].second); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFileResourceCache::GetURI - -Routine Description: - - This routine retrieves the URI to a given resource - -Arguments: - - bstrResNameIn - The name of the resource for which the URI is required - pbstrURI - Pointer to a BSTR that recieves the resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFileResourceCache::GetURI( - _In_z_ BSTR bstrResNameIn, - _Outptr_ BSTR* pbstrURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrURI, E_POINTER))) - { - if (SysStringLen(bstrResNameIn) == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - CComBSTR bstrResName(bstrResNameIn); - CComBSTR uri(m_resMap[bstrResName].first); - - if (uri.Length() > 0) - { - if (SUCCEEDED(hr = uri.CopyTo(pbstrURI)) && - !*pbstrURI) - { - hr = E_OUTOFMEMORY; - } - } - else - { - *pbstrURI = NULL; - hr = E_FAIL; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFileResourceCache::Cached - -Routine Description: - - This routine checks if a resource has been cached - -Arguments: - - bstrResNameIn - The name (key) of the resource - -Return Value: - - BOOL - TRUE - The resource is in the cache - FALSE - The resource is not in the cache - ---*/ -BOOL -CFileResourceCache::Cached( - _In_z_ BSTR bstrResNameIn - ) -{ - BOOL bCached = FALSE; - - try - { - CComBSTR bstrResName(bstrResNameIn); - ResCache::const_iterator resMapIter = m_resMap.begin(); - - for (;resMapIter != m_resMap.end() && !bCached; resMapIter++) - { - if (resMapIter->first == bstrResName) - { - bCached = TRUE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - } - - return bCached; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/rescache.h b/print/XPSDrvSmpl/src/filters/common/rescache.h deleted file mode 100644 index 554e6352..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescache.h +++ /dev/null @@ -1,132 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - rescache.h - -Abstract: - - File resource cache defintion and resource writer interface defintion. - Filters that need to add resources may be required to add the same resource - to numerous pages in a job. To prevent the same resource being sent - repeatedly, the file resource cache class implements an interface that - filters can use to add resources without needing to keep track of whether - they have been sent. For specific filter functionality, a class should be - created that implements a resource writer interface. This should be able to - write the resource to a stream. The filter can then add this class to the - the resource cache and it will take care of writing the resource via the - IResWriter::WriteData method if it has not already been written. - ---*/ - -#pragma once - -// -// The resource cache needs to map a unique name against the URI used -// and the part that was added. This allows us to retrieve the URI to -// write to the mark-up and also the part to set to the page/doc/docseq -// part. -// -typedef pair > URIPartPair; -typedef map ResCache; - -class IResWriter -{ -public: - IResWriter(){} - - virtual ~IResWriter(){} - - virtual HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pWriter - ) = 0; - - virtual HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) = 0; - - virtual HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ) = 0; - -}; - -class CFileResourceCache -{ -public: - CFileResourceCache(); - - virtual ~CFileResourceCache(); - - HRESULT - GetURI( - _In_z_ BSTR bstrResName, - _Outptr_ BSTR* pbstrURI - ); - - template - HRESULT - WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -protected: - BOOL - Cached( - _In_z_ BSTR bstrResName - ); - -private: - ResCache m_resMap; -}; - -// -// Explicitly instantiate the IPartFont, IPartImage and IPartColorProfile WriteResource template functions -// -template -HRESULT -CFileResourceCache::WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -template -HRESULT -CFileResourceCache::WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -template -HRESULT -CFileResourceCache::WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - -template -HRESULT -CFileResourceCache::WriteResource( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ IResWriter* pResWriter - ); - diff --git a/print/XPSDrvSmpl/src/filters/common/rescpy.cpp b/print/XPSDrvSmpl/src/filters/common/rescpy.cpp deleted file mode 100644 index 2f56349c..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescpy.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - rescpy.cpp - -Abstract: - - Page resource copy class implementation. This class stores resources - from one page and copies them to a destination. This is required when - copying page markup into a new page - without doing so any resources - referenced in the source page are lost. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "rescpy.h" - -/*++ - -Routine Name: - - CResourceCopier::CResourceCopier - -Routine Description: - - CResourceCopier class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CResourceCopier::CResourceCopier() -{ -} - -/*++ - -Routine Name: - - CResourceCopier::~CResourceCopier - -Routine Description: - - CResourceCopier class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CResourceCopier::~CResourceCopier() -{ -} - -/*++ - -Routine Name: - - CResourceCopier::CopyPageResources - -Routine Description: - - This routine takes a source page and copies all resources to a destination page. - This is required when a filter copies mark-up to a new FixedPage part else the - resources for the mark-up will be lost. - -Arguments: - - pFPSrc - Pointer to the source IFixedPage interface - pFPDst - Pointer to the destination IFixedPage interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CResourceCopier::CopyPageResources( - _In_ CONST IFixedPage* pFPSrc, - _Inout_ IFixedPage* pFPDst - ) -{ - HRESULT hr = S_OK; - CComPtr pXpsPartIt(NULL); - - if (SUCCEEDED(hr = CHECK_POINTER(pFPSrc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFPDst, E_POINTER)) && - SUCCEEDED(hr = const_cast(pFPSrc)->GetXpsPartIterator(&pXpsPartIt))) - { - pXpsPartIt->Reset(); - while (!pXpsPartIt->IsDone() && - SUCCEEDED(hr)) - { - CComBSTR bstrPartURI; - CComPtr pXPSPart(NULL); - - if (SUCCEEDED(hr = pXpsPartIt->Current(&bstrPartURI, &pXPSPart))) - { - hr = pFPDst->SetPagePart(pXPSPart); - - pXpsPartIt->Next(); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/rescpy.h b/print/XPSDrvSmpl/src/filters/common/rescpy.h deleted file mode 100644 index 27dde831..00000000 --- a/print/XPSDrvSmpl/src/filters/common/rescpy.h +++ /dev/null @@ -1,40 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - rescpy.h - -Abstract: - - Page resource copy class definition. This class stores resources - from one page and copies them to a destination. This is required when - copying page markup into a new page - without doing so any resources - referenced in the source page are lost. - ---*/ - -#pragma once - -class CResourceCopier -{ -public: - CResourceCopier(); - - virtual ~CResourceCopier(); - - HRESULT - CopyPageResources( - _In_ CONST IFixedPage* pFPSrc, - _Inout_ IFixedPage* pFPDst - ); -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp b/print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp deleted file mode 100644 index bca931a5..00000000 --- a/print/XPSDrvSmpl/src/filters/common/saxhndlr.cpp +++ /dev/null @@ -1,586 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - saxhndlr.cpp - -Abstract: - - Default sax handler implementation. Provides default implementations - for the ISAXContentHandler. This allows derived classes to only need - to implement the methods that are required. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "saxhndlr.h" -#include "widetoutf8.h" - -/*++ - -Routine Name: - - CSaxHandler::CSaxHandler - -Routine Description: - - CSaxHandler class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CSaxHandler::CSaxHandler() : - CUnknown(IID_ISAXContentHandler) -{ -} - -/*++ - -Routine Name: - - CSaxHandler::~CSaxHandler - -Routine Description: - - CSaxHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CSaxHandler::~CSaxHandler() -{ -} - -/*++ - -Routine Name: - - CSaxHandler::putDocumentLocator - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::putDocumentLocator - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::putDocumentLocator( - ISAXLocator * - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::startDocument - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::startDocument - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::startDocument( - void - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::endDocument - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::endDocument - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::endDocument( - void - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::startPrefixMapping - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::startPrefixMapping - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::startPrefixMapping( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::endPrefixMapping - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::endPrefixMapping - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::endPrefixMapping( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::startElement - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::startElement - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_ ISAXAttributes* - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::endElement - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::endElement - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::characters - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::characters - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::characters( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::ignorableWhitespace - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::ignorableWhitespace - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::ignorableWhitespace( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::processingInstruction - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::processingInstruction - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::processingInstruction( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::skippedEntity - -Routine Description: - - This routine is the default implementation for ISAXContentHandler::skippedEntity - -Arguments: - - Unused - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT STDMETHODCALLTYPE -CSaxHandler::skippedEntity( - CONST wchar_t*, - INT - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CSaxHandler::WriteToPrintStream - -Routine Description: - - This routine converts a CStringXDW buffer to UTF-8 string to be - written to the write stream provided. This overload handles accepts - an IPrintWriteStream to write the data out. - -Arguments: - - pcstrOut - Pointer to the Atl CStringXDW containing the mark-up to be written - pWriter - Pointer to the print write stream to write to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CSaxHandler::WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - ULONG cbWritten = 0; - PVOID pData = NULL; - ULONG cbData = 0; - - try - { - CWideToUTF8 wideToUTF8(pcstrOut); - - if (SUCCEEDED(hr = wideToUTF8.GetBuffer(&pData, &cbData))) - { - hr = pWriter->WriteBytes(pData, cbData, &cbWritten); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CSaxHandler::WriteToPrintStream - -Routine Description: - - This routine converts a CStringXDW buffer to UTF-8 string to be - written to the write stream provided. This overload handles accepts - an ISequentialStream to write the data out. - -Arguments: - - pcstrOut - Pointer to the Atl CStringXDW containing the mark-up to be written - pWriter - Pointer to the print write stream to write to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CSaxHandler::WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ ISequentialStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - ULONG cbWritten = 0; - PVOID pData = NULL; - ULONG cbData = 0; - - try - { - CWideToUTF8 wideToUTF8(pcstrOut); - - if (SUCCEEDED(hr = wideToUTF8.GetBuffer(&pData, &cbData))) - { - hr = pWriter->Write(pData, cbData, &cbWritten); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - - - -/*++ - -Routine Name: - - CSaxHandler::EscapeEntity - -Routine Description: - - The UnicodeString mark-up could contain characters that need to be escaped (the - SAX handler is passed the characters and not the original escapes). - The list of characters which need to be escaped are defined in the XML standard - and may change in future revisions. - This routine takes a BSTR and replaces all instances of these characters with - their escaped versions. - -Arguments: - - pStr - Pointer to the BSTR to be converted - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CSaxHandler::EscapeEntity( - _Inout_ BSTR* pStr - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pStr, E_POINTER))) - { - try - { - if (SysStringLen(*pStr) > 0) - { - CStringXDW cstrStr(*pStr); - - cstrStr.Replace(L"&", L"&"); - cstrStr.Replace(L"<", L"<"); - cstrStr.Replace(L">", L">"); - cstrStr.Replace(L"\"", L"""); - cstrStr.Replace(L"'", L"'"); - - SysFreeString(*pStr); - *pStr = cstrStr.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/saxhndlr.h b/print/XPSDrvSmpl/src/filters/common/saxhndlr.h deleted file mode 100644 index 33b142e1..00000000 --- a/print/XPSDrvSmpl/src/filters/common/saxhndlr.h +++ /dev/null @@ -1,129 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - saxhndlr.h - -Abstract: - - Default sax handler definition. Provides default implementations - for the ISAXContentHandler. This allows derived classes to only need - to implement the methods that are required. - ---*/ - -#pragma once - -#include "CUnknown.h" - -class CSaxHandler : public CUnknown -{ -public: - CSaxHandler(); - - virtual ~CSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - putDocumentLocator( - ISAXLocator * - ); - - virtual HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - - virtual HRESULT STDMETHODCALLTYPE - endDocument( - void - ); - - virtual HRESULT STDMETHODCALLTYPE - startPrefixMapping( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - endPrefixMapping( - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_ ISAXAttributes* - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - characters( - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - ignorableWhitespace( - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - processingInstruction( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT - ); - - virtual HRESULT STDMETHODCALLTYPE - skippedEntity( - CONST wchar_t*, - INT - ); - -protected: - HRESULT - WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ); - - HRESULT - WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ ISequentialStream* pWriter - ); - - HRESULT - EscapeEntity( - _Inout_ BSTR* pStr - ); -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp b/print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp deleted file mode 100644 index 39a207a5..00000000 --- a/print/XPSDrvSmpl/src/filters/common/widetoutf8.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - widetoutf8.cpp - -Abstract: - - The CWideToUTF8 class converts a Unicode character string into the UTF-8 code page format. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "widetoutf8.h" - -/*++ - -Routine Name: - - CWideToUTF8::CWideToUTF8 - -Routine Description: - - CWideToUTF8 class constructor - -Arguments: - - pcstrWide - Unicode string to be converted to UTF8. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWideToUTF8::CWideToUTF8( - CStringXDW* pcstrWide - ) : - m_pcstrWide(pcstrWide), - m_pMultiByte(NULL) -{ - HRESULT hr = CHECK_POINTER(m_pcstrWide, E_POINTER); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWideToUTF8::~CWideToUTF8 - -Routine Description: - - CWideToUTF8 class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWideToUTF8::~CWideToUTF8() -{ - FreeBuffer(); -} - -/*++ - -Routine Name: - - CWideToUTF8::GetBuffer - -Routine Description: - - This method retrieves a pointer to the UTF8 converted character buffer for the CWideToUTF8 object. - -Arguments: - - ppBuffer - pointer to a pointer to the buffer. - pcbBuffer - size of the buffer that was returned. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWideToUTF8::GetBuffer( - _Outptr_ PVOID* ppBuffer, - _Out_ ULONG* pcbBuffer - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppBuffer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbBuffer, E_POINTER))) - { - FreeBuffer(); - - try - { - INT cbMultiByte = WideCharToMultiByte(CP_UTF8, - 0, - m_pcstrWide->GetBuffer(), - m_pcstrWide->GetLength(), - NULL, - 0, - NULL, - NULL); - - if (cbMultiByte > 0) - { - m_pMultiByte = new(std::nothrow) CHAR[cbMultiByte]; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pMultiByte, E_OUTOFMEMORY))) - { - if (WideCharToMultiByte(CP_UTF8, - 0, - m_pcstrWide->GetBuffer(), - m_pcstrWide->GetLength(), - m_pMultiByte, - cbMultiByte, - NULL, - NULL) > 0) - { - *ppBuffer = m_pMultiByte; - *pcbBuffer = cbMultiByte; - } - else - { - hr = E_FAIL; - } - } - } - else - { - hr = E_FAIL; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWideToUTF8::FreeBuffer - -Routine Description: - - Releases the memory that was allocated for the string buffer during a call to CWideToUTF8::GetBuffer. - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CWideToUTF8::FreeBuffer() -{ - if (m_pMultiByte != NULL) - { - delete[] m_pMultiByte; - m_pMultiByte = NULL; - } -} - diff --git a/print/XPSDrvSmpl/src/filters/common/widetoutf8.h b/print/XPSDrvSmpl/src/filters/common/widetoutf8.h deleted file mode 100644 index 9bae001a..00000000 --- a/print/XPSDrvSmpl/src/filters/common/widetoutf8.h +++ /dev/null @@ -1,48 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - widetoutf8.h - -Abstract: - - The CWideToUTF8 class converts a Unicode character string into the UTF-8 code page format. - ---*/ - -#pragma once - -class CWideToUTF8 -{ -public: - CWideToUTF8( - CStringXDW* pcstrWide - ); - - virtual ~CWideToUTF8(); - - HRESULT - GetBuffer( - _Outptr_ PVOID* ppBuffer, - _Out_ ULONG* pcbBuffer - ); - -private: - VOID - FreeBuffer(); - -private: - CStringXDW* m_pcstrWide; - - PSTR m_pMultiByte; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj b/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj deleted file mode 100644 index 192dab63..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj +++ /dev/null @@ -1,561 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {0F8262C1-75D8-4A92-BCB6-37A290891708} - $(MSBuildProjectName) - false - true - Debug - Win32 - {308C4F37-78C7-4A5B-82A5-303C05764FB6} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - %(AdditionalIncludeDirectories);..\xdcont - - - - xdfltcmn - - - xdfltcmn - - - xdfltcmn - - - xdfltcmn - - - xdfltcmn - - - xdfltcmn - - - xdfltcmn - - - xdfltcmn - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj.Filters deleted file mode 100644 index 505d9ff4..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdfltcmn.vcxproj.Filters +++ /dev/null @@ -1,163 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {3569C0F7-AC20-44FD-9CA8-9C48594440AD} - - - h;hpp;hxx;hm;inl;inc;xsd - {1187C371-A1BD-44D6-8827-8FCC4E2D6F4B} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {CC77C845-B29A-4778-BAE1-962D34312C2A} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp b/print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp deleted file mode 100644 index 6fa2b0ed..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdrchflt.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdrchflt.cpp - -Abstract: - - Base Xps filter implementation. The CXDXpsFilter provides common filter - functionality for Xps filters. It provides default handlers for part - handlers that set print tickets appropriately through the PrintTicket - manager class. This allows derived classes to implement only the part - handlers that they require (for example, the watermark filter is only - interested in the fixed page, and leaves all other parts to be handled - by this class). The class implements IPrintPipelineFilter::StartOperation - which is responsible for retrieving parts from the Xps provider and - dispatching them to the relevant part handler. It is also responsible for - intialising the Xps provider and consumer. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdrchflt.h" - -/*++ - -Routine Name: - - CXDXpsFilter::CXDXpsFilter - -Routine Description: - - CXDXpsFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDXpsFilter::CXDXpsFilter() : - m_pXDReader(NULL), - m_pXDWriter(NULL) -{ - VERBOSE("Constructing Xps filter\n"); -} - -/*++ - -Routine Name: - - CXDXpsFilter::~CXDXpsFilter - -Routine Description: - - CXDXpsFilter class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDXpsFilter::~CXDXpsFilter() -{ - VERBOSE("Destroying Xps filter\n"); -} - -/*++ - -Routine Name: - - CXDXpsFilter::StartOperation - -Routine Description: - - This is the XPS Doxument interface implementation of IPrintPipelineFilter::StartOperation - shared by all XPS Document filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::StartOperation( - VOID - ) -{ - VERBOSE("Starting filter operation.\n"); - - HRESULT hr = S_OK; - BOOL bDoCoUninitialize = FALSE; - - if (SUCCEEDED(hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) - { - bDoCoUninitialize = TRUE; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = InitialiseXDIO()) && - SUCCEEDED(hr = InitializePrintTicketManager())) - { - CComPtr pUnk(NULL); - - while (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pXDReader->GetXpsPart(&pUnk)) && - pUnk != NULL && - !m_bFilterFinished) - { - CComPtr pXD(NULL); - CComPtr pFDS(NULL); - CComPtr pFD(NULL); - CComPtr pFP(NULL); - - // - // Query interface to find the part type and pass to the - // appropriate part handler - // - if (SUCCEEDED(pUnk.QueryInterface(&pXD))) - { - hr = ProcessPart(pXD); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFDS))) - { - hr = ProcessPart(pFDS); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFD))) - { - hr = ProcessPart(pFD); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFP))) - { - hr = ProcessPart(pFP); - } - else - { - // - // Unrecognised part - send as unknown. - // - hr = m_pXDWriter->SendXpsUnknown(pUnk); - } - - // - // Must call release since pUnk is declared outside of the while loop - // - pUnk.Release(); - } - - if (SUCCEEDED(hr)) - { - // - // Call finalize letting derived classes know we have - // processed all parts - // - hr = Finalize(); - } - - // - // Close the xps package consumer - // - m_pXDWriter->CloseSender(); - } - - // - // If the filter failed make sure we shutdown the pipeline - // - if (FAILED(hr)) - { - if (m_bFilterFinished) - { - // - // Filter is already closing down so report S_OK - // - hr = S_OK; - } - else - { - // - // Request the pipeline manager shutdown the filter - // - ERR("Requesting filter shutdown\n"); - RequestShutdown(hr); - } - } - - // - // Let the filter pipe manager know the filter is finished - // - if (bDoCoUninitialize) - { - CoUninitialize(); - } - - FilterFinished(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default XPS document part handler - -Arguments: - - pXD - Pointer to the IXPSDocument interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IXpsDocument* pXD - ) -{ - VERBOSE("Processing XPS Document part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXD, E_POINTER))) - { - hr = m_pXDWriter->SendXpsDocument(pXD); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default fixed document sequence part handler - -Arguments: - - pFDS - Pointer to the IFixedDocumentSequence interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ) -{ - VERBOSE("Processing Fixed Document Sequence part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - // - // Default handler: Set the PT and send the doc sequence - // - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFDS))) - { - hr = m_pXDWriter->SendFixedDocumentSequence(pFDS); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default fixed document part handler - -Arguments: - - pFD - Pointer to the IFixedDocument interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IFixedDocument* pFD - ) -{ - VERBOSE("Processing Fixed Document part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER))) - { - // - // Default handler: Set the PT and send the doc - // - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFD))) - { - hr = m_pXDWriter->SendFixedDocument(pFD); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDXpsFilter::ProcessPart - -Routine Description: - - This routine is the default fixed page handler - -Arguments: - - pFP - Pointer to the IFixedPage interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - // - // Default handler: No ticket required, just send the page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CXDXpsFilter::Finalize - -Routine Description: - - This method is the default finalize method called when all parts in the XPS document - have been processed - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::Finalize( - VOID - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CXDXpsFilter::InitialiseXDIO - -Routine Description: - - This routine initialises the XPS producer and consumer interfaces used by - all XPS document filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDXpsFilter::InitialiseXDIO( - VOID - ) -{ - VERBOSE("Retrieving Xps producer and consumer.\n"); - - HRESULT hr = S_OK; - - // - // Ensure the produver and consumer are released - // - m_pXDReader = NULL; - m_pXDWriter = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pInterFltrComm, E_PENDING))) - { - // - // Get the producer and consumer from the filter communicator - // - if (SUCCEEDED(hr = m_pInterFltrComm->RequestReader(reinterpret_cast(&m_pXDReader)))) - { - hr = m_pInterFltrComm->RequestWriter(reinterpret_cast(&m_pXDWriter)); - } - - // - // If anything went wrong, ensure the produver and consumer are released - // - if (FAILED(hr)) - { - m_pXDReader = NULL; - m_pXDWriter = NULL; - } - } - - // - // Check interface is as expected. If not then it is likely that - // the wrong GUID has been defined in the filter configuration file - // - if (SUCCEEDED(hr)) - { - CComPtr pReaderCheck(NULL); - CComPtr pWriterCheck(NULL); - - if (FAILED(m_pXDReader.QueryInterface(&pReaderCheck)) || - FAILED(m_pXDWriter.QueryInterface(&pWriterCheck))) - { - RIP("Invalid reader and writer defined - check GUIDs in the filter configuration file\n"); - - // - // Request the pipeline manager shutsdown the filter - // - hr = E_FAIL; - RequestShutdown(hr); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/xdrchflt.h b/print/XPSDrvSmpl/src/filters/common/xdrchflt.h deleted file mode 100644 index eeb6e4c9..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdrchflt.h +++ /dev/null @@ -1,86 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdrchflt.h - -Abstract: - - Base Xps filter definition. The CXDXpsFilter provides common filter - functionality for Xps filters. It provides default handlers for part - handlers that set print tickets appropriately through the PrintTicket - manager class. This allows derived classes to implement only the part - handlers that they require (for example, the watermark filter is only - interested in the fixed page, and leaves all other parts to be handled - by this class). The class implements IPrintPipelineFilter::StartOperation - which is responsible for retrieving parts from the Xps provider and - dispatching them to the relevant part handler. It is also responsible for - intialising the Xps provider and consumer. - ---*/ - -#pragma once - -#include "xdsmplflt.h" -#include "rescache.h" - -class CXDXpsFilter : public CXDSmplFilter -{ -public: - CXDXpsFilter(); - - virtual ~CXDXpsFilter(); - -protected: - virtual HRESULT STDMETHODCALLTYPE - StartOperation( - VOID - ); - - virtual HRESULT - ProcessPart( - _Inout_ IXpsDocument* pXD - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocument* pFD - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - virtual HRESULT - Finalize( - VOID - ); - - virtual HRESULT - InitialiseXDIO( - VOID - ); - -protected: - CComPtr m_pXDReader; - - CComPtr m_pXDWriter; - - CFileResourceCache m_resCache; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp b/print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp deleted file mode 100644 index cce45ac6..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.cpp +++ /dev/null @@ -1,319 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplflt.cpp - -Abstract: - - Base filter class for stream and Xps filters. This class implements - the IPrintPipelineFilter methods common to both Xps and stream filters. - -Known Issues: - - Request shutdown does not pass an IImgErrorInfo pointer - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdsmplflt.h" - -/*++ - -Routine Name: - - CXDSmplFilter::CXDSmplFilter - -Routine Description: - - CXDSmplFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplFilter::CXDSmplFilter() : - CUnknown(IID_IPrintPipelineFilter), - m_bFilterFinished(FALSE) -{ - VERBOSE("Constructing filter\n"); -} - - -/*++ - -Routine Name: - - CXDSmplFilter::~CXDSmplFilter - -Routine Description: - - CXDSmplFilter class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplFilter::~CXDSmplFilter() -{ - VERBOSE("Destroying filter\n"); - - // - // Make sure FilterFinished() is called - // - FilterFinished(); -} - -/*++ - -Routine Name: - - CXDSmplFilter::InitializeFilter - -Routine Description: - - This is the IPrintPipelineFilter::InitializeFilter implementation used - by all XPS document interface filters. This is called by the print filter - pipeline manager before IPrintPipelineFilter::StartOperation. - -Arguments: - - pIInterFilterCommunicator - Pointer to the inter filter communicator - pIPropertyBag - Pointer to the property bag - pIPipelineControl - Pointer to the pipeline control interface - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplFilter::InitializeFilter( - _In_ IInterFilterCommunicator* pIInterFilterCommunicator, - _In_ IPrintPipelinePropertyBag* pIPropertyBag, - _In_ IPrintPipelineManagerControl* pIPipelineControl - ) -{ - VERBOSE("Initializing filter\n"); - - HRESULT hr = S_OK; - - if (FAILED(hr = CHECK_POINTER(pIInterFilterCommunicator, E_POINTER)) || - FAILED(hr = CHECK_POINTER(pIPropertyBag, E_POINTER)) || - FAILED(hr = CHECK_POINTER(pIPipelineControl, E_POINTER))) - { - RequestShutdown(hr); - } - else - { - m_pPrintPipeManager = pIPipelineControl; - m_pInterFltrComm = pIInterFilterCommunicator; - m_pPrintPropertyBag = pIPropertyBag; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplFilter::ShutdownOperation - -Routine Description: - - This is the IPrintPipelineFilter::ShutdownOperation implementation used - by all XPS document interface filters. This is called by the print filter - pipeline manager when the filter is complete or an error forces the - pipeline to be shutdown - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplFilter::ShutdownOperation( - VOID - ) -{ - VERBOSE("Shutting down filter\n"); - - FilterFinished(); - return S_OK; -} - -/*++ - -Routine Name: - - CXDSmplFilter::FilterFinished - -Routine Description: - - This routine is called when the filter is finished. Filter finished should - only be called once so this routine protects against multiple calls from the - same filter. - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CXDSmplFilter::FilterFinished( - VOID - ) -{ - if (!m_bFilterFinished) - { - VERBOSE("Finishing filter\n"); - - if (m_pPrintPipeManager != NULL) - { - m_pPrintPipeManager->FilterFinished(); - m_bFilterFinished = TRUE; - } - } -} - -/*++ - -Routine Name: - - CXDSmplFilter::RequestShutdown - -Routine Description: - - This routine lets derived classes request the filter to shutdown - without having to know about the pipeline manager explicitly - -Arguments: - - hr - The HRESULT value to be passed to the pipeline managers RequestShutdown method. - -Return Value: - - None - ---*/ -VOID -CXDSmplFilter::RequestShutdown( - _In_ HRESULT hr - ) -{ - VERBOSE("Requesting shutdown\n"); - - if (m_pPrintPipeManager != NULL) - { -#pragma prefast(suppress:__WARNING_INVALID_PARAM_VALUE_1, "MSDN requires that pReason be NULL.") - m_pPrintPipeManager->RequestShutdown(hr, NULL); - } -} - -/*++ - -Routine Name: - - CXDSmplFilter::InitializePrintTicketManager - -Routine Description: - - This routine initializes the PrintTicket manager with the default devmode - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplFilter::InitializePrintTicketManager( - VOID - ) -{ - ASSERTMSG(m_pPrintPropertyBag != NULL, "NULL property bag pointer\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPrintPropertyBag, E_PENDING))) - { - // - // Get the printer name and user PrintTicket from the property bag - // - CComVariant varName; - CComVariant varPTReadStreamFactory; - - // - // Avoid CComVariant if getting the XPS_FP_USER_TOKEN property. - // Please refer to http://go.microsoft.com/fwlink/?LinkID=255534 for detailed information. - // - VARIANT varUserToken; - VariantInit(&varUserToken); - - if (SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_USER_PRINT_TICKET, &varPTReadStreamFactory)) && - SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_PRINTER_NAME, &varName)) && - SUCCEEDED(hr = m_pPrintPropertyBag->GetProperty(XPS_FP_USER_TOKEN, &varUserToken))) - { - // - // Retrieve the PrintReadStream for the user PrintTicket - // - CComPtr pUnk(varPTReadStreamFactory.punkVal); - CComPtr pPrintReadStreamFactory(NULL); - CComPtr pPrintReadStream(NULL); - if (SUCCEEDED(hr = pUnk.QueryInterface(&pPrintReadStreamFactory)) && - SUCCEEDED(hr = pPrintReadStreamFactory->GetStream(&pPrintReadStream))) - { - // - // Initialise the PT manager with the user PrintTicket and device name - // - hr = m_ptManager.Initialise(pPrintReadStream, varName.bstrVal, varUserToken.byref); - } - } - - VariantClear(&varUserToken); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.h b/print/XPSDrvSmpl/src/filters/common/xdsmplflt.h deleted file mode 100644 index b4903b4e..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdsmplflt.h +++ /dev/null @@ -1,77 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplflt.h - -Abstract: - - Base filter class for stream and Xps filters. This class implements - the IPrintPipelineFilter methods common to both Xps and stream filters. - ---*/ - -#pragma once - -#include "cunknown.h" -#include "ptmanage.h" - -class CXDSmplFilter : public CUnknown -{ -public: - CXDSmplFilter(); - - virtual ~CXDSmplFilter(); - - // - // IImgPipelineFilter methods - // - virtual HRESULT STDMETHODCALLTYPE - InitializeFilter( - _In_ IInterFilterCommunicator* pINegotiation, - _In_ IPrintPipelinePropertyBag* pIPropertyBag, - _In_ IPrintPipelineManagerControl* pIPipelineControl - ); - - virtual HRESULT STDMETHODCALLTYPE - ShutdownOperation( - VOID - ); - -protected: - VOID - FilterFinished( - VOID - ); - - VOID - RequestShutdown( - _In_ HRESULT hr - ); - - HRESULT - InitializePrintTicketManager( - VOID - ); - -protected: - CComPtr m_pInterFltrComm; - - CComPtr m_pPrintPipeManager; - - CComPtr m_pPrintPropertyBag; - - CPTManager m_ptManager; - - BOOL m_bFilterFinished; -}; - diff --git a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp b/print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp deleted file mode 100644 index da8d6a5e..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/*++ - -Copyright (C) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdstrmflt.cpp - -Abstract: - - Base stream filter implementation. This provides stream interface specific - functionality general to all filters that use the stream interface to process - fixed pages. The class is responsible copying data from reader to writer in the - absence of the PK archive handling module, for a default fixed page processing - function (filters should implement their own to manipulate fixed page markup) - and for initialising the stream reader and writer. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstrmflt.h" - -/*++ - -Routine Name: - - CXDStreamFilter::CXDStreamFilter - -Routine Description: - - CXDStreamFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDStreamFilter::CXDStreamFilter() : - m_pStreamReader(NULL), - m_pStreamWriter(NULL) -{ - VERBOSE("Constructing stream filter\n"); -} - -/*++ - -Routine Name: - - CXDStreamFilter::~CXDStreamFilter - -Routine Description: - - CXDStreamFilter clsas destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDStreamFilter::~CXDStreamFilter() -{ - VERBOSE("Destroying stream filter\n"); -} - -/*++ - -Routine Name: - - CXDStreamFilter::StartOperation - -Routine Description: - - This is the stream interface implementation of IPrintPipelineFilter::StartOperation - shared by all stream interface filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDStreamFilter::StartOperation( - VOID - ) -{ - VERBOSE("Starting stream filter operation.\n"); - - HRESULT hr = S_OK; - BOOL bDoCoUninitialize = FALSE; - - if (SUCCEEDED(hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) - { - bDoCoUninitialize = TRUE; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = InitialiseStreamIO()) && - SUCCEEDED(hr = InitializePrintTicketManager())) - { - try - { - CXPSProcessor* pXpsProcessor = new(std::nothrow) CXPSProcessor(m_pStreamReader, m_pStreamWriter, this, m_pPrintPropertyBag, &m_ptManager); - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsProcessor, E_OUTOFMEMORY))) - { - hr = pXpsProcessor->Start(); - } - - if (pXpsProcessor != NULL) - { - delete pXpsProcessor; - pXpsProcessor = NULL; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (hr == E_NOINTERFACE) - { - // - // The PK archive handler is missing - just pass the data on - // - - if (SUCCEEDED(hr = CHECK_POINTER(m_pStreamReader, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pStreamWriter, E_POINTER))) - { - ULONG cbRead = 0; - BOOL bEOF = FALSE; - - PBYTE pBuff = new(std::nothrow) BYTE[CB_COPY_BUFFER]; - - if (SUCCEEDED(hr = CHECK_POINTER(pBuff, E_OUTOFMEMORY))) - { - do - { - if (SUCCEEDED(hr = m_pStreamReader->ReadBytes(pBuff, CB_COPY_BUFFER, &cbRead, &bEOF))) - { - ULONG cbWritten = 0; - hr = m_pStreamWriter->WriteBytes(pBuff, cbRead, &cbWritten); - } - } - while (SUCCEEDED(hr) && - !bEOF && - cbRead > 0); - - delete[] pBuff; - pBuff = NULL; - } - } - } - } - - if (m_pStreamWriter) - { - m_pStreamWriter->Close(); - } - - // - // If the filter failed make sure we shutdown the pipeline - // - if (FAILED(hr)) - { - if (m_bFilterFinished) - { - // - // Filter is already closing down so report S_OK - // - hr = S_OK; - } - else - { - // - // Request the pipeline manager shutdown the filter - // - ERR("Requesting filter shutdown\n"); - RequestShutdown(hr); - } - } - - // - // Let the filter pipe manager know the filter is finished - // - if (bDoCoUninitialize) - { - CoUninitialize(); - } - - FilterFinished(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDStreamFilter::ProcessFixedPage - -Routine Description: - - This routine is the default implemenation of the fixed page processor called by - the XPS processor object. - -Arguments: - - pFPPT - Pointer to the fixed page PrintTicket - pPageReadStream - Pointer to the page read stream - pPageWriteStream - Pointer to the page write stream - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDStreamFilter::ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ) -{ - VERBOSE("Processing stream fixed page with default handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFPPT, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPageReadStream, E_POINTER))) - { - hr = CHECK_POINTER(pPageWriteStream, E_POINTER); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDStreamFilter::InitialiseStreamIO - -Routine Description: - - This routine initialises the print stream read and write interfaces used by - all stream filters - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDStreamFilter::InitialiseStreamIO( - VOID - ) -{ - VERBOSE("Retrieving stream reader and writer.\n"); - - HRESULT hr = S_OK; - - // - // Make sure the reader and writer are released - // - m_pStreamReader = NULL; - m_pStreamWriter = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pInterFltrComm, E_PENDING))) - { - // - // Get the reader and writer from the filter communicator - // - if (SUCCEEDED(hr = m_pInterFltrComm->RequestReader(reinterpret_cast(&m_pStreamReader)))) - { - hr = m_pInterFltrComm->RequestWriter(reinterpret_cast(&m_pStreamWriter)); - } - - // - // If anything went wrong, make sure the reader and writer - // have been released - // - if (FAILED(hr)) - { - m_pStreamReader = NULL; - m_pStreamWriter = NULL; - } - } - - // - // Check interface is as expected. If not then it is likely that - // the wrong GUID has been defined in the filter configuration file - // - if (SUCCEEDED(hr)) - { - CComPtr pReaderCheck(NULL); - CComPtr pWriterCheck(NULL); - - if (FAILED(m_pStreamReader.QueryInterface(&pReaderCheck)) || - FAILED(m_pStreamWriter.QueryInterface(&pWriterCheck))) - { - RIP("Invalid reader and writer defined - check GUIDs in the filter configuration file\n"); - - // - // Request the pipeline manager shutsdown the filter - // - hr = E_FAIL; - RequestShutdown(hr); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.h b/print/XPSDrvSmpl/src/filters/common/xdstrmflt.h deleted file mode 100644 index 64489672..00000000 --- a/print/XPSDrvSmpl/src/filters/common/xdstrmflt.h +++ /dev/null @@ -1,63 +0,0 @@ -/*++ - -Copyright (C) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdstrmflt.h - -Abstract: - - Base stream filter definition. This provides stream interface specific - functionality general to all filters that use the stream interface to process - fixed pages. The class is responsible copying data from reader to writer in the - absence of the PK archive handling module, for a default fixed page processing - function (filters should implement their own to manipulate fixed page markup) - and for initialising the stream reader and writer. - ---*/ - -#pragma once - -#include "xdsmplflt.h" -#include "ptmanage.h" -#include "xpsproc.h" - -class CXDStreamFilter : public CXDSmplFilter, public IFixedPageProcessor -{ -public: - CXDStreamFilter(); - - virtual ~CXDStreamFilter(); - -protected: - virtual HRESULT STDMETHODCALLTYPE - StartOperation( - VOID - ); - - virtual HRESULT - ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ); - - HRESULT - InitialiseStreamIO( - VOID - ); - -protected: - CComPtr m_pStreamReader; - - CComPtr m_pStreamWriter; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/dllentry.cpp b/print/XPSDrvSmpl/src/filters/nup/dllentry.cpp deleted file mode 100644 index 271afaaa..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/dllentry.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the NUp filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "nupflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the NUp filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 6B105794-3140-40ca-A94F-624AE00AC9E8 - // - CLSID nupCLSID = {0x6B105794, 0x3140, 0x40ca, {0xA9, 0x4F, 0x62, 0x4A, 0xE0, 0x0A, 0xC9, 0xE8}}; - - return GetFilterClassFactory(rclsid, riid, nupCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupflt.cpp b/print/XPSDrvSmpl/src/filters/nup/nupflt.cpp deleted file mode 100644 index b226ecc7..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupflt.cpp +++ /dev/null @@ -1,476 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupflt.cpp - -Abstract: - - NUp filter implementation. This class derives from the Xps filter class - and implements the necessary part handlers to support NUp printing. The - NUp filter is responsible for applying page transformations appropriate - to the NUp option selected. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "nupflt.h" -#include "nupsax.h" -#include "nupthndlr.h" -#include "bkpthndlr.h" -#include "psizepthndlr.h" -#include "porientpthndlr.h" - - -using XDPrintSchema::NUp::NUpData; - -using XDPrintSchema::Binding::BindingData; - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; - -using XDPrintSchema::PageOrientation::PageOrientationData; - -/*++ - -Routine Name: - - CNUpFilter::CNUpFilter - -Routine Description: - - Default constructor for the nup filter which ensures GDI plus is correctly running - and initialises the CNUpFilter variables to sensible defaults - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpFilter::CNUpFilter() : - m_bSendAllDocs(TRUE), - m_pNUpPage(NULL), - m_nupScope(CNUpPTProperties::None) -{ - ASSERTMSG(m_gdiPlus.GetGDIPlusStartStatus() == Ok, "GDI plus is not correctly initialized.\n"); -} - -/*++ - -Routine Name: - - CNUpFilter::~CNUpFilter - -Routine Description: - - Default destructor for the color management filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpFilter::~CNUpFilter() -{ - DeleteNUpPage(); -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document sequence part in a container - -Arguments: - - pFDS - Pointer to the fixed document sequence to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ) -{ - VERBOSE("Processing Fixed Document Sequence part with NUpFilter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFDS, E_POINTER))) - { - // - // Get the PT manager to return the correct ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFDS)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTJobScope, &pPT))) - { - hr = CreateNUpPage(pPT); - } - } - - if (SUCCEEDED(hr)) - { - hr = m_pXDWriter->SendFixedDocumentSequence(pFDS); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed document part in a container - -Arguments: - - pFD - Pointer to the fixed document to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::ProcessPart( - _Inout_ IFixedDocument* pFD - ) -{ - VERBOSE("Processing Fixed Document part with NUpFilter handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFD, E_POINTER)) && - SUCCEEDED(hr = m_ptManager.SetTicket(pFD))) - { - // - // If we are in a JobNUpAllDocumentsContiguously session we want to maintain the current - // JobNUpAllDocumentsContiguously settings so keep the current NUp page object - // - if (m_nupScope != CNUpPTProperties::Job) - { - // - // Get the PT manager to return the correct ticket. - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.GetTicket(kPTDocumentScope, &pPT))) - { - hr = CreateNUpPage(pPT); - } - } - } - - if (SUCCEEDED(hr) && - m_bSendAllDocs) - { - hr = m_pXDWriter->SendFixedDocument(pFD); - - // - // If we are JobNUpAllDocumentsContiguously we only ever send one doc - now we have - // sent the first document we can test to see if we need to - // send all of them - // - if (m_nupScope == CNUpPTProperties::Job) - { - m_bSendAllDocs = FALSE; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with NUpFilter handler\n"); - - ASSERTMSG(m_pXDWriter != NULL, "NULL consumer pointer\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pXDWriter, E_PENDING))) - { - if (m_pNUpPage != NULL) - { - // - // Add this pages contents to our NUp page - // - hr = m_pNUpPage->AddPageContent(m_pXDWriter, pFP); - } - else - { - // - // Just write out the fixed page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CNUpFilter::Finalize - -Routine Description: - - Method to close any pages which are still open as the last action of the filter - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpFilter::Finalize( - VOID - ) -{ - ASSERTMSG(m_pXDWriter != NULL, "NULL consumer pointer\n"); - - HRESULT hr = S_OK; - - if (m_pNUpPage != NULL) - { - // - // Close any open pages - we are done - // - hr = m_pNUpPage->ClosePage(m_pXDWriter); - DeleteNUpPage(); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpFilter::DeleteNUpPage - -Routine Description: - - Method to delete the current CNUpPage object - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CNUpFilter::DeleteNUpPage( - VOID - ) -{ - if (m_pNUpPage != NULL) - { - delete m_pNUpPage; - m_pNUpPage = NULL; - } -} - -/*++ - -Routine Name: - - CNUpFilter::CreateNUpPage - -Routine Description: - - Method to create a new nup page based on the settings specified in the PrintTicket - -Arguments: - - pPT - Pointer to the PrintTicket containing the nup driver settings - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CNUpFilter::CreateNUpPage( - _In_ IXMLDOMDocument2* pPT - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPT, E_POINTER))) - { - - try - { - // - // Retrieve the NUp, Booklet, PageMediaSize and PageOrientation data from the PT - // - NUpData nUpData; - BindingData bindingData; - PageMediaSizeData pageMediaSizeData; - PageOrientationData pageOrientData; - - CNUpPTHandler nUpPTHandler(pPT); - CBookPTHandler bkPTHandler(pPT); - CPageSizePTHandler pageSizePTHandler(pPT); - CPageOrientationPTHandler pageOrientPTHandler(pPT); - - // - // Try the booklet data first - // - if (FAILED(hr = bkPTHandler.GetData(&bindingData))) - { - // - // If booklet is not present try NUp settings - // - if (hr == E_ELEMENT_NOT_FOUND) - { - hr = nUpPTHandler.GetData(&nUpData); - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pageSizePTHandler.GetData(&pageMediaSizeData)) && - SUCCEEDED(hr = pageOrientPTHandler.GetData(&pageOrientData))) - { - CNUpPTProperties nUpProps(nUpData, bindingData, pageMediaSizeData, pageOrientData); - - UINT cNUp = 1; - if (SUCCEEDED(hr = nUpProps.GetScope(&m_nupScope)) && - SUCCEEDED(hr = nUpProps.GetCount(&cNUp)) && - m_nupScope != CNUpPTProperties::None && - cNUp > 1) - { - if (m_pNUpPage == NULL) - { - // - // Create a new NUp page - // - m_pNUpPage = new(std::nothrow) CNUpPage(&nUpProps, &m_resCopier); - - hr = CHECK_POINTER(m_pNUpPage, E_OUTOFMEMORY); - } - else if (m_nupScope == CNUpPTProperties::Document) - { - // - // Second or subsequent Document NUp session - close the page and set - // the new properties - // - if (SUCCEEDED(hr = m_pNUpPage->ClosePage(m_pXDWriter))) - { - hr = m_pNUpPage->SetProperties(&nUpProps); - } - } - } - else - { - // - // NUp is not set - Fail the request so the page is closed and deleted - // - hr = E_ELEMENT_NOT_FOUND; - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (hr == E_ELEMENT_NOT_FOUND) - { - // - // The relevant features are not present in the print ticket or contain unsupported values. - // Close and delete the NUp page if it is currently open and do not propogate the fail status. - // - hr = S_FALSE; - - if (m_pNUpPage != NULL) - { - hr = m_pNUpPage->ClosePage(m_pXDWriter); - } - - DeleteNUpPage(); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupflt.h b/print/XPSDrvSmpl/src/filters/nup/nupflt.h deleted file mode 100644 index 814d8021..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupflt.h +++ /dev/null @@ -1,88 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupflt.h - -Abstract: - - NUp filter definition. This class derives from the Xps filter - class and implements the necessary part handlers to support booklet - printing. The nup filter is responsible for applyinh page transofmations - appropriate to the NUp option selected. - -Known Issues: - - The filter uses PageMediaSize and not PageImageableSize to calculate the - canvas bounds - - The filter does not yet handle booklet offsets (gutter etc.) - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "nuppage.h" -#include "gdip.h" - -class CNUpFilter : public CXDXpsFilter -{ -public: - CNUpFilter(); - - virtual ~CNUpFilter(); - -private: - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocumentSequence* pFDS - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedDocument* pFD - ); - - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - HRESULT - Finalize( - VOID - ); - - VOID - DeleteNUpPage( - VOID - ); - - HRESULT - CreateNUpPage( - _In_ IXMLDOMDocument2* pPT - ); - -protected: - GDIPlus m_gdiPlus; - - CNUpPage* m_pNUpPage; - - BOOL m_bSendAllDocs; - - CNUpPTProperties::ENUpScope m_nupScope; - - CResourceCopier m_resCopier; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupflt.rc b/print/XPSDrvSmpl/src/filters/nup/nupflt.rc deleted file mode 100644 index f88d267c..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 Microsoft Corporation -// -// All rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// File Name: -// -// nupflt.rc -// -// Abstract: -// -// NUp filter resource file. -// -// - -#include -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample NUp Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/nup/nuppage.cpp b/print/XPSDrvSmpl/src/filters/nup/nuppage.cpp deleted file mode 100644 index f814d21a..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuppage.cpp +++ /dev/null @@ -1,581 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nuppage.cpp - -Abstract: - - NUp page implementation. This class is responsible for maintaining - the current NUp page. The public interface defines methods for adding - fixed page content and closing the current page. When a page is added, - the class uses a SAX handler to strip the FixedPage tags from the - source page, apply a canvas with a transformation and add it to the - current NUp page. When the page is full it is closed and sent and a new - NUp page is created. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "nuppage.h" -#include "nupsax.h" -#include "widetoutf8.h" - -static CONST PCWSTR pszOpenFPTag = L""; - -/*++ - -Routine Name: - - CNUpPage::CNUpPage - -Routine Description: - - Constructor for the CNUpPage class which initialises itself to sensible values - and creates a new page transformation - -Arguments: - - pNUpProps - Pointer to class containing nup settings from the PrintTicket - pResCopier - Pointer to page resource copy class used for copying markup between pages - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CNUpPage::CNUpPage( - _In_ CNUpPTProperties* pNUpProps, - _In_ CResourceCopier* pResCopier - ) : - m_pNUpProps(NULL), - m_pNUpTransform(NULL), - m_pWriter(NULL), - m_pFixedPage(NULL), - m_cCurrPageIndex(0), - m_cNUp(1), - m_pResCopier(pResCopier) -{ - HRESULT hr = S_OK; - ASSERTMSG(m_pResCopier != NULL, "Invalid resource copier\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpProps, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResCopier, E_POINTER))) - { - try - { - m_pNUpProps = new(std::nothrow) CNUpPTProperties(*pNUpProps); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pNUpProps, E_OUTOFMEMORY))) - { - m_pNUpTransform = new(std::nothrow) CNUpTransform(m_pNUpProps); - - hr = CHECK_POINTER(m_pNUpTransform, E_OUTOFMEMORY); - } - - if (SUCCEEDED(hr)) - { - hr = m_pNUpProps->GetCount(&m_cNUp); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - if (FAILED(hr)) - { - if (m_pNUpProps != NULL) - { - delete m_pNUpProps; - m_pNUpProps = NULL; - } - - if (m_pNUpTransform != NULL) - { - delete m_pNUpTransform; - m_pNUpTransform = NULL; - } - - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CNUpPage::~CNUpPage - -Routine Description: - - Default destructor for the CNUpPage class - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPage::~CNUpPage() -{ - DeleteProperties(); - DeleteTransform(); - - ASSERTMSG(m_pWriter == NULL, "Destroying NUp page with open page writer\n"); - ASSERTMSG(m_pFixedPage == NULL, "Destroying NUp page with open fixed page\n"); -} - -/*++ - -Routine Name: - - CNUpPage::AddPageContent - -Routine Description: - - Method to write out fixed page with a transformation matrix - -Arguments: - - pWriter - Pointer to a writer which the transformed fixed page will be sent to - pFP - Pointer to the fixed page to be transformed and written out - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::AddPageContent( - _In_ IXpsDocumentConsumer* pWriter, - _In_ IFixedPage* pFP - ) -{ - ASSERTMSG(m_pNUpTransform != NULL, "NULL transform object\n"); - ASSERTMSG(m_pNUpProps != NULL, "NULL NUp properties object\n"); - - HRESULT hr = S_OK; - - SizeF sizePage; - if (SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pNUpProps, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pNUpTransform, E_PENDING)) && - SUCCEEDED(hr = m_pNUpProps->GetPageSize(&sizePage)) && - m_pFixedPage == NULL) - { - hr = CreateNewPage(pWriter, sizePage); - } - - if (SUCCEEDED(hr)) - { - // - // Create a SAX reader to parse the mark-up write out the page - // content - // - CComPtr pSaxRdr(NULL); - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60))) - { - try - { - m_pNUpTransform->SetCurrentPage(m_cCurrPageIndex); - - // - // Create our NUp sax handler - // - CNUpSaxHandler nupSaxHndlr(m_pWriter, m_pResCopier, m_pNUpTransform); - - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr pReader(NULL); - if (SUCCEEDED(hr = pSaxRdr->putContentHandler(&nupSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast(pReadStreamToSeq))); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - // - // Copy resources - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_pResCopier, E_PENDING))) - { - hr = m_pResCopier->CopyPageResources(pFP, m_pFixedPage); - } - - m_cCurrPageIndex++; - } - - if (SUCCEEDED(hr)) - { - // - // Check if we need to close the page - // - if (m_cCurrPageIndex == m_cNUp) - { - hr = ClosePage(pWriter); - m_cCurrPageIndex = 0; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::ClosePage - -Routine Description: - - Method to close an open fixed page including the addition of any required markup - -Arguments: - - pWriter - Pointer to a writer which receives the closing markup - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::ClosePage( - _In_ IXpsDocumentConsumer* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - // - // Add closing page mark-up, close the current page writer - // - if (m_pWriter != NULL) - { - try - { - CStringXDW cstrCloseFP(L""); - hr = WriteToPrintStream(&cstrCloseFP, m_pWriter); - } - catch (CXDException& e) - { - hr = e; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write fixed page closing tag\n"); - - m_pWriter->Close(); - } - - // - // Send the current page - // - if (m_pFixedPage != NULL) - { - hr = pWriter->SendFixedPage(m_pFixedPage); - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to send page\n"); - } - - // - // Release the writer and the fixed page - // - m_pWriter = NULL; - m_pFixedPage = NULL; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::SetProperties - -Routine Description: - - Method to set the nup properties at a start of a new run of pages - -Arguments: - - pNUpProps - Pointer to an object containing nup settings from the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::SetProperties( - _In_ CNUpPTProperties* pNUpProps - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpProps, E_POINTER))) - { - DeleteProperties(); - DeleteTransform(); - - m_pNUpProps = new(std::nothrow) CNUpPTProperties(*pNUpProps); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pNUpProps, E_OUTOFMEMORY))) - { - m_pNUpTransform = new(std::nothrow) CNUpTransform(m_pNUpProps); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pNUpTransform, E_OUTOFMEMORY))) - { - hr = m_pNUpProps->GetCount(&m_cNUp); - m_cCurrPageIndex = 0; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::CreateNewPage - -Routine Description: - - Method to create a new fixed page to contain the original pages as canvas' - -Arguments: - - pWriter - Pointer to a writer which the new fixed page will be sent to - sizePage - Size of the new page - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPage::CreateNewPage( - _In_ IXpsDocumentConsumer* pWriter, - _In_ SizeF sizePage - ) -{ - HRESULT hr = S_OK; - - CComBSTR bstrPageURI; - - if (SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - // - // Create a unique page URI - // - try - { - // - // Create a unique name for the NUp page for this print session - // - CStringXDW cstrPageURI; - cstrPageURI.Format(L"/NUpPage_%u.xml", GetUniqueNumber()); - bstrPageURI.Empty(); - bstrPageURI.Attach(cstrPageURI.AllocSysString()); - } - catch (CXDException& e) - { - hr = e; - } - } - - // - // Close any open pages, create the new page and retrieve the page writer - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = ClosePage(pWriter)) && - SUCCEEDED(hr = pWriter->GetNewEmptyPart(bstrPageURI, - __uuidof(IFixedPage), - reinterpret_cast(&m_pFixedPage), - &m_pWriter))) - { - // - // Construct the opening FixedPage tag - // - try - { - CStringXDW cstrOpenFP; - cstrOpenFP.Format(pszOpenFPTag, sizePage.Width, sizePage.Height); - hr = WriteToPrintStream(&cstrOpenFP, m_pWriter); - } - catch (CXDException& e) - { - hr = e; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write fixed page opening tag\n"); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPage::DeleteProperties - -Routine Description: - - Method to delete the current nup properties object - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CNUpPage::DeleteProperties( - VOID - ) -{ - if (m_pNUpProps != NULL) - { - delete m_pNUpProps; - m_pNUpProps = NULL; - } -} - -/*++ - -Routine Name: - - CNUpPage::DeleteTransform - -Routine Description: - - Method to delete the current nup transform object - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CNUpPage::DeleteTransform( - VOID - ) -{ - delete m_pNUpTransform; - m_pNUpTransform = NULL; -} - - -/*++ - -Routine Name: - - CNUpPage::WriteToPrintStream - -Routine Description: - - This routine converts a CStringXDW buffer to UTF-8 string to be - written to the write stream provided - -Arguments: - - pcstrOut - Pointer to the Atl CStringXDW containing the mark-up to be written - pWriter - Pointer to the print write stream to write to - -Return Value: - - HRESULT - S_OK - Always succeeds - ---*/ -HRESULT -CNUpPage::WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcstrOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriter, E_POINTER))) - { - ULONG cbWritten = 0; - PVOID pData = NULL; - ULONG cbData = 0; - - try - { - CWideToUTF8 wideToUTF8(pcstrOut); - - if (SUCCEEDED(hr = wideToUTF8.GetBuffer(&pData, &cbData))) - { - hr = pWriter->WriteBytes(pData, cbData, &cbWritten); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nuppage.h b/print/XPSDrvSmpl/src/filters/nup/nuppage.h deleted file mode 100644 index 545c5114..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuppage.h +++ /dev/null @@ -1,107 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nuppage.h - -Abstract: - - NUp page definition. This class is responsible for maintaining - the current NUp page. The public interface defines methods for adding - fixed page content and closing the current page. When a page is added, - the class uses a SAX handler to strip the FixedPage tags from the - source page, apply a canvas with a transformation and add it to the - current NUp page. When the page is full it is closed and sent and a new - NUp page is created. - ---*/ - -#pragma once - -#include "rescpy.h" -#include "xdstring.h" -#include "nupxform.h" - -class CNUpPage -{ -public: - CNUpPage( - _In_ CNUpPTProperties* pNUpProps, - _In_ CResourceCopier* pResCopier - ); - - virtual ~CNUpPage(); - - HRESULT - AddPageContent( - _In_ IXpsDocumentConsumer* pWriter, - _In_ IFixedPage* pFP - ); - - HRESULT - ClosePage( - _In_ IXpsDocumentConsumer* pWriter - ); - - HRESULT - SetProperties( - _In_ CNUpPTProperties* pNUpProps - ); - -private: - HRESULT - CreateNewPage( - _In_ IXpsDocumentConsumer* pWriter, - _In_ SizeF sizePage - ); - - HRESULT - CopyResources( - _In_ IFixedPage* pFPSrc, - _Inout_ IFixedPage* pFPDst - ); - - VOID - DeleteProperties( - VOID - ); - - VOID - DeleteTransform( - VOID - ); - - HRESULT - WriteToPrintStream( - _In_ CStringXDW* pcstrOut, - _In_ IPrintWriteStream* pWriter - ); - -private: - CComPtr m_pWriter; - - CComPtr m_pFixedPage; - - // - // Current page index (i.e. 0 - 5 for 6 Up) - // - UINT m_cCurrPageIndex; - - UINT m_cNUp; - - CNUpTransform* m_pNUpTransform; - - CNUpPTProperties* m_pNUpProps; - - CResourceCopier* m_pResCopier; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp b/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp deleted file mode 100644 index 6c92730c..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp +++ /dev/null @@ -1,522 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupsax.xpp - -Abstract: - - NUp SAX handler implementation. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. It is also responsible for - identifying resources that need to be copied from the source page to - the NUp page. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "nupsax.h" - -// -// We will need to preserve namespaces defined by the source fixed page into each canvas, -// e.g. xmlns:x="http://schemas.microsoft.com/xps/2005/06/resourcedictionary-key". To do -// this we will create and populate a vector of namespaces to add to the canvas wrappning -// the source fixed page. -// -typedef pair AttribValuePair; -typedef vector NamespaceVector; - -/*++ - -Routine Name: - - CNUpSaxHandler::CNUpSaxHandler - -Routine Description: - - Contructor for the nup filters SAX handler which registers - internally the writer for sending new markup out to and a - resource copier which copies markup between pages - -Arguments: - - pWriter - Pointer to a write stream which receives markup - pResCopier - Pointer to a resource markup copier object which - copies markup between pages - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CNUpSaxHandler::CNUpSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CResourceCopier* pResCopier, - _In_ CNUpTransform* pNUpTransform - ) : - m_pWriter(pWriter), - m_bOpenTag(FALSE), - m_pResCopier(pResCopier), - m_pNUpTransform(pNUpTransform) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to NUp SAX handler.\n"); - ASSERTMSG(m_pResCopier != NULL, "NULL resource copier passed to NUp SAX handler.\n"); - ASSERTMSG(m_pNUpTransform != NULL, "NULL NUp Transform object passed to NUp SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_PENDING)) || - FAILED(hr = CHECK_POINTER(m_pResCopier, E_PENDING)) || - FAILED(hr = CHECK_POINTER(m_pNUpTransform, E_PENDING))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CNUpSaxHandler::~CNUpSaxHandler - -Routine Description: - - Default destructor for the nup filters SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpSaxHandler::~CNUpSaxHandler() -{ - m_bstrOpenElement.Empty(); -} - -/*++ - -Routine Name: - - CNUpSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CNUpSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - - // - // If this is the fixed page we need the width and height retrieved - // - BOOL bIsFixedPage = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - bIsFixedPage = (bstrElement == L"FixedPage"); - - // - // The resource dictionary is now canvas wide - // - if (bstrElement == L"FixedPage.Resources") - { - bstrElement = L"Canvas.Resources"; - } - - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = bstrElement; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - // - // If this is the fixed page we do not write the tag - // - if (!bIsFixedPage) - { - // - // Write out element - // - try - { - cstrOut.Append(L"<"); - cstrOut.Append(m_bstrOpenElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // We opened a tag - // - m_bOpenTag = TRUE; - } - - SizeF sizePage(0.0f, 0.0f); - - // - // Record additional namespaces defined by the fixed page - // - NamespaceVector fpNamespaces; - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - if (bIsFixedPage) - { - // - // Extract the page Width and Height values - // - CStringXDW cstrAttName(bstrAttName); - if (cstrAttName == L"Width") - { - sizePage.Width = static_cast(_wtof(bstrAttValue)); - - if (sizePage.Width < 1.f) - { - // - // According to the Xps Specification, - // FixedPage Width must be >= 1.0 - // - hr = E_FAIL; - } - } - else if (cstrAttName == L"Height") - { - sizePage.Height = static_cast(_wtof(bstrAttValue)); - - if (sizePage.Height < 1.f) - { - // - // According to the Xps Specification, - // FixedPage Height must be >= 1.0 - // - hr = E_FAIL; - } - } - else if (cstrAttName.Find(L"xmlns:") == 0) - { - // - // We have an additional namespace - add to the vector to be applied to the canvas element - // - fpNamespaces.push_back(AttribValuePair(cstrAttName, CStringXDW(bstrAttValue))); - } - } - else - { - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - - if (SUCCEEDED(hr) && - bIsFixedPage) - { - // - // Write the canvas out - // - try - { - // - // Get the page transform for the current page - // - CComBSTR bstrMatrix; - Matrix matrixTransform; - - if (SUCCEEDED(hr = m_pNUpTransform->GetPageTransform(sizePage, &matrixTransform)) && - SUCCEEDED(hr = m_pNUpTransform->MatrixToXML(&matrixTransform, &bstrMatrix))) - { - - // - // Create a clipping region which is the size of the logical page - // - CStringXDW strClip; - - strClip.Format(L"M 0,0 L %.2f,0 L %.2f,%.2f L 0, %.2f Z", - sizePage.Width, - sizePage.Width, - sizePage.Height, - sizePage.Height); - - cstrOut.Format(L"(bstrMatrix), - static_cast(strClip)); - - // - // Add additional namespaces from the FixedPage - // - for (NamespaceVector::const_iterator iterNamespaces = fpNamespaces.begin(); - iterNamespaces != fpNamespaces.end(); - iterNamespaces++) - { - cstrOut += L" "; - cstrOut += (*iterNamespaces).first; - cstrOut += L"=\""; - cstrOut += (*iterNamespaces).second; - cstrOut += L"\""; - } - - cstrOut += L">"; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write canvas\n"); - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpSaxHandler::endElement - -Routine Description: - - SAX handler method which handles each end element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CNUpSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrClose; - BOOL bCloseTag = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - // - // The resource dictionary is now canvas wide - // - if (bstrElement == L"FixedPage.Resources") - { - bstrElement = L"Canvas.Resources"; - } - - // - // Ignore close fixed page tag - // - if (bstrElement != L"FixedPage") - { - bCloseTag = TRUE; - - // - // If this is a root element with child nodes, the open - // element will not match the last startElement. In this case - // we need to add an appropriate closing tag - // - if (bstrElement == m_bstrOpenElement && !!m_bOpenTag) - { - // - // Names match so just add a closing bracket - // - // We might have closed the tag when writing the watermark XML - // - cstrClose.Append(L"/>"); - } - else - { - // - // Add a closing tag - // - cstrClose.Append(L""); - } - - m_bOpenTag = FALSE; - } - else - { - // - // Close the canvas - // - try - { - bCloseTag = TRUE; - cstrClose.Append(L""); - } - catch (CXDException& e) - { - hr = e; - } - - ASSERTMSG(SUCCEEDED(hr), "Failed to write canvas\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr) && - bCloseTag) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupsax.h b/print/XPSDrvSmpl/src/filters/nup/nupsax.h deleted file mode 100644 index 8b78cfd8..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupsax.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupsax.h - -Abstract: - - NUp SAX handler definition. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. It is also responsible for - identifying resources that need to be copied from the source page to - the NUp page. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "rescpy.h" -#include "nupxform.h" - -class CNUpSaxHandler : public CSaxHandler -{ -public: - CNUpSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CResourceCopier* pResCopier, - _In_ CNUpTransform* pNUpTransform - ); - - virtual ~CNUpSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - -private: - CComPtr m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CResourceCopier* m_pResCopier; - - CNUpTransform* m_pNUpTransform; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp b/print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp deleted file mode 100644 index 0783f0ce..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuptprps.cpp +++ /dev/null @@ -1,449 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nuptprps.cpp - -Abstract: - - NUp properties class implementation. The NUp properties class is - responsible for interpreting NUp, Binding, PageMediaSize and - PageOrientation data for the NUp filter. Binding data is required - as the NUp filter is responsible for applying two up for booklet - processing. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "nuptprps.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::LeftBottom; -using XDPrintSchema::NUp::PresentationDirection::TopLeft; -using XDPrintSchema::NUp::PresentationDirection::BottomLeft; -using XDPrintSchema::NUp::PresentationDirection::RightBottom; - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::None; -using XDPrintSchema::Binding::BindLeft; -using XDPrintSchema::Binding::BindRight; -using XDPrintSchema::Binding::BindTop; -using XDPrintSchema::Binding::BindBottom; -using XDPrintSchema::Binding::JobBindAllDocuments; -using XDPrintSchema::Binding::EdgeStitchLeft; -using XDPrintSchema::Binding::EdgeStitchRight; -using XDPrintSchema::Binding::EdgeStitchTop; -using XDPrintSchema::Binding::EdgeStitchBottom; - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; - -using XDPrintSchema::PageOrientation::PageOrientationData; -using XDPrintSchema::PageOrientation::EOrientationOption; - -/*++ - -Routine Name: - - CNUpPTProperties::CNUpPTProperties - -Routine Description: - - Constructor for the CNUpPTProperties class which - initialises members to sensible default values - -Arguments: - - nupData - Structure containing nup settings from the PrintTicket - bindingData - Structure containing nup binding settings from the PrintTicket - pageMediaSizeData - Structure containing nup page media size settings from the PrintTicket - pageOrientData - Structure containing nup page orientation settings from the PrintTicket - -Return Value: - - None - ---*/ -CNUpPTProperties::CNUpPTProperties( - _In_ CONST NUpData& nupData, - _In_ CONST BindingData& bindingData, - _In_ CONST PageMediaSizeData& pageMediaSizeData, - _In_ CONST PageOrientationData& pageOrientData - ) : - m_nupData(nupData), - m_bindingData(bindingData), - m_pageMediaSizeData(pageMediaSizeData), - m_pageOrientData(pageOrientData) -{ -} - -/*++ - -Routine Name: - - CNUpPTProperties::~CNUpPTProperties - -Routine Description: - - Default destructor for the CNUpPTProperties class - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpPTProperties::~CNUpPTProperties() -{ -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetCount - -Routine Description: - - Method to get the nup count. For booklet printing this will always be set to two - -Arguments: - - pcNUpPages - Integer value which will contain the nup count - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetCount( - _Out_ UINT* pcNUpPages - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcNUpPages, E_POINTER))) - { - *pcNUpPages = m_nupData.cNUp; - - if (m_bindingData.bindOption != XDPrintSchema::Binding::None) - { - *pcNUpPages = 2; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetPresentationDirection - -Routine Description: - - Method to get the nup presentation direction - -Arguments: - - pPresentationDirection - Enumeration value which is set to the current - presentation direction - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetPresentationDirection( - _Out_ ENUpDirectionOption* pPresentationDirection - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPresentationDirection, E_POINTER))) - { - *pPresentationDirection = m_nupData.nUpPresentDir; - - if (m_bindingData.bindOption != XDPrintSchema::Binding::None) - { - hr = PresentDirFromBindOption(pPresentationDirection); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetScope - -Routine Description: - - Method to get the nup scope which can be either - document wide or job wide. - -Arguments: - - pNUpScope - Enumeration value which will be set to the - current scope of nup. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetScope( - _In_ ENUpScope* pNUpScope - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpScope, E_POINTER))) - { - *pNUpScope = CNUpPTProperties::None; - - if (m_bindingData.bindOption != XDPrintSchema::Binding::None) - { - *pNUpScope = m_bindingData.bindFeature == JobBindAllDocuments ? Job : Document; - } - else if (m_nupData.cNUp > 1) - { - *pNUpScope = m_nupData.nUpFeature == JobNUpAllDocumentsContiguously ? Job : Document; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetPageSize - -Routine Description: - - Method to get the nup page media size - -Arguments: - - pSizePage - Value which will be set to the nup page media size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetPageSize( - _Out_ SizeF* pSizePage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSizePage, E_POINTER))) - { - // - // Convert microns to 96th of an inch. - // - pSizePage->Width = static_cast(m_pageMediaSizeData.pageWidth)/k96thInchAsMicrons; - pSizePage->Height = static_cast(m_pageMediaSizeData.pageHeight)/k96thInchAsMicrons; - - if (pSizePage->Width <= 0.0f || - pSizePage->Height <= 0.0f) - { - // - // The page media size is incorrect - // - ERR("Could not acquire a valid media page size\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetPageOrientation - -Routine Description: - - Method to get the nup page orientation which can be either landscape or portrait - -Arguments: - - pPageOrientation - Enumeration value which will be set to either landscape or portrait - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetPageOrientation( - _In_ EOrientationOption* pPageOrientation - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPageOrientation, E_POINTER))) - { - *pPageOrientation = m_pageOrientData.orientation; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::PresentDirFromBindOption - -Routine Description: - - Method to obtain a presentation direction from the current binding setting - -Arguments: - - pPresentationDirection - Enumeration value which will be set to a presentation direction - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::PresentDirFromBindOption( - _Out_ ENUpDirectionOption* pPresentationDirection - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPresentationDirection, E_POINTER))) - { - switch (m_bindingData.bindOption) - { - case BindRight: - case EdgeStitchRight: - { - *pPresentationDirection = LeftBottom; - } - break; - - case BindBottom: - case EdgeStitchBottom: - { - // - // Vertical direction takes precidence over horizontal direction - // - *pPresentationDirection = TopLeft; - } - break; - - case BindTop: - case EdgeStitchTop: - { - // - // Vertical direction takes precidence over horizontal direction - // - *pPresentationDirection = BottomLeft; - } - break; - - // - // Everything else is RightBottom - // - default: - { - *pPresentationDirection = RightBottom; - } - break; - } - } - - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpPTProperties::GetBindingOption - -Routine Description: - - Method to obtain the binding direction - -Arguments: - - pBindingOption - Enumeration value which will be set to a binding direction - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpPTProperties::GetBindingOption( - _Out_ EBindingOption* pBindingOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBindingOption, E_POINTER))) - { - *pBindingOption = m_bindingData.bindOption; - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/nup/nuptprps.h b/print/XPSDrvSmpl/src/filters/nup/nuptprps.h deleted file mode 100644 index 2d53082a..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nuptprps.h +++ /dev/null @@ -1,97 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nuptprps.cpp - -Abstract: - - NUp properties class definition. The NUp properties class is - responsible for holding and controling NUp properties. - ---*/ - -#pragma once - -#include "nupdata.h" -#include "bkdata.h" -#include "psizedata.h" -#include "porientdata.h" - -class CNUpPTProperties -{ -public: - enum ENUpScope - { - None = 0, - Job, - Document - }; - -public: - CNUpPTProperties( - _In_ CONST XDPrintSchema::NUp::NUpData& nupData, - _In_ CONST XDPrintSchema::Binding::BindingData& bindingData, - _In_ CONST XDPrintSchema::PageMediaSize::PageMediaSizeData& pageMediaSizeData, - _In_ CONST XDPrintSchema::PageOrientation::PageOrientationData& pageOrientData - ); - - virtual ~CNUpPTProperties(); - - HRESULT - GetCount( - _Out_ UINT* pcNUpPages - ); - - HRESULT - GetPresentationDirection( - _Out_ XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption* pPresentationDirection - ); - - HRESULT - GetScope( - _In_ ENUpScope* pNUpScope - ); - - HRESULT - GetPageSize( - _Out_ SizeF* pSizePage - ); - - HRESULT - GetPageOrientation( - _In_ XDPrintSchema::PageOrientation::EOrientationOption* pPageOrientation - ); - - HRESULT - GetBindingOption( - _Out_ XDPrintSchema::Binding::EBindingOption* pBindingOption - ); - -private: - CNUpPTProperties& operator = (CONST CNUpPTProperties&); - - HRESULT - PresentDirFromBindOption( - _Out_ XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption* pPresentationDirection - ); - -private: - CONST XDPrintSchema::NUp::NUpData m_nupData; - - CONST XDPrintSchema::Binding::BindingData m_bindingData; - - CONST XDPrintSchema::PageMediaSize::PageMediaSizeData m_pageMediaSizeData; - - CONST XDPrintSchema::PageOrientation::PageOrientationData m_pageOrientData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupxform.cpp b/print/XPSDrvSmpl/src/filters/nup/nupxform.cpp deleted file mode 100644 index a79ff819..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupxform.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupxform.cpp - -Abstract: - - NUp transform implementation. The NUp transform class is responsible - for calculating the appropriate matrix transform for a given page in - an NUp sequence. - -Known Issues: - - The NUp implementation does not yet account for reverse orientations - (ReverseLandscape and ReversePortrait). - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "nupxform.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMin; -using XDPrintSchema::NUp::PresentationDirection::RightBottom; -using XDPrintSchema::NUp::PresentationDirection::BottomRight; -using XDPrintSchema::NUp::PresentationDirection::LeftBottom; -using XDPrintSchema::NUp::PresentationDirection::BottomLeft; -using XDPrintSchema::NUp::PresentationDirection::RightTop; -using XDPrintSchema::NUp::PresentationDirection::TopRight; -using XDPrintSchema::NUp::PresentationDirection::LeftTop; -using XDPrintSchema::NUp::PresentationDirection::TopLeft; -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOptionMax; - -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::None; -using XDPrintSchema::Binding::BindTop; -using XDPrintSchema::Binding::BindBottom; - -using XDPrintSchema::PageOrientation::EOrientationOption; -using XDPrintSchema::PageOrientation::Landscape; -using XDPrintSchema::PageOrientation::ReverseLandscape; -using XDPrintSchema::PageOrientation::Portrait; - -static CONST REAL kLetterWidth96thsInch = 816.0f; -static CONST REAL kLetterHeight96thsInch = 1056.0f; - -/*++ - -Routine Name: - - CNUpTransform::CNUpTransform - -Routine Description: - - Constructor for the CNUpTransform class which initialises members - to sensible values based on the supplied PrintTicket object - -Arguments: - - pNUpPTProps - PrintTicket properties object used for initialising the - CNUpTransform object - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CNUpTransform::CNUpTransform( - _In_ CNUpPTProperties* pNUpPTProps - ) : - m_bRotatePage(FALSE), - m_cCurrPageIndex(0) -{ - ASSERTMSG(pNUpPTProps != NULL, "NULL PrintTicket passed to page transform handler\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNUpPTProps, E_POINTER))) - { - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetCount(&m_CanvasCount))) - { - m_CanvasCount = 1; - ERR("Failed to retrieve NUp count\n"); - } - - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetPresentationDirection(&m_NUpPresentDirection))) - { - m_NUpPresentDirection = RightBottom; - ERR("Failed to retrieve NUp order\n"); - } - - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetPageSize(&m_sizeTargetPage))) - { - m_sizeTargetPage.Width = kLetterWidth96thsInch; - m_sizeTargetPage.Height = kLetterHeight96thsInch; - ERR("Failed to retrieve target page size\n"); - } - - EOrientationOption pgOrient = Portrait; - if (SUCCEEDED(hr) && - FAILED(hr = pNUpPTProps->GetPageOrientation(&pgOrient))) - { - ERR("Failed to retrieve target page orientation\n"); - } - - // - // Initialise canvas count - // - switch (m_CanvasCount) - { - case 1: - { - m_CanvasXCount = 1; - m_CanvasYCount = 1; - } - break; - - case 2: - { - m_CanvasXCount = 1; - m_CanvasYCount = 2; - m_bRotatePage = TRUE; - - // - // Booklet printing is treated as a special case of 2Up. - // Unlike regular 2Up which always rotates pages, booklet - // only requires pages to be rotated when binding left to right - // or right to left. - // - EBindingOption bindingOption; - if(SUCCEEDED(hr = pNUpPTProps->GetBindingOption(&bindingOption))) - { - if(bindingOption == BindBottom || - bindingOption == BindTop) - { - m_bRotatePage = FALSE; - } - - if (pgOrient == Landscape) - { - m_CanvasXCount = 2; - m_CanvasYCount = 1; - } - } - } - break; - - case 4: - { - m_CanvasXCount = 2; - m_CanvasYCount = 2; - } - break; - - case 6: - { - m_CanvasXCount = 2; - m_CanvasYCount = 3; - m_bRotatePage = TRUE; - } - break; - - case 8: - { - m_CanvasXCount = 2; - m_CanvasYCount = 4; - m_bRotatePage = TRUE; - } - break; - - case 9: - { - m_CanvasXCount = 3; - m_CanvasYCount = 3; - } - break; - - case 16: - { - m_CanvasXCount = 4; - m_CanvasYCount = 4; - } - break; - - default: - { - m_CanvasXCount = 1; - m_CanvasYCount = 1; - } - break; - } - - if (pgOrient == Landscape || - pgOrient == ReverseLandscape) - { - INT countSwap = m_CanvasXCount; - m_CanvasXCount = m_CanvasYCount; - m_CanvasYCount = countSwap; - } - } - - if (SUCCEEDED(hr)) - { - hr = InitTransformMap(); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - - -/*++ - -Routine Name: - - CNUpTransform::~CNUpTransform - -Routine Description: - - Default destructor for the CNUpTransform class - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpTransform::~CNUpTransform() -{ -} - -/*++ - -Routine Name: - - CNUpTransform::SetCurrentPage - -Routine Description: - - Sets the page member of the object - -Arguments: - - cPage - Current page count around the nup page count. - -Return Value: - - None - ---*/ -VOID -CNUpTransform::SetCurrentPage( - _In_ UINT cPage - ) -{ - m_cCurrPageIndex = cPage; -} - -/*++ - -Routine Name: - - CNUpTransform::GetPageTransform - -Routine Description: - - Method for obtaining a page transformation matrix based on the count of the - current canvas and the dimensions of the source and target pages - -Arguments: - - sizePage - Size of the source page being transformed - pTransform - Pointer to the resulting transformation matrix - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpTransform::GetPageTransform( - _In_ SizeF sizePage, - _Out_ Matrix* pTransform - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pTransform, E_POINTER))) - { - SizeF sizeCanvas(m_sizeTargetPage.Width / m_CanvasXCount, m_sizeTargetPage.Height / m_CanvasYCount); - PointF canvasCentre(sizeCanvas.Width/2.0f, sizeCanvas.Height/2.0f); - PointF pageCentre(sizePage.Width/2.0f, sizePage.Height/2.0f); - - REAL scaleX = 1.0f; - REAL scaleY = 1.0f; - if (m_bRotatePage) - { - // - // Calculate the dimension scale accounting for page rotation - // - scaleX = sizeCanvas.Width / sizePage.Height; - scaleY = sizeCanvas.Height / sizePage.Width; - - // - // Apply the rotation - // - pTransform->Rotate(90.0f, MatrixOrderAppend); - } - else - { - // - // Calculate the dimension scale - // - scaleX = sizeCanvas.Width / sizePage.Width; - scaleY = sizeCanvas.Height / sizePage.Height; - } - - // - // The minimum scale of x and y gurantees both - // dimensions fit the target - // - REAL scale = min(scaleX, scaleY); - - // - // Apply the scaling factor - // - pTransform->Scale(scale, scale, MatrixOrderAppend); - - // - // Find the new page centre - // - pTransform->TransformPoints(&pageCentre, 1); - - // - // Apply a translate to the canvas - // - UINT cPage = 0; - BOOL bDone = FALSE; - - for (UINT cIndexY = 0; cIndexY < m_CanvasYCount && !bDone; cIndexY++) - { - for (UINT cIndexX = 0; cIndexX < m_CanvasXCount && !bDone; cIndexX++) - { - if (m_pageNumVect[cPage] == m_cCurrPageIndex) - { - // - // Offset multipliers from loop indices - // - REAL yMult = static_cast(cIndexY); - REAL xMult = static_cast(cIndexX); - - // - // Use a matrix to find the centre of the translated canvas - // - Matrix canvasXForm; - - // - // Translate canvas to destination - // - canvasXForm.Translate(sizeCanvas.Width * xMult, sizeCanvas.Height * yMult, MatrixOrderAppend); - - // - // Apply the canvas transform to the canvas centre - // - canvasXForm.TransformPoints(&canvasCentre, 1); - - bDone = TRUE; - } - cPage++; - } - } - - // - // Calculate the offset of the centre of page to the centre - // of the canvas and apply the translation - // - PointF offset(canvasCentre - pageCentre); - pTransform->Translate(offset.X, offset.Y, MatrixOrderAppend); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpTransform::MatrixToXML - -Routine Description: - - Method to create xml markup representing a transformation matrix - -Arguments: - - pMatrix - Pointer to a transformation matrix to convert to markup - pbstrMatrixXForm - Pointer to a string to contain the matrix markup - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpTransform::MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - // - // Construct the matric mark-up from a GDI+ matrix - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - REAL matElems[6]; - - if (Ok == pMatrix->GetElements(matElems)) - { - CStringXDW cstrMatrix; - - try - { - cstrMatrix.Format(L"%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", - matElems[0], - matElems[1], - matElems[2], - matElems[3], - matElems[4], - matElems[5]); - - *pbstrMatrixXForm = cstrMatrix.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - *pbstrMatrixXForm = NULL; - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpTransform::InitTransformMap - -Routine Description: - - Method to initialise the map of transforms which depends - on the nup page count and presentation direction - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpTransform::InitTransformMap( - VOID - ) -{ - HRESULT hr = S_OK; - - // - // Populate the map of page numbers. - // The transforms are calculated left to right, top to bottom on - // the physical page so rather than special case each presentation - // order, we simply apply the same transform in the same order but - // to a different ordering of pages - // - try - { - // - // Certain NUp page counts cause a rotation to be applied to the page. - // When this occurs, the presentation order should also be rotated. - // - ENUpDirectionOption rotatedOrder[ENUpDirectionOptionMax] = { - BottomLeft, - LeftBottom, - TopLeft, - LeftTop, - BottomRight, - RightBottom, - TopRight, - RightTop - }; - - if (m_bRotatePage) - { - if (m_NUpPresentDirection >= ENUpDirectionOptionMin && - m_NUpPresentDirection < ENUpDirectionOptionMax) - { - m_NUpPresentDirection = rotatedOrder[m_NUpPresentDirection]; - } - else - { - ERR("Invalid presentation direction.\n"); - - hr = E_FAIL; - } - } - - if (SUCCEEDED(hr)) - { - m_pageNumVect.clear(); - for (UINT cIndexY = 0; cIndexY < m_CanvasYCount; cIndexY++) - { - for (UINT cIndexX = 0; cIndexX < m_CanvasXCount; cIndexX++) - { - switch (m_NUpPresentDirection) - { - case RightTop: - { - m_pageNumVect.push_back((m_CanvasXCount * (m_CanvasYCount-1)) - (m_CanvasXCount * cIndexY) + cIndexX); - } - break; - - case LeftBottom: - { - m_pageNumVect.push_back(cIndexY * m_CanvasXCount + (m_CanvasXCount - cIndexX) - 1); - } - break; - - case LeftTop: - { - m_pageNumVect.push_back((m_CanvasXCount * m_CanvasYCount) - cIndexX - (cIndexY*m_CanvasXCount) - 1); - } - break; - - case BottomRight: - { - m_pageNumVect.push_back(m_CanvasYCount * cIndexX + cIndexY); - } - break; - - case TopRight: - { - m_pageNumVect.push_back((m_CanvasYCount - 1 - cIndexY) + (cIndexX * m_CanvasYCount)); - } - break; - - case BottomLeft: - { - m_pageNumVect.push_back(m_CanvasYCount * (m_CanvasXCount - 1 - cIndexX) + cIndexY); - } - break; - - case TopLeft: - { - m_pageNumVect.push_back(((m_CanvasXCount-cIndexX) * m_CanvasYCount) - 1 - cIndexY); - } - break; - - case RightBottom: - default: - { - m_pageNumVect.push_back(cIndexY * m_CanvasXCount + cIndexX); - } - break; - } - } - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/nup/nupxform.h b/print/XPSDrvSmpl/src/filters/nup/nupxform.h deleted file mode 100644 index a752730f..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/nupxform.h +++ /dev/null @@ -1,101 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupxform.h - -Abstract: - - NUp transform definition. The NUp transform class is responsible - for calculating the appropriate matrix transform for a given page in - an NUp sequence. - ---*/ - -#pragma once - -#include "nuptprps.h" - -class CNUpTransform -{ -public: - CNUpTransform( - _In_ CNUpPTProperties* pNUpPTProps - ); - - virtual ~CNUpTransform(); - - VOID - SetCurrentPage( - _In_ UINT cPage - ); - - HRESULT - GetPageTransform( - _In_ SizeF sizePage, - _Out_ Matrix* pTransform - ); - - HRESULT - MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -private: - HRESULT - InitTransformMap( - VOID - ); - -private: - // - // Nup count - // - UINT m_CanvasCount; - - // - // Current Nup index - // - UINT m_cCurrPageIndex; - - // - // Presentation order - // - XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption m_NUpPresentDirection; - - // - // Target page size - // - SizeF m_sizeTargetPage; - - // - // Nup count across - // - UINT m_CanvasXCount; - - // - // Nup count down - // - UINT m_CanvasYCount; - - // - // Vector of page maps - // - vector m_pageNumVect; - - // - // We need to handle page rotation for 2, 6 and 8 up - // - BOOL m_bRotatePage; -}; - diff --git a/print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/nup/xdnup.def b/print/XPSDrvSmpl/src/filters/nup/xdnup.def deleted file mode 100644 index 349aaaa6..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/xdnup.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 Microsoft Corporation -; -; All rights reserved. -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; File Name: -; -; xdnup.def -; -; Abstract: -; -; NUp filter module definition file -; - -LIBRARY XDNup - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj b/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj deleted file mode 100644 index 9c42026c..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj +++ /dev/null @@ -1,552 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {23BA577F-B171-4CEC-92E0-49EE44564366} - $(MSBuildProjectName) - false - true - Debug - Win32 - {5C442B00-0FF4-48AA-9CD8-A0C589B6E6B9} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - xdnup - - - xdnup - - - xdnup - - - xdnup - - - xdnup - - - xdnup - - - xdnup - - - xdnup - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - xdnup.def - - - - - xdnup.def - - - - - xdnup.def - - - - - xdnup.def - - - - - xdnup.def - - - - - xdnup.def - - - - - xdnup.def - - - - - xdnup.def - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj.Filters deleted file mode 100644 index 5cf3c9d5..00000000 --- a/print/XPSDrvSmpl/src/filters/nup/xdnup.vcxproj.Filters +++ /dev/null @@ -1,95 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {56E5007B-AD73-4A1E-B8F2-57AC3F2BCBB4} - - - h;hpp;hxx;hm;inl;inc;xsd - {C21FF91C-053E-46A7-AFD9-4F9E238380BE} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {B20F8D0B-1C7C-4058-9CC7-30742279D85E} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/precomp.h b/print/XPSDrvSmpl/src/filters/precomp.h deleted file mode 100644 index 68292995..00000000 --- a/print/XPSDrvSmpl/src/filters/precomp.h +++ /dev/null @@ -1,110 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - precomp.h - -Abstract: - - Precompiled header for all filters - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include -#include - -// -// COM includes -// -#include -#include - -// -// Standard library includes -// -#include -#include -#pragma warning(push) -#pragma warning(disable : 4018) -#include -#pragma warning(pop) -#include -#include - -// -// ATL Includes -// -#include - -#pragma warning (push) -#pragma warning (disable:4458) -// -// GDIPlus includes -// -#include -#pragma warning (pop) - -// -// MSXML includes -// -#include - -// -// Filter pipeline includes -// -#include -#include -#include -#include - -// -// WCS Includes -// -#include - -// -// Windows Imaging Component -// -#include - -// -// Commonly used namespaces -// -using namespace std; -using namespace Gdiplus; - -// -// String safe includes - included last to prevent build warnings -// -#include - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp b/print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp deleted file mode 100644 index 7ae94af8..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/dllentry.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the page scaling filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "scaleflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the page scaling filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL module. - wReason - Indicates why the DLL entry-point function is being called. - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Determines whether the DLL is in use. - If not, the caller can unload the DLL from memory. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Retrieves the class object for the DLL. - Called from within the CoGetClassObject function. - -Arguments: - - rclsid - CLSID that will associate the correct data and code. - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object. - ppv - Address of pointer variable that receives the interface pointer requested in riid. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // 976EDCE4-274E-482a-9773-12453BE3E7F1 - // - CLSID scalingCLSID = {0x976EDCE4, 0x274E, 0x482a, {0x97, 0x73, 0x12, 0x45, 0x3B, 0xE3, 0xE7, 0xF1}}; - - return GetFilterClassFactory(rclsid, riid, scalingCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp b/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp deleted file mode 100644 index 7a7bc160..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp +++ /dev/null @@ -1,761 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pagescale.cpp - -Abstract: - - Page Scaling class implementation. The Page Scaling class provides - functionality required to perform page Scaling. This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the Page Scaling options. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "pagescale.h" - -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitContentToImageable; -using XDPrintSchema::PageScaling::FitMediaToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomRight; -using XDPrintSchema::PageScaling::OffsetAlignment::Center; -using XDPrintSchema::PageScaling::OffsetAlignment::LeftCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::RightCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::TopRight; - -/*++ - -Routine Name: - - CPageScaling::CPageScaling - -Routine Description: - - CPageScaling class constructor - -Arguments: - - pgscProps - Reference to the page scaling PrintTicket properties. - -Return Value: - - None - ---*/ -CPageScaling::CPageScaling( - _In_ CONST CPGSCPTProperties& pgscProps - ) : - m_pageDimensions(0.0f, 0.0f), - m_PGSCProps(pgscProps), - m_bAddCanvas(FALSE), - m_contentBox(0.0f, 0.0f, 0.0f, 0.0f), - m_bleedBox(0.0f, 0.0f, 0.0f, 0.0f) -{ -} - -/*++ - -Routine Name: - - CPageScaling::~CPageScaling - -Routine Description: - - CPageScaling class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScaling::~CPageScaling() -{ -} - -/*++ - -Routine Name: - - CPageScaling::GetFixedPageWidth - -Routine Description: - - Creates a string containing the page width in 1/96 Inch - (Not applicable to Custom Scaling options). - -Arguments: - - pbstrWidth - Address of a pointer that will be modified to point to a string - that is filled out with the fixed page width. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetFixedPageWidth( - _Outptr_ BSTR* pbstrWidth - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrWidth, E_POINTER))) - { - try - { - SizeF targetPage; - if (SUCCEEDED(hr = m_PGSCProps.GetPageSize(&targetPage))) - { - CStringXDW cstrValue; - cstrValue.Format(L"%.2f", targetPage.Width); - *pbstrWidth = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::GetFixedPageHeight - -Routine Description: - - Creates a string containing the page height in 1/96 Inch - (Not applicable to Custom Scaling options). - -Arguments: - - pbstrHeight - Address of a pointer that will be modified to point to a string - that is filled out with the fixed page height. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetFixedPageHeight( - _Outptr_ BSTR* pbstrHeight - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrHeight, E_POINTER))) - { - try - { - SizeF targetPage; - if (SUCCEEDED(hr = m_PGSCProps.GetPageSize(&targetPage))) - { - CStringXDW cstrValue; - cstrValue.Format(L"%.2f", targetPage.Height); - *pbstrHeight = cstrValue.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::MatrixToXML - -Routine Description: - - Creates a string representation of a Matrix class object. - The string is suitable for use in XPS markup with the 'RenderTransform' keyword. - -Arguments: - - pMatrix - Pointer to a Matrix class object. - pbstrMatrixXForm - Address of a pointer that will be modified to point to a string - that is filled out with the matrix. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - // - // Construct the matric mark-up from a GDI+ matrix - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - REAL matElems[6]; - if (Ok == pMatrix->GetElements(matElems)) - { - try - { - CStringXDW cstrMatrix; - cstrMatrix.Format(L"%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", - matElems[0], - matElems[1], - matElems[2], - matElems[3], - matElems[4], - matElems[5]); - - *pbstrMatrixXForm = cstrMatrix.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - *pbstrMatrixXForm = NULL; - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::SetPageDimensions - -Routine Description: - - Used to set the XPS page width and height in the page scaling interface. - -Arguments: - - width - Width of the XPS fixed page in 1/96 Inch. - height - Height of the XPS fixed page in 1/96 Inch. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::SetPageDimensions( - _In_ CONST REAL width, - _In_ CONST REAL height - ) -{ - m_pageDimensions.Width = width; - m_pageDimensions.Height = height; - - return S_OK; -} - -/*++ - -Routine Name: - - CPageScaling::SetBleedBox - -Routine Description: - - Used to set the XPS BleedBox in the page scaling interface. - -Arguments: - - pBleedBox - pointer to a rectangle defining the BleedBox of the XPS page in 1/96 Inch. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::SetBleedBox( - _In_ RectF* pBleedBox - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBleedBox, E_POINTER))) - { - m_bleedBox = *pBleedBox; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::SetContentBox - -Routine Description: - - Used to set the XPS ContentBox in the page scaling interface. - -Arguments: - - pContentBox - pointer to a rectangle defining the ContentBox of the XPS page in 1/96 Inch. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::SetContentBox( - _In_ RectF* pContentBox - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pContentBox, E_POINTER))) - { - m_contentBox = *pContentBox; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::CalculateMatrix - -Routine Description: - - Calculates a matrix transform from the current page scaling properties. - -Arguments: - - pMatrix - Pointer to a Matrix class object that is modified to reflect the current transform. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::CalculateMatrix( - _Inout_ Matrix* pMatrix - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - REAL xScale = 1.0f; - REAL yScale = 1.0f; - REAL widthOffset = 0.0f; - REAL heightOffset = 0.0f; - - EScaleOption pgscOption; - - if (SUCCEEDED(hr = m_PGSCProps.GetOption(&pgscOption))) - { - switch (pgscOption) - { - case Custom: - case CustomSquare: - { - // - // The PrintTicket property handler for Custom and CustomSquare - // already handle mapping of x and y. - // - if (SUCCEEDED(hr = m_PGSCProps.GetWidthScale(&xScale)) && - SUCCEEDED(hr = m_PGSCProps.GetHeightScale(&yScale)) && - SUCCEEDED(hr = m_PGSCProps.GetWidthOffset(&widthOffset))) - { - hr = m_PGSCProps.GetHeightOffset(&heightOffset); - } - } - break; - - case FitBleedToImageable: // ImageableSize <- BleedBox - case FitContentToImageable: // ImageableSize <- ContentBox - case FitMediaToImageable: // ImageableSize <- FixedPage - case FitMediaToMedia: // Mediasize <- FixedPage - { - EScaleOffsetOption offsetOption; - - if (SUCCEEDED(hr = m_PGSCProps.GetOffsetOption(&offsetOption))) - { - RectF targetPage; - RectF sourcePage; - - switch (pgscOption) - { - case FitBleedToImageable: - { - m_PGSCProps.GetImageableRect(&targetPage); - - sourcePage = m_bleedBox; - } - break; - case FitContentToImageable: - { - m_PGSCProps.GetImageableRect(&targetPage); - - sourcePage = m_contentBox; - } - break; - case FitMediaToImageable: - { - m_PGSCProps.GetImageableRect(&targetPage); - - sourcePage = RectF(0, 0, m_pageDimensions.Width, m_pageDimensions.Height); - } - break; - case FitMediaToMedia: - { - SizeF pageSize; - m_PGSCProps.GetPageSize(&pageSize); - targetPage = RectF(0, 0, pageSize.Width, pageSize.Height); - - sourcePage = RectF(0, 0, m_pageDimensions.Width, m_pageDimensions.Height); - } - break; - } - - // - // Calculate scaling factors - // - xScale = static_cast(targetPage.Width / sourcePage.Width); - yScale = static_cast(targetPage.Height / sourcePage.Height); - - // - // Best Fit, always maintain aspect ratio - // Select the smallest of the two scale factors, - // This will ensure that the image always fits on the page. - // - if (xScale < yScale) - { - yScale = xScale; - } - else - { - xScale = yScale; - } - - // - // Calculate the offset to meet the offset alignment setting - // - RectF scaledPage(xScale*sourcePage.X, yScale*sourcePage.Y, xScale*sourcePage.Width, yScale*sourcePage.Height); - switch (offsetOption) - { - case BottomCenter: - { - widthOffset = (targetPage.X + (targetPage.Width/2.0f)) - (scaledPage.X + (scaledPage.Width/2.0f)); - heightOffset = (targetPage.Y + targetPage.Height) - (scaledPage.Y + scaledPage.Height); - } - break; - case BottomLeft: - { - widthOffset = targetPage.X - scaledPage.X; - heightOffset = targetPage.Y + targetPage.Height - (scaledPage.Y + scaledPage.Height); - } - break; - case BottomRight: - { - widthOffset = (targetPage.X + targetPage.Width) - (scaledPage.X + scaledPage.Width); - heightOffset = (targetPage.Y + targetPage.Height) - (scaledPage.Y + scaledPage.Height); - } - break; - case Center: - { - widthOffset = (targetPage.X + (targetPage.Width/2.0f)) - (scaledPage.X + (scaledPage.Width/2.0f)); - heightOffset = (targetPage.Y + (targetPage.Height/2.0f)) - (scaledPage.Y + (scaledPage.Height/2.0f)); - } - break; - case LeftCenter: - { - widthOffset = targetPage.X - scaledPage.X; - heightOffset = (targetPage.Y + (targetPage.Height/2.0f)) - (scaledPage.Y + (scaledPage.Height/2.0f)); - } - break; - case RightCenter: - { - widthOffset = (targetPage.X + targetPage.Width) - (scaledPage.X + scaledPage.Width); - heightOffset = (targetPage.Y + (targetPage.Height/2.0f)) - (scaledPage.Y + (scaledPage.Height/2.0f)); - } - break; - case TopCenter: - { - widthOffset = (targetPage.X + (targetPage.Width/2.0f)) - (scaledPage.X + (scaledPage.Width/2.0f)); - heightOffset = targetPage.Y - scaledPage.Y; - } - break; - default: - case TopLeft: - { - // - // Default Top Left - // - widthOffset = targetPage.X - scaledPage.X; - heightOffset = targetPage.Y - scaledPage.Y; - } - break; - case TopRight: - { - widthOffset = (targetPage.X + targetPage.Width) - (scaledPage.X + scaledPage.Width); - heightOffset = targetPage.Y - scaledPage.Y; - } - break; - } - } - } - break; - - default: - { - // - // No Scaling required. - // - } - break; - } - } - - // - // Apply the transforms to the matrix - // - Status gdiPlusStatus = pMatrix->Scale(xScale, yScale, MatrixOrderAppend); - - if (gdiPlusStatus == Ok) - { - gdiPlusStatus = pMatrix->Translate(widthOffset, heightOffset, MatrixOrderAppend); - } - - if (gdiPlusStatus != Ok) - { - hr = GetGDIStatusErrorAsHResult(gdiPlusStatus); - } - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CPageScaling::CreateTransform - -Routine Description: - - Creates a string representation of the current page scaling matrix. - The string is suitable for use in XPS markup with the 'RenderTransform' keyword. - -Arguments: - - pbstrMatrixXForm - Address of a pointer that will be modified to point to a string - that is filled out with the matrix. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::CreateTransform( - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - - // - // Start with the identity matrix - // - - Matrix xForm; - - if (SUCCEEDED(hr = CalculateMatrix(&xForm))) - { - // - // Retrieve the matrix string - // - hr = MatrixToXML(&xForm, pbstrMatrixXForm); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::GetOpenTagXML - -Routine Description: - - Creates a string that contains the open tag XPS markup required to - scale the page content. Page Scaling is achieved by wrapping the page content - in a canvas and applying a RenderTransform which reflects the current page scaling properties. - -Arguments: - - pbstrXML - Address of a pointer that will be modified to point to a string - that is filled out with the page scaling close tag XPS markup. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetOpenTagXML( - _Outptr_ BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - // - // Create the Canvas with Render Transform - // - try - { - CComBSTR bstrMatrixXForm; - - if (SUCCEEDED(hr = CreateTransform(&bstrMatrixXForm))) - { - CStringXDW cstrCanvas; - cstrCanvas.Format(L"(bstrMatrixXForm)); - *pbstrXML = cstrCanvas.AllocSysString(); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScaling::GetCloseTagXML - -Routine Description: - - Creates a string that contains the close tag XPS markup. - This is achived by closing the canvas tag. - -Arguments: - - pbstrXML - Address of a pointer that will be modified to point to a string - that is filled out with the page scaling close tag XPS markup. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScaling::GetCloseTagXML( - _Outptr_ BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrXML, E_POINTER))) - { - try - { - CStringXDW cstrCanvas(L"\n"); - *pbstrXML = cstrCanvas.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pagescale.h b/print/XPSDrvSmpl/src/filters/scaling/pagescale.h deleted file mode 100644 index 51f9be89..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pagescale.h +++ /dev/null @@ -1,107 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - scalepage.h - -Abstract: - - Page Scaling class implementation. The Page Scaling class provides - functionality required to generate the XPS markup to perform page scaling. - This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the Page Scaling options. - ---*/ - -#pragma once - -#include "pgscptprop.h" - -class CPageScaling -{ -public: - CPageScaling( - _In_ CONST CPGSCPTProperties& psProps - ); - - virtual ~CPageScaling(); - - HRESULT - GetFixedPageWidth( - _Outptr_ BSTR* pbstrWidth - ); - - HRESULT - GetFixedPageHeight( - _Outptr_ BSTR* pbstrHeight - ); - - HRESULT - GetOpenTagXML( - _Outptr_ BSTR* pbstrXML - ); - - HRESULT - GetCloseTagXML( - _Outptr_ BSTR* pbstrXML - ); - - HRESULT - SetPageDimensions( - _In_ CONST REAL width, - _In_ CONST REAL height - ); - - HRESULT - SetBleedBox( - _In_ RectF* pBleedBox - ); - - HRESULT - SetContentBox( - _In_ RectF* pContentBox - ); - -private: - HRESULT - CreateTransform( - _Outptr_ BSTR* pbstrMatrixXForm - ); - - HRESULT - CalculateMatrix( - _Inout_ Matrix* pMatrix - ); - - HRESULT - MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -private: - CComPtr m_pDOMDoc; - - CComPtr m_pCanvasElem; - - CPGSCPTProperties m_PGSCProps; - - RectF m_bleedBox; - - RectF m_contentBox; - - SizeF m_pageDimensions; - - BOOL m_bAddCanvas; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp b/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp deleted file mode 100644 index 9f771658..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscptprop.cpp - -Abstract: - - Page Scaling properties class implementation. The Page Scaling properties class - is responsible for holding and controling Page Scaling properties. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "pgscptprop.h" - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; - -using XDPrintSchema::PageOrientation::PageOrientationData; -using XDPrintSchema::PageOrientation::Landscape; -using XDPrintSchema::PageOrientation::ReverseLandscape; - -using XDPrintSchema::PageMediaSize::PageMediaSizeData; - -using XDPrintSchema::PageImageableSize::PageImageableData; - -/*++ - -Routine Name: - - CPGSCPTProperties::CPGSCPTProperties - -Routine Description: - - CPGSCPTProperties class constructor - -Arguments: - - pgscData - reference to the Page Scaling data. - pSizeData - reference to the Page Size data. - pImageableData - reference to the Page Imageable Size data. - -Return Value: - - None - ---*/ -CPGSCPTProperties::CPGSCPTProperties( - _In_ CONST PageScalingData& pgscData, - _In_ CONST PageMediaSizeData& pSizeData, - _In_ CONST PageImageableData& pImageableData, - _In_ CONST PageOrientationData& pageOrientData - ) : - m_pgscData(pgscData), - m_pageMediaSizeData(pSizeData), - m_pageImageableData(pImageableData), - m_pageOrientData(pageOrientData) -{ -} - -/*++ - -Routine Name: - - CPGSCPTProperties::~CPGSCPTProperties - -Routine Description: - - CPGSCPTProperties class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPGSCPTProperties::~CPGSCPTProperties() -{ -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetOption - -Routine Description: - - Used to obtain the current page scaling option. - -Arguments: - - pOption - Pointer to the page scaling option to filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetOption( - _Out_ EScaleOption* pOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOption, E_POINTER))) - { - *pOption = m_pgscData.pgscOption; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetOffsetOption - -Routine Description: - - Used to obtain the current page scaling offset option. - -Arguments: - - pOffsetOption - Pointer to the page scaling offset option to filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetOffsetOption( - _Out_ EScaleOffsetOption* pOffsetOption - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOffsetOption, E_POINTER))) - { - *pOffsetOption = m_pgscData.offsetOption; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetWidthOffset - -Routine Description: - - Used to obtain the current width offset (Only applies to the custom scaling options). - Units are in 1/96 Inch. - -Arguments: - - pWidthOffset - Pointer to the width offset data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetWidthOffset( - _Out_ REAL* pWidthOffset - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWidthOffset, E_POINTER))) - { - *pWidthOffset = static_cast(m_pgscData.offWidth)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetHeightOffset - -Routine Description: - - Used to obtain the current height offset (Only applies to the custom scaling options). - Units are in 1/96 Inch. - -Arguments: - - pHeightOffset - Pointer to the height offset data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetHeightOffset( - _Out_ REAL* pHeightOffset - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHeightOffset, E_POINTER))) - { - *pHeightOffset = static_cast(m_pgscData.offHeight)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetWidthScale - -Routine Description: - - Used to obtain the current width scale percentage - (Only applies to the custom scaling options). - -Arguments: - - pWidthScale - Pointer to the width scale data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetWidthScale( - _Out_ REAL* pWidthScale - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pWidthScale, E_POINTER))) - { - *pWidthScale = static_cast(m_pgscData.scaleWidth)/100.00f; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetHeightScale - -Routine Description: - - Used to obtain the current height scale percentage - (Only applies to the custom scaling options). - -Arguments: - - pHeightScale - Pointer to the height scale data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetHeightScale( - _Out_ REAL* pHeightScale - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHeightScale, E_POINTER))) - { - *pHeightScale = static_cast(m_pgscData.scaleHeight)/100.00f; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetPageSize - -Routine Description: - - Used to obtain the current page size. Units are in 1/96 Inch. - - Note: This returns the page dimensions accounting for the orientation and media size - expressed by the PrintTicket as PageOrientation and PageMediaSize. The PageMediaSize - expresses the dimensions using the convention that the page is oriented as portrait. - To get the dimensions for scaling we need to swap width for height when in landscape - so that we can scale the FixedPage content appropriately. - -Arguments: - - pSizePage - Pointer to the page size data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetPageSize( - _Out_ SizeF* pSizePage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSizePage, E_POINTER))) - { - // - // Convert microns to 96th of an inch - // - pSizePage->Width = static_cast(m_pageMediaSizeData.pageWidth)/k96thInchAsMicrons; - pSizePage->Height = static_cast(m_pageMediaSizeData.pageHeight)/k96thInchAsMicrons; - - // - // Swap dimensions if the orientation is a landscape orientation - // - if (m_pageOrientData.orientation == Landscape || - m_pageOrientData.orientation == ReverseLandscape) - { - REAL sizeSwap = pSizePage->Width; - pSizePage->Width = pSizePage->Height; - pSizePage->Height = sizeSwap; - } - - if (pSizePage->Width <= 0.0f || - pSizePage->Height <= 0.0f) - { - // - // The page media size is incorrect - // - ERR("Could not acquire a valid media page size\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPGSCPTProperties::GetImageableRect - -Routine Description: - - Used to obtain the current page imageable area and offset. - Units are in 1/96 Inch. - -Arguments: - - pImageableRect - Pointer to the page imageable data to be filled out. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPGSCPTProperties::GetImageableRect( - _Out_ RectF* pImageableRect - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pImageableRect, E_POINTER))) - { - pImageableRect->X = 0; - pImageableRect->Y = 0; - pImageableRect->Width = 0; - pImageableRect->Height = 0; - - // - // Get the size of the area - convert microns to 96th of an inch - // - SizeF sizeImage; - if (m_pageImageableData.imageableSizeWidth > 0 && - m_pageImageableData.imageableSizeHeight > 0) - { - sizeImage.Width = static_cast(m_pageImageableData.imageableSizeWidth)/k96thInchAsMicrons; - sizeImage.Height = static_cast(m_pageImageableData.imageableSizeHeight)/k96thInchAsMicrons; - } - else - { - // - // Page imageable size was not set - use the page media size - // - sizeImage.Width = static_cast(m_pageMediaSizeData.pageWidth)/k96thInchAsMicrons; - sizeImage.Height = static_cast(m_pageMediaSizeData.pageHeight)/k96thInchAsMicrons; - } - - // - // Get the offset of the area - convert microns to 96th of an inch - // - PointF offsetImage(static_cast(m_pageImageableData.originWidth)/k96thInchAsMicrons, - static_cast(m_pageImageableData.originHeight)/k96thInchAsMicrons); - - // - // Swap dimensions if the orientation is a landscape orientation - // - if (m_pageOrientData.orientation == Landscape || - m_pageOrientData.orientation == ReverseLandscape) - { - pImageableRect->Width = sizeImage.Height; - pImageableRect->Height = sizeImage.Width; - - pImageableRect->X = offsetImage.Y; - pImageableRect->Y = offsetImage.X; - } - else - { - pImageableRect->Width = sizeImage.Width; - pImageableRect->Height = sizeImage.Height; - - pImageableRect->X = offsetImage.X; - pImageableRect->Y = offsetImage.Y; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h b/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h deleted file mode 100644 index 99cb5328..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/pgscptprop.h +++ /dev/null @@ -1,91 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscptprop.h - -Abstract: - - Page Scaling properties class definition. The Page Scaling properties class - is responsible for holding and controling Page Scaling properties. - ---*/ - -#pragma once - -#include "pgscdata.h" -#include "psizedata.h" -#include "pimagedata.h" -#include "porientdata.h" - -class CPGSCPTProperties -{ -public: - CPGSCPTProperties( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData& pgscData, - _In_ CONST XDPrintSchema::PageMediaSize::PageMediaSizeData& psizeData, - _In_ CONST XDPrintSchema::PageImageableSize::PageImageableData& pimageableData, - _In_ CONST XDPrintSchema::PageOrientation::PageOrientationData& pageOrientData - ); - - virtual ~CPGSCPTProperties(); - - HRESULT - GetOption( - _Out_ XDPrintSchema::PageScaling::EScaleOption* pScaleOption - ); - - HRESULT - GetWidthOffset( - _Out_ REAL* pWidthOffset - ); - - HRESULT - GetHeightOffset( - _Out_ REAL* pHeightOffset - ); - - HRESULT - GetWidthScale( - _Out_ REAL* pWidthScale - ); - - HRESULT - GetHeightScale( - _Out_ REAL* pHeightScale - ); - - HRESULT - GetOffsetOption( - _Out_ XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption* pOffsetOption - ); - - HRESULT - GetPageSize( - _Out_ SizeF* pSizePage - ); - - HRESULT - GetImageableRect( - _Out_ RectF* pImageableRect - ); - -protected: - XDPrintSchema::PageScaling::PageScalingData m_pgscData; - - XDPrintSchema::PageMediaSize::PageMediaSizeData m_pageMediaSizeData; - - XDPrintSchema::PageImageableSize::PageImageableData m_pageImageableData; - - XDPrintSchema::PageOrientation::PageOrientationData m_pageOrientData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/scaling/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp b/print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp deleted file mode 100644 index 1827a9a2..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - scaleflt.cpp - -Abstract: - - Page Scaling filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support Page Scaling - printing. The Page Scaling filter is responsible for modifying the XPS document - to add the appropriate mark-up onto pages to achieve scaling. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "scaleflt.h" -#include "pagescale.h" -#include "scalesax.h" -#include "psizepthndlr.h" -#include "pimagepthndlr.h" -#include "pgscpthndlr.h" -#include "porientpthndlr.h" - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageMediaSize::PageMediaSizeData; -using XDPrintSchema::PageImageableSize::PageImageableData; -using XDPrintSchema::PageOrientation::PageOrientationData; - -/*++ - -Routine Name: - - CPageScalingFilter::CPageScalingFilter - -Routine Description: - - CPageScalingFilter class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingFilter::CPageScalingFilter() -{ - ASSERTMSG(m_gdiPlus.GetGDIPlusStartStatus() == Ok, "GDI plus is not correctly initialized.\n"); -} - -/*++ - -Routine Name: - - CPageScalingFilter::~CPageScalingFilter - -Routine Description: - - CPageScalingFilter class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingFilter::~CPageScalingFilter() -{ -} - -/*++ - -Routine Name: - - CPageScalingFilter::ProcessFixedPage - -Routine Description: - - This method processes the XPS content of a page applying - any scaling required according to information in the PrintTicket. - The result is written out to a new XPS document. - -Arguments: - - pPrintTicket - Pointer to the XML PrintTicket Document that is associated with the page. - pPageReadStream - Pointer to the input stream interface for the XPS Page. - pPageWriteStream - Pointer to the output stream interface for the XPS Page. - -Return Value: - - HRESULT - S_OK - On success - HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED) - When the fixed page is not to be modified - E_* - On error - ---*/ -HRESULT -CPageScalingFilter::ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ) -{ - VERBOSE("Processing stream fixed page with page scaling handler\n"); - - HRESULT hr = S_OK; - - CPageScaling* pPageScaling = NULL; - CComPtr pSaxRdr(NULL); - CComPtr pPrintCapabilities(NULL); - - if (SUCCEEDED(hr = m_ptManager.GetCapabilities(pFPPT, &pPrintCapabilities)) && - SUCCEEDED(hr = CHECK_POINTER(pFPPT, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPageReadStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPageWriteStream, E_POINTER)) && - SUCCEEDED(hr = GetPageScaling(pFPPT, pPrintCapabilities, &pPageScaling)) && - SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60))) - { - // - // Set-up the SAX reader and begin parsing the mark-up - // - CScaleSaxHandler scaleSaxHndlr(pPageWriteStream, pPageScaling); - - if (SUCCEEDED(hr = pSaxRdr->putContentHandler(&scaleSaxHndlr))) - { - hr = pSaxRdr->parse(CComVariant(pPageReadStream)); - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // No Page Scaling was found in the PrintTicket - return error not supported so - // the xps container sends the unmodified data - // - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - - // - // Clean up the Page Scaling if it was successfully created - // - if (pPageScaling != NULL) - { - delete pPageScaling; - pPageScaling = NULL; - } - - ERR_ON_HR_EXC(hr, HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingFilter::GetPageScaling - -Routine Description: - - Creates and initialises an instance of the Page Scaling Interface - using the information in the PrintTicket provided. - -Arguments: - - pPrintTicket - Pointer to an XML PrintTicket Document. - pPrintCapabilities - Pointer to an XML PrintCapabilities Document. - ppPageScaling - Address of pointer that receives the Page Scaling Interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingFilter::GetPageScaling( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ IXMLDOMDocument2* pPrintCapabilities, - _Outptr_ CPageScaling** ppPageScaling - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPageScaling, E_POINTER))) - { - *ppPageScaling = NULL; - - try - { - CPageScalingPTHandler pgscPTHandler(pPrintTicket); - CPageImageablePCHandler imagePCHandler(pPrintCapabilities); - CPageSizePTHandler sizePTHandler(pPrintTicket); - CPageOrientationPTHandler orientPTHandler(pPrintTicket); - - PageScalingData pgscData; - PageMediaSizeData sizeData; - PageImageableData imageData; - PageOrientationData orientData; - - if (SUCCEEDED(hr = pgscPTHandler.GetData(&pgscData)) && - SUCCEEDED(hr = sizePTHandler.GetData(&sizeData)) && - SUCCEEDED(hr = orientPTHandler.GetData(&orientData))) - { - hr = imagePCHandler.GetData(&imageData); - - // - // The imageable area property in a PrintTicket is an optional requirement. - // - if (hr == E_ELEMENT_NOT_FOUND) - { - hr = S_OK; - } - - if (SUCCEEDED(hr)) - { - CPGSCPTProperties pgscProperties(pgscData, sizeData, imageData, orientData); - - *ppPageScaling = new(std::nothrow) CPageScaling(pgscProperties); - - if (*ppPageScaling == NULL) - { - hr = E_OUTOFMEMORY; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.h b/print/XPSDrvSmpl/src/filters/scaling/scaleflt.h deleted file mode 100644 index 2e8307c0..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.h +++ /dev/null @@ -1,56 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - scaleflt.h - -Abstract: - - Page Scaling filter defnition. This class derives from the Xps filter - class and implements the necessary part handlers to support Page Scaling. - The Page Scaling filter is responsible for adding mark-up to - the XPS document to allow scaling of pages. - ---*/ - -#pragma once - -#include "xdstrmflt.h" -#include "pagescale.h" -#include "gdip.h" - -class CPageScalingFilter : public CXDStreamFilter -{ -public: - CPageScalingFilter(); - - virtual ~CPageScalingFilter(); - - virtual HRESULT - ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _In_ ISequentialStream* pPageWriteStream - ); - -private: - HRESULT - GetPageScaling( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ IXMLDOMDocument2* pPrintCapabilities, - _Outptr_ CPageScaling** ppPageScaling - ); - -private: - GDIPlus m_gdiPlus; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc b/print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc deleted file mode 100644 index 677e6c0a..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scaleflt.rc +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) 2005 Microsoft Corporation -// -// All rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// File Name: -// -// scaleflt.rc -// -// Abstract: -// -// Page Scaling filter resource file. -// -// - -#include -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Scaling Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp b/print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp deleted file mode 100644 index 43219976..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scalesax.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - scalesax.xpp - -Abstract: - - Page Scaling SAX handler implementation. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. - -Known Issues: - - Need to check if all resources are required resources are being added to the - resource copying class. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "scalesax.h" - -/*++ - -Routine Name: - - CScaleSaxHandler::CScaleSaxHandler - -Routine Description: - - CScaleSaxHandler class constructor - -Arguments: - - pWriter - Pointer to the output stream interface for the XPS page markup. - pPageScaling - Pointer to the Page Scaling Interface. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CScaleSaxHandler::CScaleSaxHandler( - _In_ ISequentialStream* pWriter, - _In_ CPageScaling* pPageScaling - ) : - m_pWriter(pWriter), - m_pPageScaling(pPageScaling), - m_bOpenTag(FALSE) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to page scaling SAX handler.\n"); - ASSERTMSG(m_pPageScaling != NULL, "NULL page scaling class passed to page scaling SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_pPageScaling, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CScaleSaxHandler::~CScaleSaxHandler - -Routine Description: - - CScaleSaxHandler class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CScaleSaxHandler::~CScaleSaxHandler() -{ - m_bstrOpenElement.Empty(); -} - -/*++ - -Routine Name: - - CScaleSaxHandler::startElement - -Routine Description: - - Receives notification of the beginning of an XML element in the XPS page. - The page scaling filter parses each element, applies any changes - and writes out the resultant XPS markup. - -Arguments: - - pwchQName - The XML 1.0 qualified name (QName), with prefix, or an empty string - (if QNames are not available). - cchQName - The length of the QName. - pAttributes - The attributes attached to the element. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CScaleSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - - // - // If this is the fixed page we need the width and height retrieved - // - BOOL bIsFixedPage = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - bIsFixedPage = (bstrElement == L"FixedPage"); - - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">\n"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = bstrElement; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - // - // Write out element - // - try - { - cstrOut.Append(L"<"); - cstrOut.Append(m_bstrOpenElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // We opened a tag - // - m_bOpenTag = TRUE; - - REAL widthPage(0.0f); - REAL heightPage(0.0f); - RectF bleedBox(0.0f, 0.0f, 0.0f, 0.0f); - RectF contentBox(0.0f, 0.0f, 0.0f, 0.0f); - - BOOL bBleedBoxSet = FALSE; - BOOL bContentBoxSet = FALSE; - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - // - // If this is the fixed page we want to retrieve the - // dimensions of the fixed page - take the opportunity - // to do so now while we parse the attributes - // - if (bIsFixedPage) - { - if (bstrAttName == L"Width") - { - widthPage = static_cast(_wtof(bstrAttValue)); - } - else if (bstrAttName == L"Height") - { - heightPage = static_cast(_wtof(bstrAttValue)); - } - else if (bstrAttName == L"ContentBox") - { - CStringXDW str( bstrAttValue ); - CStringXDW resToken; - INT curPos= 0; - bContentBoxSet = TRUE; - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.X = static_cast(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.Y = static_cast(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.Width = static_cast(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != L"") - { - contentBox.Height = static_cast(_wtof(resToken)); - } - } - else if (bstrAttName == L"BleedBox") - { - CStringXDW str( bstrAttValue ); - CStringXDW resToken; - INT curPos= 0; - bBleedBoxSet = TRUE; - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.X = static_cast(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.Y = static_cast(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.Width = static_cast(_wtof(resToken)); - } - - resToken = str.Tokenize(L",",curPos); - - if (resToken != "") - { - bleedBox.Height = static_cast(_wtof(resToken)); - } - } - } - - // - // As we are applying scaling we need to remove the bleedBox and contentBox - // - if (bstrAttName != L"BleedBox" && - bstrAttName != L"ContentBox") - { - // - // Replace the Width and Height aValues with the target papersize - // - if (bstrAttName == L"Width") - { - CComBSTR bstrWidthValue; - if (SUCCEEDED(hr = m_pPageScaling->GetFixedPageWidth(&bstrWidthValue))) - { - if (bstrWidthValue.Length() > 0) - { - bstrAttValue = bstrWidthValue; - } - } - } - else if (bstrAttName == L"Height") - { - CComBSTR bstrHeightValue; - if (SUCCEEDED(hr = m_pPageScaling->GetFixedPageHeight(&bstrHeightValue))) - { - if (bstrHeightValue.Length() > 0) - { - bstrAttValue = bstrHeightValue; - } - } - } - - if (SUCCEEDED(hr)) - { - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - } - } - - // - // If bleedbox hasn't been set, set it to the page dimensions - // - if (bBleedBoxSet == FALSE) - { - bleedBox.Width = widthPage; - bleedBox.Height = heightPage; - } - - // - // If contentbox hasn't been set, set it to the page dimensions - // - if (bContentBoxSet == FALSE) - { - contentBox.Width = widthPage; - contentBox.Height = heightPage; - } - - if (SUCCEEDED(hr = m_pPageScaling->SetPageDimensions(widthPage, heightPage)) && - SUCCEEDED(hr = m_pPageScaling->SetBleedBox(&bleedBox)) && - SUCCEEDED(hr = m_pPageScaling->SetContentBox(&contentBox))) - { - if (bIsFixedPage) - { - try - { - // - // Close the fixed page tag - // - cstrOut.Append(L">"); - - // - // Create and retrieve the markup for the Canvas - // - CComBSTR bstrCanvasText; - if (SUCCEEDED(hr = m_pPageScaling->GetOpenTagXML(&bstrCanvasText))) - { - // - // Insert the mark-up by writing after the opening fixed page - // remembering to close the tag first - // - cstrOut.Append(bstrCanvasText); - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScaleSaxHandler::endElement - -Routine Description: - - Receives notification of the end of an XML element in the XPS page. - The page scaling filter parses each element, applies any changes - and writes out the resultant XPS markup. - - A corresponding startElement method is invoked for every endElement method, even when the element is empty. - -Arguments: - - pwchQName - The XML 1.0 qualified name (QName), with prefix, or an empty string - (if QNames are not available). - cchQName - The length of the QName. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CScaleSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrClose; - BOOL bIsFixedPage = FALSE; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - bIsFixedPage = (bstrElement == L"FixedPage"); - - // - // If this is a root element with child nodes, the open - // element will not match the last startElement. In this case - // we need to add an appropriate closing tag - // - if (bstrElement == m_bstrOpenElement) - { - // - // Names match so just add a closing bracket - // - if (m_bOpenTag) - { - cstrClose.Append(L"/>\n"); - } - } - else - { - // - // Close Canvas if previously opened. - // - if (bIsFixedPage) - { - // - // Insert the closing canvas mark-up before closing the fixed page - // - CComBSTR bstrCloseCanvasText; - if (SUCCEEDED(hr = m_pPageScaling->GetCloseTagXML(&bstrCloseCanvasText))) - { - cstrClose.Append(bstrCloseCanvasText); - } - } - - // - // Add a full closing tag - // - cstrClose.Append(L"\n"); - } - - m_bOpenTag = FALSE; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CScaleSaxHandler::startDocument - -Routine Description: - - This method writes out the header markup for the XPS page. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CScaleSaxHandler::startDocument() -{ - HRESULT hr = S_OK; - - try - { - CStringXDW cstrXMLVersion(L""); - hr = WriteToPrintStream(&cstrXMLVersion, m_pWriter); - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/scaling/scalesax.h b/print/XPSDrvSmpl/src/filters/scaling/scalesax.h deleted file mode 100644 index 2e10e971..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/scalesax.h +++ /dev/null @@ -1,75 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - scalesax.h - -Abstract: - - Page Scaling SAX handler definition. The class derives from the default SAX handler - and implements only the necessary SAX APIs to process the mark-up. The - handler is responsible for copying page mark-up to a writer, removing - the fixed page opening and closing tags. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "pagescale.h" - -class CScaleSaxHandler : public CSaxHandler -{ -public: - CScaleSaxHandler( - _In_ ISequentialStream* pWriter, - _In_ CPageScaling* pPageScaling - ); - - virtual ~CScaleSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - -private: - CComPtr m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CPageScaling* m_pPageScaling; -}; - diff --git a/print/XPSDrvSmpl/src/filters/scaling/xdscale.def b/print/XPSDrvSmpl/src/filters/scaling/xdscale.def deleted file mode 100644 index 82d0a024..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/xdscale.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 Microsoft Corporation -; -; All rights reserved. -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; File Name: -; -; xdscale.def -; -; Abstract: -; -; Page Scaling filter module definition file -; - -LIBRARY XDScale - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj b/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj deleted file mode 100644 index a2a09897..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj +++ /dev/null @@ -1,578 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {1893FA97-40A9-480F-BB77-279F959EAE6E} - $(MSBuildProjectName) - false - true - Debug - Win32 - {79E3B808-CF1F-48F7-B76D-97BFFFEFF2D5} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - xdscale - - - xdscale - - - xdscale - - - xdscale - - - xdscale - - - xdscale - - - xdscale - - - xdscale - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\xdcont - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);.\..\xdcont\$(IntDir)\xdcont.lib - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - xdscale.def - - - - - xdscale.def - - - - - xdscale.def - - - - - xdscale.def - - - - - xdscale.def - - - - - xdscale.def - - - - - xdscale.def - - - - - xdscale.def - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj.Filters deleted file mode 100644 index a280f042..00000000 --- a/print/XPSDrvSmpl/src/filters/scaling/xdscale.vcxproj.Filters +++ /dev/null @@ -1,79 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {B7C68E16-EA47-4D1B-8022-13F7CB1ED129} - - - h;hpp;hxx;hm;inl;inc;xsd - {406C7911-614E-48F2-A001-163ED9285D10} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {C852B60D-E874-41E7-B59F-2FBA134E0B5B} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - Header Files - - - - - - Header Files - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/watermark/Raster1.png b/print/XPSDrvSmpl/src/filters/watermark/Raster1.png deleted file mode 100644 index 4c11e3c0..00000000 Binary files a/print/XPSDrvSmpl/src/filters/watermark/Raster1.png and /dev/null differ diff --git a/print/XPSDrvSmpl/src/filters/watermark/Vector1.xps b/print/XPSDrvSmpl/src/filters/watermark/Vector1.xps deleted file mode 100644 index 8227a215..00000000 Binary files a/print/XPSDrvSmpl/src/filters/watermark/Vector1.xps and /dev/null differ diff --git a/print/XPSDrvSmpl/src/filters/watermark/dllentry.cpp b/print/XPSDrvSmpl/src/filters/watermark/dllentry.cpp deleted file mode 100644 index dc4f7974..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/dllentry.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the watermark filter dllentry points. Dllmain only - stores the instance handle. DllGetClassObject calls on to a generic - get class factory template function. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "clasfact.h" -#include "wmflt.h" -#include "xdexcept.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point to the watermark filter which is called when a new process is started - -Arguments: - - hInst - Handle to the DLL - wReason - Specifies a flag indicating why the DLL entry-point function is being called - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Method which reports whether the DLL is in use to allow the caller to unload - the DLL safely - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Method to return the current class object - -Arguments: - - rclsid - CLSID that will associate the correct data and code - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object - ppv - Address of pointer variable that receives the interface pointer requested in riid - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - // - // B8B525BF-F147-460a-B2D5-9DFB1F30D0FD - // - CLSID watermarkCLSID = {0xB8B525BF, 0xF147, 0x460a, {0xB2, 0xD5, 0x9D, 0xFB, 0x1F, 0x30, 0xD0, 0xFD}}; - - return GetFilterClassFactory(rclsid, riid, watermarkCLSID, ppv); -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/watermark/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp deleted file mode 100644 index 97d15b3e..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmbase.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmbase.cpp - -Abstract: - - Base watermark class implementation. The base watermark class provides - common functionality required between different watermarks (Text, RasterGraphic - and VectorGraphic. This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the watermark options. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmbase.h" - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; -using XDPrintSchema::PageWatermark::Layering::Overlay; -using XDPrintSchema::PageWatermark::Layering::Underlay; - -/*++ - -Routine Name: - - CWatermark::CWatermark - -Routine Description: - - Constructor for the base watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermark::CWatermark( - _In_ CONST CWMPTProperties& wmProps - ) : - m_pDOMDoc(NULL), - m_WMProps(wmProps) -{ - // - // Create the DOM document so that sub-classes have access ASAP - // - HRESULT hr = m_pDOMDoc.CoCreateInstance(CLSID_DOMDocument60); - - if (FAILED(hr)) - { - ERR("Failed to create watermark DOM document.\n"); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermark::~CWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermark::~CWatermark() -{ -} - -/*++ - -Routine Name: - - CWatermark::MatrixToXML - -Routine Description: - - Method to create XML markup representing the - supplied transformation matrix - -Arguments: - - pMatrix - Pointer to the transformation matrix to convert to XML - pbstrMatrixXForm - Pointer to the string which will containg the matrix markup - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - // - // Construct the matric mark-up from a GDI+ matrix - // - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pMatrix, E_POINTER))) - { - REAL matElems[6]; - if (Ok == pMatrix->GetElements(matElems)) - { - try - { - CStringXDW cstrMatrix; - cstrMatrix.Format(L"%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", - matElems[0], - matElems[1], - matElems[2], - matElems[3], - matElems[4], - matElems[5]); - - *pbstrMatrixXForm = cstrMatrix.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - *pbstrMatrixXForm = NULL; - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::GetXML - -Routine Description: - - Method to get the XML containing the watermark text - -Arguments: - - pbstrXML - Pointer to the string to hold the watermark XML text - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::GetXML( - _Outptr_ BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrXML, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pWMElem, E_PENDING))) - { - hr = m_pWMElem->get_xml(pbstrXML); - - if (SUCCEEDED(hr)) - { - _Analysis_assume_nullterminated_(*pbstrXML); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::CreateWMTransform - -Routine Description: - - Method to create a transformation matrix which will scale, translate and rotate - the watermark to correctly fit onto the page. This overload perform scaling to fit - the watermark content to the requested bounds and is used when creating the bitmap - or vector watermark. - -Arguments: - - wmBounds - Rectangular area to contain the watermark - pbstrMatrixXForm - Pointer to the string to contain the watermark transformation matrix - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::CreateWMTransform( - _In_ RectF wmBounds, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - ASSERTMSG(wmBounds.Width > 0, "Zero width watermark found whilst creating transform\n"); - ASSERTMSG(wmBounds.Height > 0, "Zero height watermark found whilst creating transform\n"); - - HRESULT hr = S_OK; - - if (wmBounds.Width <= 0 || wmBounds.Height <= 0) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - - RectF targetBounds; - REAL angle = 0; - - if (SUCCEEDED(hr = m_WMProps.GetBounds(&targetBounds)) && - SUCCEEDED(hr = m_WMProps.GetAngle(&angle))) - { - ASSERTMSG(targetBounds.Width > 0, "Zero width target found whilst creating transform\n"); - ASSERTMSG(targetBounds.Height > 0, "Zero height target found whilst creating transform\n"); - - // - // Start with the identity matrix - // - Matrix xForm; - - // - // Offset to the target bounds - // - PointF offset(targetBounds.X - wmBounds.X, targetBounds.Y - wmBounds.Y); - - // - // Apply the transforms to the matrix - // - xForm.Scale(targetBounds.Width/wmBounds.Width, targetBounds.Height/wmBounds.Height, MatrixOrderAppend); - xForm.Rotate(angle, MatrixOrderAppend); - xForm.Translate(offset.X, offset.Y, MatrixOrderAppend); - - // - // Retrieve the matrix string - // - hr = MatrixToXML(&xForm, pbstrMatrixXForm); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::CreateWMTransform - -Routine Description: - - Method to create a transformation matrix which will translate and rotate. This overload - does not perform any scaling to fit the watermark content and is used when creating the - text watermark. - -Arguments: - - wmOrigin - Point defining the watermark origin - pbstrMatrixXForm - Pointer to the string to contain the watermark transformation matrix - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermark::CreateWMTransform( - _In_ PointF wmOrigin, - _Outptr_ BSTR* pbstrMatrixXForm - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrMatrixXForm, E_POINTER))) - { - *pbstrMatrixXForm = NULL; - REAL angle = 0; - - if (SUCCEEDED(hr = m_WMProps.GetAngle(&angle))) - { - // - // Start with the identity matrix - // - Matrix xForm; - - // - // Apply the transforms to the matrix - // - xForm.Rotate(angle, MatrixOrderAppend); - xForm.Translate(wmOrigin.X, wmOrigin.Y, MatrixOrderAppend); - - // - // Retrieve the matrix string - // - hr = MatrixToXML(&xForm, pbstrMatrixXForm); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermark::InsertStart - -Routine Description: - - Method to check whether the watermark should be inserted at the start of the - page to create an underlay effect - -Arguments: - - None - -Return Value: - - BOOL - TRUE - The watermark mark-up needs to be inserted at the start of the fixed page - FALSE - The watermark mark-up needs to be inserted at the end of the fixed page - ---*/ -BOOL -CWatermark::InsertStart( - VOID - ) -{ - ELayeringOption wmLayering = Overlay; - - m_WMProps.GetLayering(&wmLayering); - - return wmLayering == Underlay; -} - -/*++ - -Routine Name: - - CWatermark::InsertEnd - -Routine Description: - - Method to check whether the watermark should be inserted at the - end of the page to create an overlay effect - -Arguments: - - None - -Return Value: - - BOOL - TRUE - The watermark mark-up needs to be inserted at the end of the fixed page - FALSE - The watermark mark-up needs to be inserted at the start of the fixed page - ---*/ -BOOL -CWatermark::InsertEnd( - VOID - ) -{ - return !InsertStart(); -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmbase.h b/print/XPSDrvSmpl/src/filters/watermark/wmbase.h deleted file mode 100644 index 9638425e..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmbase.h +++ /dev/null @@ -1,95 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmbase.h - -Abstract: - - Base watermark class implementation. The base watermark class provides - common functionality required between different watermarks (Text, RasterGraphic - and VectorGraphic. This includes methods for converting a GDI matrix object - into the appropriate XPS matrix mark-up and intialising the matrix according to - the watermark options. - ---*/ - -#pragma once - -#include "rescache.h" -#include "wmptprop.h" - -class CWatermark -{ -public: - CWatermark( - _In_ CONST CWMPTProperties& wmProps - ); - - virtual ~CWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ) = 0; - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - - ) = 0; - - virtual HRESULT - GetXML( - _Outptr_ BSTR* pbstrXML - ); - - virtual BOOL - InsertStart( - VOID - ); - - virtual BOOL - InsertEnd( - VOID - ); - -protected: - HRESULT - CreateWMTransform( - _In_ RectF wmBounds, - _Outptr_ BSTR* pbstrMatrixXForm - ); - - HRESULT - CreateWMTransform( - _In_ PointF wmOrigin, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -private: - HRESULT - MatrixToXML( - _In_ CONST Matrix* pMatrix, - _Outptr_ BSTR* pbstrMatrixXForm - ); - -protected: - CComPtr m_pDOMDoc; - - CComPtr m_pWMElem; - - CWMPTProperties m_WMProps; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp deleted file mode 100644 index 13e171d4..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmflt.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmflt.cpp - -Abstract: - - Watermark filter implementation. This class derives from the Xps filter - class and implements the necessary part handlers to support Watermark - printing. The Watermark filter is responsible for adding resources to - the XPS document and putting the appropriate mark-up onto pages with a - watermark. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "wmflt.h" -#include "wmtext.h" -#include "wmrast.h" -#include "wmvect.h" -#include "wmsax.h" -#include "wmpthndlr.h" -#include "wmres.h" - -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; - -/*++ - -Routine Name: - - CWatermarkFilter::CWatermarkFilter - -Routine Description: - - Default constructor for the watermark filter which ensures GDI plus is correctly running - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkFilter::CWatermarkFilter() -{ - ASSERTMSG(m_gdiPlus.GetGDIPlusStartStatus() == Ok, "GDI plus is not correctly initialized.\n"); -} - -/*++ - -Routine Name: - - CWatermarkFilter::~CWatermarkFilter - -Routine Description: - - Default destructor for the watermark filter - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkFilter::~CWatermarkFilter() -{ -} - -/*++ - -Routine Name: - - CWatermarkFilter::ProcessPart - -Routine Description: - - Method for processing each fixed page part in a container - -Arguments: - - pFP - Pointer to the fixed page to process - -Return Value: - - HRESULT - S_OK - On success - S_FALSE - When not enabled in the PT - E_* - On error - ---*/ -HRESULT -CWatermarkFilter::ProcessPart( - _Inout_ IFixedPage* pFP - ) -{ - VERBOSE("Processing Fixed Page part with watermark handler\n"); - - HRESULT hr = S_OK; - CWatermark* pWatermark = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pFP, E_POINTER))) - { - // - // Retrieve the watermark settings from the PrintTicket - // - IXMLDOMDocument2* pPT = NULL; - if (SUCCEEDED(hr = m_ptManager.SetTicket(pFP)) && - SUCCEEDED(hr = m_ptManager.GetTicket(kPTPageScope, &pPT)) && - SUCCEEDED(hr = GetWatermark(pPT, &pWatermark)) && - SUCCEEDED(hr = CHECK_POINTER(pWatermark, E_FAIL))) - { - // - // Add the resource part - // - if (SUCCEEDED(hr = pWatermark->AddParts(m_pXDWriter, pFP, &m_resCache))) - { - // - // Retrieve the writer from the fixed page - // - CComPtr pWriter(NULL); - - if (SUCCEEDED(hr = pFP->GetWriteStream(&pWriter))) - { - // - // Set-up the SAX reader and begin parsing the mark-up - // - CComPtr pSaxRdr(NULL); - CComPtr pReader(NULL); - - try - { - CWMSaxHandler wmSaxHndlr(pWriter, pWatermark); - - if (SUCCEEDED(hr = pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = pSaxRdr->putContentHandler(&wmSaxHndlr)) && - SUCCEEDED(hr = pFP->GetStream(&pReader))) - { - CComPtr pReadStreamToSeq(NULL); - - pReadStreamToSeq.Attach(new(std::nothrow) pfp::PrintReadStreamToSeqStream(pReader)); - - if (SUCCEEDED(hr = CHECK_POINTER(pReadStreamToSeq, E_OUTOFMEMORY))) - { - hr = pSaxRdr->parse(CComVariant(static_cast(pReadStreamToSeq))); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - pWriter->Close(); - } - } - else if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) - { - // - // Could not find resource file - fail gracefully so we continue - // to process the document - // - ERR("Specified resource file does not exist\n"); - hr = S_FALSE; - } - else if (hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)) - { - // - // Insufficient rights to open file - fail gracefully so we continue - // to process the document - // - ERR("Insufficient rights to open resource file\n"); - hr = S_FALSE; - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)) - { - // - // We do not support this URI as a resource - fail gracefully so we continue - // to process the document - // - ERR("Unsupported URI to resource resource\n"); - hr = S_FALSE; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // No watermark was found in the PrintTicket - do not propogate this error - // - hr = S_FALSE; - } - } - - // - // Clean up the watermark if it was successfully created - // - if (pWatermark != NULL) - { - delete pWatermark; - pWatermark = NULL; - } - - if (SUCCEEDED(hr)) - { - // - // We can send the fixed page - // - hr = m_pXDWriter->SendFixedPage(pFP); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFilter::GetWatermark - -Routine Description: - - Method for obtaining the watermark PrintTicket preferences - -Arguments: - - pPrintTicket - DOM document containing the PrintTicket - ppWatermark - Pointer to object which will contain the values - read from the PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - When feature not present in the PT - E_* - On error - ---*/ -HRESULT -CWatermarkFilter::GetWatermark( - _In_ IXMLDOMDocument2* pPrintTicket, - _Outptr_result_maybenull_ CWatermark** ppWatermark - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppWatermark, E_POINTER))) - { - *ppWatermark = NULL; - - try - { - - CWMPTHandler wmPTHandler(pPrintTicket); - WatermarkData wmData; - - if (SUCCEEDED(hr = wmPTHandler.GetData(&wmData))) - { - CWMPTProperties wmProperties(wmData); - - EWatermarkOption wmOption; - - if (SUCCEEDED(hr = wmProperties.GetType(&wmOption))) - { - switch (wmOption) - { - case TextWatermark: - { - *ppWatermark = new(std::nothrow) CTextWatermark(wmProperties); - - if (*ppWatermark == NULL) - { - hr = E_OUTOFMEMORY; - } - } - break; - - case BitmapWatermark: - { - *ppWatermark = new(std::nothrow) CRasterWatermark(wmProperties, IDR_WM_PNG1); - - if (*ppWatermark == NULL) - { - hr = E_OUTOFMEMORY; - } - } - break; - - case VectorWatermark: - { - *ppWatermark = new(std::nothrow) CVectorWatermark(wmProperties, IDR_WM_XPS1); - - if (*ppWatermark == NULL) - { - hr = E_OUTOFMEMORY; - } - } - break; - - default: - { - hr = E_ELEMENT_NOT_FOUND; - } - break; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmflt.h b/print/XPSDrvSmpl/src/filters/watermark/wmflt.h deleted file mode 100644 index 8fa42ca1..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmflt.h +++ /dev/null @@ -1,54 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmflt.h - -Abstract: - - Watermark filter defnition. This class derives from the Xps filter - class and implements the necessary part handlers to support Watermark - printing. The Watermark filter is responsible for adding resources to - the XPS document and putting the appropriate mark-up onto pages with a - watermark - ---*/ - -#pragma once - -#include "xdrchflt.h" -#include "wmbase.h" -#include "gdip.h" - -class CWatermarkFilter : public CXDXpsFilter -{ -public: - CWatermarkFilter(); - - virtual ~CWatermarkFilter(); - -private: - virtual HRESULT - ProcessPart( - _Inout_ IFixedPage* pFP - ); - - HRESULT - GetWatermark( - _In_ IXMLDOMDocument2* pPrintTicket, - _Outptr_result_maybenull_ CWatermark** ppWatermark - ); - -private: - GDIPlus m_gdiPlus; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmflt.rc b/print/XPSDrvSmpl/src/filters/watermark/wmflt.rc deleted file mode 100644 index 06f5485c..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmflt.rc +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) 2005 Microsoft Corporation -// -// All rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// File Name: -// -// wmflt.rc -// -// Abstract: -// -// Watermark filter resource file. -// -// - -#include -#include - -#include "wmres.h" - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample Watermark Filter" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Watermark Resources -// - -IDR_WM_PNG1 RCDATA "Raster1.png" - -IDR_WM_XPS1 RCDATA "Vector1.xps" - -#endif // English (U.S.) resources - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp deleted file mode 100644 index 5bb49548..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmfont.cpp +++ /dev/null @@ -1,413 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmfont.cpp - -Abstract: - - Watermark font implementation. The CWatermarkFont class is responsible - for managing the font resource for a text watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmfont.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::TextWatermark; - -/*++ - -Routine Name: - - CWatermarkFont::CWatermarkFont - -Routine Description: - - Constructor for the CWatermarkFont font management class which - sets the member variables to sensible defaults and ensures the - current watermark which uses this font is a text based watermark - -Arguments: - - wmProps - Object containing the PrintTicket settings - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkFont::CWatermarkFont( - _In_ CONST CWMPTProperties& wmProps - ) : - m_hDC(CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL)), - m_WMProps(wmProps), - m_hFont(NULL), - m_hOldFont(NULL), - m_bstrFaceName(L"Arial") -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_hDC != NULL, "NULL DC passed.\n"); - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType == TextWatermark) - { - hr = SetFont(); - } - else - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkFont::~CWatermarkFont - -Routine Description: - - Default destructor for the font management class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkFont::~CWatermarkFont() -{ - UnsetFont(); - - if (SUCCEEDED(CHECK_HANDLE(m_hDC, E_PENDING))) - { - DeleteDC(m_hDC); - } -} - -/*++ - -Routine Name: - - CWatermarkFont::WriteData - -Routine Description: - - Method for writing out the font to the container - -Arguments: - - pStream - Pointer to the stream to write the font out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - // - // Find the size of the font data - // - DWORD cbFontData = GetFontData(m_hDC, 0, 0, 0, 0); - - if (cbFontData != GDI_ERROR) - { - PBYTE pFontData = new(std::nothrow) BYTE[cbFontData]; - - if (SUCCEEDED(hr = CHECK_POINTER(pFontData, E_OUTOFMEMORY))) - { - // - // Retrieve the font data - // - if (GDI_ERROR != GetFontData(m_hDC, - 0, - 0, - reinterpret_cast(pFontData), - cbFontData)) - { - // - // SetFontOptions(Font_Obfusticate) sets the appropriate content type - // The pipeline takes care of XORing the font data with the URI GUID - // - CComQIPtr pFont = pResource; - if (SUCCEEDED(hr = CHECK_POINTER(pFont, E_NOINTERFACE)) && - SUCCEEDED(hr = pFont->SetFontOptions(Font_Obfusticate))) - { - // - // Write font data to stream - // - ULONG cbWritten = 0; - hr = pStream->WriteBytes(reinterpret_cast(pFontData), - cbFontData, - &cbWritten); - - ASSERTMSG(cbFontData == cbWritten, "Failed to write all font data.\n"); - } - } - else - { - hr = GetLastErrorAsHResult(); - } - - delete[] pFontData; - pFontData = NULL; - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFont::SetFont - -Routine Description: - - Method to select a font into the device context - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::SetFont( - VOID - ) -{ - ASSERTMSG(m_hFont == NULL, "Non NULL font handle when setting new font. Possible resource leak.\n"); - ASSERTMSG(m_hOldFont == NULL, "Non NULL old font handle when setting new font. Possible resource leak.\n"); - - HRESULT hr = S_OK; - - INT fontSize; - - if (SUCCEEDED(hr = m_WMProps.GetFontSize(&fontSize))) - { - LOGFONTW logfont; - - logfont.lfHeight = -MulDiv(fontSize, GetDeviceCaps(m_hDC, LOGPIXELSY), 72); - logfont.lfWidth = 0; - logfont.lfEscapement = 0; - logfont.lfOrientation = 0; - logfont.lfWeight = FW_NORMAL; - logfont.lfItalic = FALSE; - logfont.lfUnderline = FALSE; - logfont.lfStrikeOut = FALSE; - logfont.lfCharSet = ANSI_CHARSET; - logfont.lfOutPrecision = OUT_TT_ONLY_PRECIS; - logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - logfont.lfQuality = CLEARTYPE_QUALITY; - logfont.lfPitchAndFamily = FF_DONTCARE; - - size_t cchSrc = 0; - if (SUCCEEDED(hr = StringCchLength(m_bstrFaceName, LF_FACESIZE, &cchSrc)) && - SUCCEEDED(hr = StringCchCopyN(logfont.lfFaceName, LF_FACESIZE, m_bstrFaceName, cchSrc))) - { - if (m_hFont != NULL) - { - UnsetFont(); - } - - m_hFont = CreateFontIndirect(&logfont); - - if (m_hFont != NULL) - { - m_hOldFont = SelectFont(m_hDC, m_hFont); - } - else - { - hr = GetLastErrorAsHResult(); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFont::UnsetFont - -Routine Description: - - Method de-select a font from the current device context - -Arguments: - - None - -Return Value: - - None - ---*/ -VOID -CWatermarkFont::UnsetFont( - VOID - ) -{ - ASSERTMSG(m_hFont != NULL, "Attempting to deselect invalid font.\n"); - ASSERTMSG(m_hOldFont != NULL, "Attempting to select invalid font.\n"); - - SelectFont(m_hDC, m_hOldFont); - if (m_hFont != NULL) - { - DeleteObject(m_hFont); - m_hFont = NULL; - } -} - -/*++ - -Routine Name: - - CWatermarkFont::GetKeyName - -Routine Description: - - Method to obtain a unique key for the stored font based on the resource name - -Arguments: - - pbstrKeyName - Pointer to the string to contain the generated key name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - // - // The name of the resource is a suitable key - // - if (SUCCEEDED(hr = m_bstrFaceName.CopyTo(pbstrKeyName)) && - !*pbstrKeyName) - { - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkFont::GetResURI - -Routine Description: - - Method to obtain the URI to the stored font - -Arguments: - - pbstrResURI - Pointer to the string to contain the font resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkFont::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - try - { - // - // Create an obfuscated font name using our font GUID - // - CStringXDW cstrURI(L"Resources/Fonts/78F47176-ADD7-0E49-AB3A-C59F137240AC.odttf"); - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmfont.h b/print/XPSDrvSmpl/src/filters/watermark/wmfont.h deleted file mode 100644 index a7990011..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmfont.h +++ /dev/null @@ -1,82 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmfont.h - -Abstract: - - Watermark font definition. The CWatermarkFont class is responsible - for managing the font resource for a text watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - -Known Issues: - - The watermark font does not yet use the Uniscript interface to retrieve glyph - indices. - ---*/ - -#pragma once - -#include "rescache.h" -#include "wmptprop.h" - -class CWatermarkFont : public IResWriter -{ -public: - CWatermarkFont( - _In_ CONST CWMPTProperties& wmProps - ); - - ~CWatermarkFont(); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - -private: - HRESULT - SetFont( - VOID - ); - - VOID - UnsetFont( - VOID - ); - -private: - HDC m_hDC; - - HFONT m_hFont; - - HFONT m_hOldFont; - - CComBSTR m_bstrFaceName; - - CWMPTProperties m_WMProps; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp deleted file mode 100644 index 38f78f4d..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmimg.cpp +++ /dev/null @@ -1,503 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmimg.cpp - -Abstract: - - Watermark image implementation. The CWatermarkImage class is responsible - for managing the image resource for a raster watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmimg.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::BitmapWatermark; - -/*++ - -Routine Name: - - CWatermarkImage::CWatermarkImage - -Routine Description: - - Constructor for the CWatermarkFont bitmap management class which - sets the member variables to sensible defaults and ensures the - current watermark which uses this bitmap is a bitmap based watermark - -Arguments: - - wmProps - Object containing the PrintTicket settings - resourceID - Resource ID for the watermark -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkImage::CWatermarkImage( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - m_WMProps(wmProps), - m_resourceID(resourceID), - m_pPNGData(NULL), - m_pPNGStream(NULL), - m_hPNGRes(NULL), - m_cbPNGData(0) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != BitmapWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkImage::~CWatermarkImage - -Routine Description: - - Default destructor for the font management class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkImage::~CWatermarkImage() -{ - if (m_hPNGRes != NULL) - { - FreeResource(m_hPNGRes); - m_hPNGRes = NULL; - } -} - -/*++ - -Routine Name: - - CWatermarkImage::GetImageDimensions - -Routine Description: - - Method to obtain the width and height for the watermark bitmap - -Arguments: - - pDimensions - Pointer to a structure which will hold the bitmap dimensions - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::GetImageDimensions( - _Out_ SizeF* pDimensions - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDimensions, E_POINTER)) && - SUCCEEDED(hr = CreatePNGStream())) - { - pDimensions->Width = 0; - pDimensions->Height = 0; - - Bitmap image(m_pPNGStream); - Status gdiPStat = image.GetLastStatus(); - - if (gdiPStat == Ok) - { - pDimensions->Width = (REAL)image.GetWidth(); - pDimensions->Height = (REAL)image.GetHeight(); - - REAL horzRes = image.GetHorizontalResolution(); - REAL vertRes = image.GetVerticalResolution(); - - if (horzRes > 0 && - vertRes > 0) - { - pDimensions->Width *= 96.0f / horzRes; - pDimensions->Height *= 96.0f / vertRes; - } - } - else - { - hr = GetGDIStatusErrorAsHResult(gdiPStat); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::WriteData - -Routine Description: - - Method for writing out the bitmap to the container - -Arguments: - - pStream - Pointer to the stream to write the bitmap out to - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pResource, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pStream, E_POINTER))) - { - if (SUCCEEDED(hr = LoadPNGResource())) - { - ULONG cbWritten = 0; - - hr = pStream->WriteBytes(m_pPNGData, m_cbPNGData, &cbWritten); - - ASSERTMSG(m_cbPNGData == cbWritten, "Failed to write all data.\n"); - - // - // Set the content type of the image part - // - CComQIPtr pImage = pResource; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pImage, E_NOINTERFACE))) - { - hr = pImage->SetImageContent(CComBSTR(L"image/png")); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::GetKeyName - -Routine Description: - - Method to obtain a unique key for the stored bitmap based on the resource name - -Arguments: - - pbstrKeyName - Pointer to the string to contain the generated key name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrKeyName, E_POINTER))) - { - try - { - // - // The id of the resource is a suitable key - // - - CStringXDW cstrKeyName; - cstrKeyName.Format(L"%d", m_resourceID); - - *pbstrKeyName = cstrKeyName.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::GetResURI - -Routine Description: - - Method to obtain the URI to the stored bitmap - -Arguments: - - pbstrResURI - Pointer to the string to contain the bitmap resource URI - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::GetResURI( - _Outptr_ BSTR* pbstrResURI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrResURI, E_POINTER))) - { - *pbstrResURI = NULL; - - try - { - // - // Create a unique name for the watermark bitmap for this print session - // - CStringXDW cstrURI; - cstrURI.Format(L"/WM_%d_%u.png", m_resourceID, GetUniqueNumber()); - - *pbstrResURI = cstrURI.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::CheckResID - -Routine Description: - - Method to check that the bitmap resource exists - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::CheckResID( - VOID - ) -{ - HRESULT hr = S_OK; - - HRSRC hrSrc = FindResourceEx(g_hInstance, - RT_RCDATA, - MAKEINTRESOURCE(m_resourceID), - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); - - if (hrSrc == NULL) - { - hr = GetLastErrorAsHResult(); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::CreatePNGStream - -Routine Description: - - Method to write out the PNG bitmap to the container - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::CreatePNGStream( - VOID - ) -{ - HRESULT hr = S_OK; - - // - // If a stream hasn't already been created, load the PNG image resource - // and create a new stream - // - if (m_pPNGStream == NULL && - SUCCEEDED(hr = LoadPNGResource()) && - SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &m_pPNGStream))) - { - ULONG cbWritten = 0; - - // - // Write the data to the stream - // - hr = m_pPNGStream->Write(m_pPNGData, m_cbPNGData, &cbWritten); - } - - // - // Make sure the stream is pointing back at the start of the data - // - if (SUCCEEDED(hr)) - { - LARGE_INTEGER cbMoveFromStart = {0}; - - hr = m_pPNGStream->Seek(cbMoveFromStart, STREAM_SEEK_SET, NULL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkImage::LoadPNGResource - -Routine Description: - - Method to load the PNG bitmap resource - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkImage::LoadPNGResource( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_pPNGData == NULL) - { - HRSRC hrSrc = FindResourceEx(g_hInstance, - RT_RCDATA, - MAKEINTRESOURCE(m_resourceID), - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); - if (hrSrc != NULL) - { - // - // Load the resource - // - m_hPNGRes = LoadResource(g_hInstance, hrSrc); - - if (m_hPNGRes != NULL) - { - // - // Retrieve the PNG data and the size of the data - // - m_pPNGData = LockResource(m_hPNGRes); - m_cbPNGData = SizeofResource(g_hInstance, hrSrc); - - if (m_pPNGData == NULL || - m_cbPNGData <= 0) - { - hr = E_FAIL; - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmimg.h b/print/XPSDrvSmpl/src/filters/watermark/wmimg.h deleted file mode 100644 index f7ab0e8c..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmimg.h +++ /dev/null @@ -1,90 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmimg.h - -Abstract: - - Watermark image definition. The CWatermarkImage class is responsible - for managing the image resource for a raster watermark. This implements - the IResWriter interface so that the font can be added to the resource - cache. - ---*/ - -#pragma once - -#include "rescache.h" -#include "wmptprop.h" - -class CWatermarkImage : public IResWriter -{ -public: - CWatermarkImage( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - ~CWatermarkImage(); - - HRESULT - GetImageDimensions( - _Out_ SizeF* pDimensions - ); - - HRESULT - WriteData( - _In_ IPartBase* pResource, - _In_ IPrintWriteStream* pStream - ); - - HRESULT - GetKeyName( - _Outptr_ BSTR* pbstrKeyName - ); - - HRESULT - GetResURI( - _Outptr_ BSTR* pbstrResURI - ); - - HRESULT - CheckResID( - VOID - ); - -private: - HRESULT - CreatePNGStream( - VOID - ); - - HRESULT - LoadPNGResource( - VOID - ); - -private: - CWMPTProperties m_WMProps; - - INT m_resourceID; - - CComPtr m_pPNGStream; - - PVOID m_pPNGData; - - DWORD m_cbPNGData; - - HGLOBAL m_hPNGRes; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmptprop.cpp deleted file mode 100644 index c8b102a1..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.cpp +++ /dev/null @@ -1,683 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmptprop.cpp - -Abstract: - - Watermark properties class implementation. The Watermark properties class - is responsible for holding and controling Watermark properties. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmptprop.h" - -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::NoWatermark; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; - -/*++ - -Routine Name: - - CWMPTProperties::CWMPTProperties - -Routine Description: - - Constructor for the CWMPTProperties PrintTicket properties class - -Arguments: - - wmData - Structure containing watermark properties read from the PrintTicket - -Return Value: - - None - ---*/ -CWMPTProperties::CWMPTProperties( - _In_ CONST WatermarkData& wmData - ) : - m_wmData(wmData) -{ -} - -/*++ - -Routine Name: - - CWMPTProperties::~CWMPTProperties - -Routine Description: - - Default destructor for the CWMPTProperties class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMPTProperties::~CWMPTProperties() -{ -} - -/*++ - -Routine Name: - - CWMPTProperties::GetType - -Routine Description: - - Method to obtain the watermark type to identify as vector, text or bitmap - -Arguments: - - pType - Enumerated type to indicate the watermark type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetType( - _Out_ EWatermarkOption* pType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pType, E_POINTER))) - { - *pType = m_wmData.type; - - // - // If we are a bitmap or vector watermark and the extents are zero, report no watermark - // - if (m_wmData.type == BitmapWatermark || - m_wmData.type == VectorWatermark) - { - if (m_wmData.widthExtent == 0 || - m_wmData.heightExtent == 0) - { - *pType = NoWatermark; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetLayering - -Routine Description: - - Method to obtain the watermark layering type - -Arguments: - - pLayering - Enumerated type to indicate the watermark layering type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetLayering( - _Out_ ELayeringOption* pLayering - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pLayering, E_POINTER))) - { - *pLayering = m_wmData.layering; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetBounds - -Routine Description: - - Method to obtain the watermark bounding area - -Arguments: - - pBounds - Variable which is set to the watermark bounding area - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetBounds( - _Out_ RectF* pBounds - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pBounds, E_POINTER))) - { - // - // Convert from microns to 96ths of an inch - // - pBounds->X = static_cast(m_wmData.widthOrigin)/k96thInchAsMicrons; - pBounds->Y = static_cast(m_wmData.heightOrigin)/k96thInchAsMicrons; - pBounds->Width = static_cast(m_wmData.widthExtent)/k96thInchAsMicrons; - pBounds->Height = static_cast(m_wmData.heightExtent)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetOrigin - -Routine Description: - - Method to obtain the watermark origin - -Arguments: - - pOrigin - Variable which is set to the watermark origin - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetOrigin( - _Out_ PointF* pOrigin - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOrigin, E_POINTER))) - { - // - // Convert from microns to 96ths of an inch - // - pOrigin->X = static_cast(m_wmData.widthOrigin)/k96thInchAsMicrons; - pOrigin->Y = static_cast(m_wmData.heightOrigin)/k96thInchAsMicrons; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetAngle - -Routine Description: - - Method to obtain the watermark angle - -Arguments: - - pAngle - Variable which is set to the watermark angle - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetAngle( - _Out_ REAL* pAngle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pAngle, E_POINTER))) - { - *pAngle = static_cast(m_wmData.angle); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetTransparency - -Routine Description: - - Method to obtain the watermark transparency value - -Arguments: - - pTransparency - Variable which is set to the watermark transparency value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetTransparency( - _Out_ INT* pTransparency - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pTransparency, E_POINTER))) - { - *pTransparency = m_wmData.transparency; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetOpacity - -Routine Description: - - Method to obtain the watermark opacity value - -Arguments: - - pOpacity - Variable which is set to the watermark opacity value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetOpacity( - _Out_ REAL* pOpacity - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOpacity, E_POINTER))) - { - *pOpacity = 1.0f - (m_wmData.transparency / 100.0f); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetTransparency - -Routine Description: - - Method to obtain the watermark transparency value as a string - -Arguments: - - pbstrTransparency - String which is set to contain the watermark transparency value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetTransparency( - _Outptr_ BSTR* pbstrTransparency - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrTransparency, E_POINTER))) - { - *pbstrTransparency = NULL; - INT transparency = 0; - if (SUCCEEDED(hr = GetTransparency(&transparency))) - { - try - { - CStringXDW szTransparency; - szTransparency.Format(L"%i", transparency); - - *pbstrTransparency = szTransparency.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetOpacity - -Routine Description: - - Method to obtain the watermark opacity value as a string - -Arguments: - - pbstrOpacity - String which is set to contain the watermark opacity value - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetOpacity( - _Outptr_ BSTR* pbstrOpacity - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrOpacity, E_POINTER))) - { - *pbstrOpacity = NULL; - REAL opacity = 0; - if (SUCCEEDED(hr = GetOpacity(&opacity))) - { - try - { - CStringXDW szOpacity; - szOpacity.Format(L"%.2f", opacity); - - *pbstrOpacity = szOpacity.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetFontColor - -Routine Description: - - Method to obtain the watermark font color as a string - -Arguments: - - pbstrColor - String which is set to contain the watermark font color. Any BSTR - this points to will be freed. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetFontColor( - _Inout_ _At_(*pbstrColor, _Pre_maybenull_ _Post_valid_) BSTR* pbstrColor - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrColor, E_POINTER))) - { - SysFreeString(*pbstrColor); - *pbstrColor = NULL; - if (m_wmData.type == TextWatermark) - { - if (SUCCEEDED(hr = m_wmData.txtData.bstrFontColor.CopyTo(pbstrColor)) && - !*pbstrColor) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetText - -Routine Description: - - Method to obtain the watermark text as a string - -Arguments: - - pbstrText - String which is set to contain the watermark text - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetText( - _Inout_ _At_(*pbstrText, _Pre_maybenull_ _Post_valid_) BSTR* pbstrText - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrText, E_POINTER))) - { - SysFreeString(*pbstrText); - *pbstrText = NULL; - if (m_wmData.type == TextWatermark) - { - if (SUCCEEDED(hr = m_wmData.txtData.bstrText.CopyTo(pbstrText)) && - !*pbstrText) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetFontSize - -Routine Description: - - Method to obtain the watermark font size - -Arguments: - - pSize - Variable which is set to contain the watermark font size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetFontSize( - _Out_ INT* pSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pSize, E_POINTER))) - { - if (m_wmData.type == TextWatermark) - { - *pSize = m_wmData.txtData.fontSize; - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMPTProperties::GetFontEmSize - -Routine Description: - - Method to obtain the watermark font EM size as a string - -Arguments: - - pbstrSize - String which is set to contain the watermark EM font size - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWMPTProperties::GetFontEmSize( - _Outptr_ BSTR* pbstrSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrSize, E_POINTER))) - { - *pbstrSize = NULL; - - if (m_wmData.type != TextWatermark) - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - if (SUCCEEDED(hr)) - { - INT size = 0; - - if (SUCCEEDED(hr = GetFontSize(&size))) - { - // - // Convert from 72nds to 96ths of an inch - // - size = MulDiv(size, 96, 72); - - try - { - CStringXDW szFontSize; - szFontSize.Format(L"%d", size); - - *pbstrSize = szFontSize.AllocSysString(); - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.h b/print/XPSDrvSmpl/src/filters/watermark/wmptprop.h deleted file mode 100644 index eec7fed4..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmptprop.h +++ /dev/null @@ -1,103 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmptprop.h - -Abstract: - - Watermark properties class definition. The Watermark properties class - is responsible for holding and controling Watermark properties. - ---*/ - -#pragma once - -#include "wmdata.h" - -class CWMPTProperties -{ -public: - CWMPTProperties( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData& wmData - ); - - virtual ~CWMPTProperties(); - - HRESULT - GetType( - _Out_ XDPrintSchema::PageWatermark::EWatermarkOption* pType - ); - - HRESULT - GetLayering( - _Out_ XDPrintSchema::PageWatermark::Layering::ELayeringOption* pLayering - ); - - HRESULT - GetBounds( - _Out_ RectF* pBounds - ); - - HRESULT GetOrigin( - _Out_ PointF* pOrigin - ); - - HRESULT - GetAngle( - _Out_ REAL* pAngle - ); - - HRESULT - GetTransparency( - _Out_ INT* pTransparency - ); - - HRESULT - GetOpacity( - _Out_ REAL* pOpacity - ); - - HRESULT - GetTransparency( - _Outptr_ BSTR* pbstrTransparency - ); - - HRESULT - GetOpacity( - _Outptr_ BSTR* pbstrOpacity - ); - - HRESULT - GetFontColor( - _Inout_ _At_(*pbstrColor, _Pre_maybenull_ _Post_valid_) BSTR* pbstrColor - ); - - HRESULT - GetText( - _Inout_ _At_(*pbstrText, _Pre_maybenull_ _Post_valid_) BSTR* pbstrText - ); - - HRESULT - GetFontSize( - _Out_ INT* pSize - ); - - HRESULT - GetFontEmSize( - _Outptr_ BSTR* pbstrSize - ); - -protected: - XDPrintSchema::PageWatermark::WatermarkData m_wmData; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp deleted file mode 100644 index d83a0783..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmrast.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmrast.cpp - -Abstract: - - RasterGraphic watermark class implamentation. CRasterWatermark is the - raster implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmrast.h" -#include "wmptprop.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::BitmapWatermark; - -/*++ - -Routine Name: - - CRasterWatermark::CRasterWatermark - -Routine Description: - - Constructor for the raster watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - resourceID - Resource ID for the watermark - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CRasterWatermark::CRasterWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - CWatermark(wmProps), - m_wmBMP(wmProps, resourceID) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != BitmapWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CRasterWatermark::~CRasterWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CRasterWatermark::~CRasterWatermark() -{ -} - -/*++ - -Routine Name: - - CRasterWatermark::CreateXMLElement - -Routine Description: - - Method to create the XML markup which describes the transform and properties used - to present the watermark correctly on the page - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRasterWatermark::CreateXMLElement( - VOID - ) -{ - ASSERTMSG(m_pDOMDoc != NULL, "NULL DOM document detected whilst creating text watermark\n"); - ASSERTMSG(m_bstrImageURI.Length() > 0, "Invalid image URI detected whilst creating text watermark\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDOMDoc, E_PENDING))) - { - if (m_bstrImageURI.Length() == 0) - { - hr = E_PENDING; - } - } - - // - // We need to retrieve the bitmap bounds to calculate - // the correct render transform for the watermark - // - SizeF bmpDims; - CComBSTR bstrWMOpacity; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_wmBMP.GetImageDimensions(&bmpDims)) && - SUCCEEDED(hr = m_WMProps.GetOpacity(&bstrWMOpacity))) - { - // - // The markup will look like this (square bracketed values "[]" - // describes content): - // - // - // - // - // - // - // - CComPtr pPathFill(NULL); - CComPtr pImageBrush(NULL); - CComPtr pInsertNode(NULL); - - CStringXDW strPathData; - CStringXDW strViewbox; - CStringXDW strViewport; - - CComBSTR bstrMatrixXForm; - - // - // Create the transform and elements and add attributes - // - try - { - strPathData.Format(L"M 0,0 L 0,%.2f %.2f,%.2f %.2f,0 z", bmpDims.Height, bmpDims.Width, bmpDims.Height, bmpDims.Width); - strViewbox.Format(L"0,0,%.2f,%.2f", bmpDims.Width, bmpDims.Height); - strViewport.Format(L"0,0,%.2f,%.2f", bmpDims.Width, bmpDims.Height); - - if (SUCCEEDED(hr = CreateWMTransform(RectF(0, 0, bmpDims.Width, bmpDims.Height), &bstrMatrixXForm)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"Path"), &m_pWMElem)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"Path.Fill"), &pPathFill)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"ImageBrush"), &pImageBrush)) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"RenderTransform"), CComVariant(bstrMatrixXForm))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"Data"), CComVariant(strPathData.GetBuffer()))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"ImageSource"), CComVariant(m_bstrImageURI))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"Opacity"), CComVariant(bstrWMOpacity))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"ViewboxUnits"), CComVariant(L"Absolute"))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"Viewbox"), CComVariant(strViewbox.GetBuffer()))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"ViewportUnits"), CComVariant(L"Absolute"))) && - SUCCEEDED(hr = pImageBrush->setAttribute(CComBSTR(L"Viewport"), CComVariant(strViewport.GetBuffer()))) && - SUCCEEDED(hr = pPathFill->appendChild(pImageBrush, &pInsertNode)) && - SUCCEEDED(hr = m_pWMElem->appendChild(pPathFill, &pInsertNode))) - { - hr = m_pWMElem->appendChild(pPathFill, &pInsertNode); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRasterWatermark::AddParts - -Routine Description: - - Method to add the watermark bitmap resource to the cache - -Arguments: - - pXpsConsumer - Pointer to the writer used when writing the resource back out to the pipeline - pFixedPage - Pointer to the fixed page associated with the bitmap - pResCache - Pointer to a resource cache object which manages the writing of the bitmap - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRasterWatermark::AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsConsumer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResCache, E_POINTER))) - { - // - // Write the font resource to the cache - // - m_bstrImageURI.Empty(); - CComBSTR bstrKey; - if (SUCCEEDED(hr = m_wmBMP.CheckResID()) && - SUCCEEDED(hr = pResCache->WriteResource(pXpsConsumer, pFixedPage, &m_wmBMP)) && - SUCCEEDED(hr = m_wmBMP.GetKeyName(&bstrKey))) - { - hr = pResCache->GetURI(bstrKey, &m_bstrImageURI); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmrast.h b/print/XPSDrvSmpl/src/filters/watermark/wmrast.h deleted file mode 100644 index 22e17b85..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmrast.h +++ /dev/null @@ -1,58 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmrast.h - -Abstract: - - RasterGraphic watermark class definition. CRasterWatermark is the - raster implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#pragma once - -#include "wmbase.h" -#include "wmimg.h" -#include "wmptprop.h" - -class CRasterWatermark : public CWatermark -{ -public: - CRasterWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - virtual ~CRasterWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ); - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ); - -private: - CComBSTR m_bstrImageURI; - - CWatermarkImage m_wmBMP; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmres.h b/print/XPSDrvSmpl/src/filters/watermark/wmres.h deleted file mode 100644 index 0df8f4d4..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmres.h +++ /dev/null @@ -1,27 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmres.h - -Abstract: - - Warmark specific resource defines. - ---*/ - -#pragma once - -#define IDR_WM_PNG1 101 - -#define IDR_WM_XPS1 201 - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp deleted file mode 100644 index be165d53..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmsax.cpp +++ /dev/null @@ -1,427 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmsax.cpp - -Abstract: - - Watermark sax handler implementation. The watermark SAX handler is - responsible for parsing the FixedPage mark-up for the page size and - adding the inserting the watermark mark-up in appropriate place. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmsax.h" - -/*++ - -Routine Name: - - CWMSaxHandler::CWMSaxHandler - -Routine Description: - - Contructor for the watermark filters SAX handler. - The constructor registers a writer for streaming out any markup and a watermark - handler object for generating any new watermark markup and handling related resources - -Arguments: - - pWriter - Pointer to a write stream which receives markup - pWatermark - Pointer to a watermark handler object - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWMSaxHandler::CWMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CWatermark* pWatermark - ) : - m_pWriter(pWriter), - m_watermark(pWatermark), - m_bOpenTag(FALSE) -{ - ASSERTMSG(m_pWriter != NULL, "NULL writer passed to watermark SAX handler.\n"); - ASSERTMSG(m_watermark != NULL, "NULL watermark passed to watermark SAX handler.\n"); - - HRESULT hr = S_OK; - if (FAILED(hr = CHECK_POINTER(m_pWriter, E_POINTER)) || - FAILED(hr = CHECK_POINTER(m_watermark, E_POINTER))) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWMSaxHandler::~CWMSaxHandler - -Routine Description: - - Default destructor for the watermark filter SAX handler - -Arguments: - - None - -Return Value: - - None - ---*/ -CWMSaxHandler::~CWMSaxHandler() -{ -} - -/*++ - -Routine Name: - - CWMSaxHandler::startElement - -Routine Description: - - SAX handler method which handles each start element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - pAttributes - Pointer to the attribute list for the supplied element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CWMSaxHandler::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrOut; - - try - { - // - // Check if we need to close an opened tag - // - if (m_bOpenTag) - { - cstrOut.Append(L">"); - } - - // - // Store the opened element name so we can handle nested elements - // - m_bstrOpenElement = CComBSTR(cchQName, pwchQName); - - // - // Write out element - // - cstrOut.Append(L"<"); - cstrOut.Append(m_bstrOpenElement); - } - catch (CXDException& e) - { - hr = e; - } - - // - // We opened a tag - // - m_bOpenTag = TRUE; - - // - // If this is the fixed page we need the width and height retreived - // - BOOL bIsFixedPage = (m_bstrOpenElement == L"FixedPage"); - - // - // Find the number of attributes and enumerate over all of them - // - INT cAttributes = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = pAttributes->getLength(&cAttributes))) - { - for (INT cIndex = 0; cIndex < cAttributes; cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, - &pszAttUri, - &cchAttUri, - &pszAttName, - &cchAttName, - &pszAttQName, - &cchAttQName))) - { - if (SUCCEEDED(pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - try - { - CComBSTR bstrAttName(cchAttQName, pszAttQName); - CComBSTR bstrAttValue(cchAttValue, pszAttValue); - - // - // Delimit attributes with a space - // - cstrOut.Append(L" "); - - // - // Reconstruct the attribute and write back to - // the fixed page - // - cstrOut.Append(bstrAttName); - cstrOut.Append(L"=\""); - - // - // If this is a UnicodeString we may need to escape entities - // - if (bstrAttName == L"UnicodeString") - { - hr = EscapeEntity(&bstrAttValue); - } - - cstrOut.Append(bstrAttValue); - cstrOut.Append(L"\""); - } - catch (CXDException& e) - { - hr = e; - } - } - } - } - } - - // - // We output the mark-up here for underlaid watermarks - // - if (SUCCEEDED(hr) && - bIsFixedPage) - { - // - // If this is the fixed page element make sure we close it in case the - // page has no content. - // - try - { - cstrOut.Append(L">"); - m_bOpenTag = FALSE; - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(m_watermark, E_PENDING))) - { - - // - // Create the watermark markup - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_watermark->CreateXMLElement())) - { - // - // Check if the mark-up needs to inserted at the start of the - // fixed page (underlay) - // - if (m_watermark->InsertStart()) - { - CComBSTR bstrWMText; - if (SUCCEEDED(hr = m_watermark->GetXML(&bstrWMText))) - { - // - // Insert the watermark mark-up - // - cstrOut.Append(bstrWMText); - } - } - } - } - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWMSaxHandler::endElement - -Routine Description: - - SAX handler method which handles each end element for the XML markup - -Arguments: - - pwchQName - Pointer to a string containing the element name - cchQName - Count of the number of characters in the element name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CWMSaxHandler::endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ) -{ - HRESULT hr = S_OK; - CStringXDW cstrClose; - - try - { - CComBSTR bstrElement(cchQName, pwchQName); - - if (bstrElement == L"FixedPage") - { - if (SUCCEEDED(hr = CHECK_POINTER(m_watermark, E_PENDING)) && - m_watermark->InsertEnd()) - { - CComBSTR bstrWMText; - if (SUCCEEDED(hr = m_watermark->GetXML(&bstrWMText))) - { - cstrClose.Append(bstrWMText); - } - } - } - - // - // If this element matches the current open element, use shorthand to close - // the tag - // - if (bstrElement == m_bstrOpenElement && - m_bOpenTag) - { - cstrClose.Append(L"/>"); - } - else - { - // - // Close the element - // - cstrClose.Append(L""); - } - } - catch (CXDException& e) - { - hr = e; - } - - if (SUCCEEDED(hr)) - { - hr = WriteToPrintStream(&cstrClose, m_pWriter); - } - - m_bOpenTag = FALSE; - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CWMSaxHandler::startDocument - -Routine Description: - - SAX handler method which handles the start document call to ensure - the xml version is correctly set - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CWMSaxHandler::startDocument( - void - ) -{ - HRESULT hr = S_OK; - - try - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pWriter, E_FAIL))) - { - CStringXDW cstrOut(L""); - hr = WriteToPrintStream(&cstrOut, m_pWriter); - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmsax.h b/print/XPSDrvSmpl/src/filters/watermark/wmsax.h deleted file mode 100644 index cd76ca9e..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmsax.h +++ /dev/null @@ -1,74 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmsax.h - -Abstract: - - Watermark sax handler definition. The watermark SAX handler is responsible for - parsing the FixedPage mark-up for the page size and inserting the watermark mark-up - in appropriate place. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "wmtext.h" - -class CWMSaxHandler : public CSaxHandler -{ -public: - CWMSaxHandler( - _In_ IPrintWriteStream* pWriter, - _In_ CWatermark* pWatermark - ); - - virtual ~CWMSaxHandler(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - virtual HRESULT STDMETHODCALLTYPE - endElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName - ); - - HRESULT STDMETHODCALLTYPE - startDocument( - void - ); - -private: - CComPtr m_pWriter; - - CComBSTR m_bstrOpenElement; - - BOOL m_bOpenTag; - - CWatermark* m_watermark; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp deleted file mode 100644 index a249648d..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmtext.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmtext.cpp - -Abstract: - - Text watermark class implamentation. CTextWatermark is the - text implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "wmtext.h" -#include "wmptprop.h" -#include "rescache.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::TextWatermark; - -/*++ - -Routine Name: - - CTextWatermark::CTextWatermark - -Routine Description: - - Constructor for the text watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CTextWatermark::CTextWatermark( - _In_ CONST CWMPTProperties& wmProps - ) : - CWatermark(wmProps), - m_wmFont(wmProps) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != TextWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CTextWatermark::~CTextWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CTextWatermark::~CTextWatermark() -{ -} - -/*++ - -Routine Name: - - CTextWatermark::CreateXMLElement - -Routine Description: - - Method to create the XML markup which describes the transform and properties used - to present the watermark correctly on the page - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTextWatermark::CreateXMLElement( - VOID - ) -{ - ASSERTMSG(m_pDOMDoc != NULL, "NULL DOM document detected whilst creating text watermark\n"); - ASSERTMSG(m_bstrFontURI.Length() > 0, "Invalid font URI detected whilst creating text watermark\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDOMDoc, E_PENDING))) - { - if (m_bstrFontURI.Length() == 0) - { - hr = E_PENDING; - } - } - - PointF stringOrigin; - - CComBSTR bstrWMText; - CComBSTR bstrWMOpacity; - CComBSTR bstrWMFontSize; - CComBSTR bstrWMFontColor; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_WMProps.GetText(&bstrWMText)) && - SUCCEEDED(hr = m_WMProps.GetFontColor(&bstrWMFontColor)) && - SUCCEEDED(hr = m_WMProps.GetFontEmSize(&bstrWMFontSize)) && - SUCCEEDED(hr = m_WMProps.GetOpacity(&bstrWMOpacity)) && - SUCCEEDED(hr = m_WMProps.GetOrigin(&stringOrigin))) - { - // - // The markup will look like this (square bracketed values "[]" - // describes content): - // - // - // - CComBSTR bstrMatrixXForm; - - CComBSTR bstrFontName(L"/"); - hr = bstrFontName.Append(m_bstrFontURI); - - // - // Create the transform and element and add attributes - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CreateWMTransform(stringOrigin, &bstrMatrixXForm)) && - SUCCEEDED(hr = m_pDOMDoc->createElement(CComBSTR(L"Glyphs"), &m_pWMElem)) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"Fill"), CComVariant(bstrWMFontColor))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"Opacity"), CComVariant(bstrWMOpacity))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"RenderTransform"), CComVariant(bstrMatrixXForm))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"FontUri"), CComVariant(bstrFontName))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"FontRenderingEmSize"), CComVariant(bstrWMFontSize))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"OriginX"), CComVariant(L"0"))) && - SUCCEEDED(hr = m_pWMElem->setAttribute(CComBSTR(L"OriginY"), CComVariant(L"0")))) - { - hr = m_pWMElem->setAttribute(CComBSTR(L"UnicodeString"), CComVariant(bstrWMText)); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CTextWatermark::AddParts - -Routine Description: - - Method to add the watermark font resource to the cache - -Arguments: - - pXpsConsumer - Pointer to the writer used when writing the resource back out to the pipeline - pFixedPage - Pointer to the fixed page associated with the font - pResCache - Pointer to a resource cache object which manages the writing of the font - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CTextWatermark::AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsConsumer, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPage, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pResCache, E_POINTER))) - { - // - // Write the font resource to the cache - // - m_bstrFontURI.Empty(); - CComBSTR bstrKey; - if (SUCCEEDED(hr = pResCache->WriteResource(pXpsConsumer, pFixedPage, &m_wmFont)) && - SUCCEEDED(hr = m_wmFont.GetKeyName(&bstrKey))) - { - hr = pResCache->GetURI(bstrKey, &m_bstrFontURI); - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmtext.h b/print/XPSDrvSmpl/src/filters/watermark/wmtext.h deleted file mode 100644 index ff439fdc..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmtext.h +++ /dev/null @@ -1,57 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmtext.h - -Abstract: - - Text watermark class definition. CTextWatermark is the - text implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - resource cache. - ---*/ - -#pragma once - -#include "wmbase.h" -#include "wmfont.h" -#include "rescache.h" - -class CTextWatermark : public CWatermark -{ -public: - CTextWatermark( - _In_ CONST CWMPTProperties& wmProps - ); - - virtual ~CTextWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ); - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ); - -private: - CComBSTR m_bstrFontURI; - - CWatermarkFont m_wmFont; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp deleted file mode 100644 index 3c73b2ba..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmvect.cpp - -Abstract: - - VectorGraphic watermark class implamentation. CVectorWatermark is the - vecotr implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to the - markup. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmvect.h" -#include "wmptprop.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::VectorWatermark; - -/*++ - -Routine Name: - - CVectorWatermark::CVectorWatermark - -Routine Description: - - Constructor for the vector watermark class - -Arguments: - - wmProps - Watermark PrintTicket properties class - resourceID - Resource ID for the watermark - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CVectorWatermark::CVectorWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - CWatermark(wmProps), - m_wmMarkup(wmProps, resourceID) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != VectorWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CVectorWatermark::~CVectorWatermark - -Routine Description: - - Default destructor for the watermarks base class - -Arguments: - - None - -Return Value: - - None - ---*/ -CVectorWatermark::~CVectorWatermark() -{ -} - -/*++ - -Routine Name: - - CVectorWatermark::CreateXMLElement - -Routine Description: - - Method to create the XML markup which describes the transform and properties used - to present the watermark correctly on the page - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CVectorWatermark::CreateXMLElement( - VOID - ) -{ - ASSERTMSG(m_pDOMDoc != NULL, "NULL DOM document detected whilst creating text watermark\n"); - - HRESULT hr = S_OK; - - // - // We need to retrieve the RAW Markup bounds to calculate - // the correct render transform for the watermark - // - SizeF markupDims; - CComBSTR bstrWMOpacity; - if (SUCCEEDED(hr = CHECK_POINTER(m_pDOMDoc, E_PENDING)) && - SUCCEEDED(hr = m_wmMarkup.GetImageDimensions(&markupDims)) && - SUCCEEDED(hr = m_WMProps.GetOpacity(&bstrWMOpacity))) - { - // - // The markup will look like this (square bracketed values "[]" - // describes content): - // - // - // - CComBSTR bstrMatrixXForm; - - if (SUCCEEDED(hr = CreateWMTransform(RectF(0, 0, markupDims.Width, markupDims.Height), &bstrMatrixXForm))) - { - try - { - CStringXDW strOpenCanvas; - strOpenCanvas.Format(L"", - static_cast(bstrWMOpacity), static_cast(bstrMatrixXForm)); - - IStream* pStream; - CComBSTR bstrContent; - - if (SUCCEEDED(hr = m_wmMarkup.GetStream(&pStream)) && - SUCCEEDED(hr = bstrContent.ReadFromStream(pStream))) - { - m_bstrMarkup.Empty(); - - if (SUCCEEDED(hr = m_bstrMarkup.Append(strOpenCanvas)) && - SUCCEEDED(hr = m_bstrMarkup.Append(bstrContent))) - { - hr = m_bstrMarkup.Append(L"\n"); - } - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CVectorWatermark::GetXML - -Routine Description: - - Method for copying the XML markup which describes the watermark text - -Arguments: - - pbstrXML - Pointer to the string to contain the XML vector markup. Any BSTR - this points to will be freed. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CVectorWatermark::GetXML( - _Inout_ _At_(*pbstrXML, _Pre_maybenull_ _Post_valid_) BSTR* pbstrXML - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrXML, E_POINTER))) - { - SysFreeString(*pbstrXML); - - if (m_bstrMarkup.Length() > 0) - { - if (SUCCEEDED(hr = m_bstrMarkup.CopyTo(pbstrXML)) && - !*pbstrXML) - { - hr = E_OUTOFMEMORY; - } - } - else - { - hr = E_PENDING; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CVectorWatermark::AddParts - -Routine Description: - - Method to add any required resource to the cache. - This isn't required for vector based watermarks. - -Arguments: - - pXpsConsumer - Pointer to the writer used when writing the resource back out to the pipeline - pFixedPage - Pointer to the fixed page associated with the resource - pResCache - Pointer to a resource cache object which manages the writing of the resource - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CVectorWatermark::AddParts( - _In_ IXpsDocumentConsumer*, - _In_ IFixedPage*, - _In_ CFileResourceCache* - ) -{ - // - // No Implementation required. - // - - return S_OK; -} - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmvect.h b/print/XPSDrvSmpl/src/filters/watermark/wmvect.h deleted file mode 100644 index 54b9e01c..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmvect.h +++ /dev/null @@ -1,62 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmvect.h - -Abstract: - - VectorGraphic watermark class definition. CVectorWatermark is the - Vector implementation of the CWatermark class. This implements methods - for creating the page mark-up and adding the watermark resource to fixed page. - ---*/ - -#pragma once - -#include "wmbase.h" -#include "wmxps.h" -#include "wmptprop.h" - -class CVectorWatermark : public CWatermark -{ -public: - CVectorWatermark( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - virtual ~CVectorWatermark(); - - virtual HRESULT - CreateXMLElement( - VOID - ); - - virtual HRESULT - GetXML( - _Inout_ _At_(*pbstrXML, _Pre_maybenull_ _Post_valid_) BSTR* pbstrXML - ); - - virtual HRESULT - AddParts( - _In_ IXpsDocumentConsumer* pXpsConsumer, - _In_ IFixedPage* pFixedPage, - _In_ CFileResourceCache* pResCache - ); - -private: - CWatermarkMarkup m_wmMarkup; - - CComBSTR m_bstrMarkup; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp deleted file mode 100644 index 82d819e8..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmxps.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmxps.cpp - -Abstract: - - Watermark XPS markup class implementation. The CWatermarkMarkup class is responsible - for creating a stream that contains markup loaded from a resource. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "wmxps.h" - -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::VectorWatermark; - -/*++ - -Routine Name: - - CWatermarkMarkup::CWatermarkMarkup - -Routine Description: - - Constructor for the CWatermarkMarkup vector management class - which sets the member variables to sensible defaults and - ensures the current watermark is a vector based watermark - -Arguments: - - wmProps - Object containing the PrintTicket settings - resourceID - Resource ID for the watermark - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkMarkup::CWatermarkMarkup( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ) : - m_WMProps(wmProps), - m_resourceID(resourceID) -{ - HRESULT hr = S_OK; - - EWatermarkOption wmType; - - if (SUCCEEDED(hr = m_WMProps.GetType(&wmType))) - { - if (wmType != VectorWatermark) - { - hr = E_INVALIDARG; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkMarkup::~CWatermarkMarkup - -Routine Description: - - Default destructor for the font management class - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkMarkup::~CWatermarkMarkup() -{ -} - -/*++ - -Routine Name: - - CWatermarkMarkup::GetImageDimensions - -Routine Description: - - Method to obtain the width and height for the watermark vector image - -Arguments: - - pDimensions - Pointer to a structure which will hold the vector image dimensions - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkMarkup::GetImageDimensions( - _Out_ SizeF* pDimensions - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDimensions, E_POINTER))) - { - // - // Currently fixed to A4 dimensions - // - pDimensions->Width = 793.76f; - pDimensions->Height = 1122.56f; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkMarkup::CreateXPSStream - -Routine Description: - - Method for writing out the vector image to the container - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkMarkup::CreateXPSStream( - VOID - ) -{ - HRESULT hr = S_OK; - - if (m_pXPSStream == NULL) - { - HRSRC hrSrc = FindResourceEx(g_hInstance, - RT_RCDATA, - MAKEINTRESOURCE(m_resourceID), - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); - if (hrSrc != NULL) - { - // - // Load the resource - // - HGLOBAL hXPSRes = LoadResource(g_hInstance, hrSrc); - - if (hXPSRes != NULL) - { - if (SUCCEEDED(hr = CreateStreamOnHGlobal(NULL, TRUE, &m_pXPSStream))) - { - // - // Retrieve the XPS data and the size of the data - // - PVOID pXPSData = LockResource(hXPSRes); - DWORD cbXPSData = SizeofResource(g_hInstance, hrSrc); - - if (SUCCEEDED(hr = CHECK_POINTER(pXPSData, E_FAIL)) && - cbXPSData > 0) - { - ULONG cbTotalWritten = 0; - - // - // Write the size of the data to the stream. - // This is required as the stream will be read back using the CComBSTR ReadFromStream() method - // - DWORD cbXPSDataWithTerm = cbXPSData + sizeof(OLECHAR); - - if (SUCCEEDED(hr = m_pXPSStream->Write(&cbXPSDataWithTerm, sizeof(cbXPSDataWithTerm), &cbTotalWritten))) - { - // - // Write the data to the stream - // Note the XPS data content must be in Unicode format to be compatible with - // the CComBSTR ReadFromStream() method. - // - ULONG cbWritten = 0; - - if (SUCCEEDED(hr = m_pXPSStream->Write(pXPSData, cbXPSData, &cbWritten))) - { - cbTotalWritten += cbWritten; - - hr = m_pXPSStream->Write(OLESTR("\0"), sizeof(OLECHAR), &cbWritten); - cbTotalWritten += cbWritten; - } - } - } - } - - FreeResource(hXPSRes); - } - else - { - hr = GetLastErrorAsHResult(); - } - } - else - { - hr = GetLastErrorAsHResult(); - } - } - - // - // Make sure the stream is pointing back at the start of the data - // - if (SUCCEEDED(hr)) - { - LARGE_INTEGER cbMoveFromStart = {0}; - - hr = m_pXPSStream->Seek(cbMoveFromStart, - STREAM_SEEK_SET, - NULL); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkMarkup::GetStream - -Routine Description: - - Method for obtaining a stream to write the vector image out to - -Arguments: - - ppStream - Pointer to a pointer to the stream - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkMarkup::GetStream( - _Out_ IStream** ppStream - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppStream, E_POINTER)) && - SUCCEEDED(hr = CreateXPSStream())) - { - *ppStream = m_pXPSStream; - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmxps.h b/print/XPSDrvSmpl/src/filters/watermark/wmxps.h deleted file mode 100644 index 125edaac..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/wmxps.h +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmxps.h - -Abstract: - - Watermark XPS markup class definition. The CWatermarkMarkup class is responsible - for creating a stream that contains markup loaded from a resource. - ---*/ - -#pragma once - -#include "wmptprop.h" - -class CWatermarkMarkup -{ -public: - CWatermarkMarkup( - _In_ CONST CWMPTProperties& wmProps, - _In_ CONST INT resourceID - ); - - ~CWatermarkMarkup(); - - HRESULT - GetImageDimensions( - _Out_ SizeF* pDimensions - ); - - HRESULT - GetStream( - _Out_ IStream** ppStream - ); - -private: - HRESULT - CreateXPSStream( - VOID - ); - -private: - CWMPTProperties m_WMProps; - - INT m_resourceID; - - CComPtr m_pXPSStream; -}; - diff --git a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.def b/print/XPSDrvSmpl/src/filters/watermark/xdwmark.def deleted file mode 100644 index dee0a0d7..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.def +++ /dev/null @@ -1,26 +0,0 @@ -; -; Copyright (c) 2005 Microsoft Corporation -; -; All rights reserved. -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; File Name: -; -; xdwmark.def -; -; Abstract: -; -; Watermark filter module definition file -; - -LIBRARY XDWMark - -EXPORTS - DllMain - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - diff --git a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj b/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj deleted file mode 100644 index 65ba86ed..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj +++ /dev/null @@ -1,582 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {E31D1C4F-8E0D-428A-8583-5159CE690B33} - $(MSBuildProjectName) - false - true - Debug - Win32 - {026C20B0-65B4-4ECC-BD89-61D7F5EC7DE8} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - xdwmark - - - xdwmark - - - xdwmark - - - xdwmark - - - xdwmark - - - xdwmark - - - xdwmark - - - xdwmark - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - xdwmark.def - - - - - xdwmark.def - - - - - xdwmark.def - - - - - xdwmark.def - - - - - xdwmark.def - - - - - xdwmark.def - - - - - xdwmark.def - - - - - xdwmark.def - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj.Filters deleted file mode 100644 index 26028881..00000000 --- a/print/XPSDrvSmpl/src/filters/watermark/xdwmark.vcxproj.Filters +++ /dev/null @@ -1,233 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {D41A7413-BCDC-4F43-A05E-64E4DECEEB59} - - - h;hpp;hxx;hm;inl;inc;xsd - {D59E1E53-E90B-4BC1-87E3-0D94C8AB6D45} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {70B7C8CE-B4D3-4816-980B-2376D8B2B6F1} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Source Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp b/print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj b/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj deleted file mode 100644 index e7337bf9..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj +++ /dev/null @@ -1,473 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {D38B87BF-5778-4DA8-8DCE-B0F37F087D5A} - $(MSBuildProjectName) - false - true - Debug - Win32 - {08C4151B-A3CA-440F-9542-0B219834C1B3} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - StaticLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - xdcont - - - xdcont - - - xdcont - - - xdcont - - - xdcont - - - xdcont - - - xdcont - - - xdcont - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - %(AdditionalIncludeDirectories);..\;..\common;..\..\inc;..\..\common;..\..\debug;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);uuid.lib;WIAGUID.lib;msxml6.lib;Kernel32.lib;ole32.lib;oleaut32.lib;prntvpt.lib;winspool.lib;gdi32.lib;gdiplus.lib;shlwapi.lib;Advapi32.lib;user32.lib;.\..\..\debug\$(IntDir)\xdsdbg.lib;.\..\..\common\$(IntDir)\xdsmplcmn.lib;.\..\..\filters\common\$(IntDir)\xdfltcmn.lib - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - %(PreprocessorDefinitions);_UNICODE;UNICODE - - - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ..;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj.Filters b/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj.Filters deleted file mode 100644 index b1aba0bd..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xdcont.vcxproj.Filters +++ /dev/null @@ -1,163 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {B192E969-B943-4CD9-AFDD-E14B61AEFA09} - - - h;hpp;hxx;hm;inl;inc;xsd - {3E626190-7767-495A-A5B3-629C0AA184CA} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {E0D34E98-7FA3-45FC-AD1E-5A41EF88FAB1} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xps.h b/print/XPSDrvSmpl/src/filters/xdcont/xps.h deleted file mode 100644 index 0b2ae4b8..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xps.h +++ /dev/null @@ -1,83 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xps.h - -Abstract: - - Enumerations and definitions used by the stream filter. - ---*/ - -#pragma once - -#include "xdstring.h" -#include "ipkfile.h" - -enum ERelsType -{ - RelsAnnotations = 0, ERelsTypeMin = 0, - RelsDigitalSignatureDefinitions, - RelsDiscardControl, - RelsDocumentStructure, - RelsPrintTicket, - RelsRequiredResource, - RelsRestrictedFont, - RelsStartPart, - RelsStoryFragments, - RelsCoreProperties, - RelsDigitalSignature, - RelsDigitalSignatureCertificate, - RelsDigitalSignatureOrigin, - RelsThumbnail, - RelsUnknown, ERelsTypeMax = RelsUnknown -}; - -typedef std::pair RelsNameType; -typedef std::vector RelsTypeList; -typedef std::map RelsMap; - -enum EContentType -{ - ContentFixedDocumentSequence = 0, EContentTypeMin = 0, - ContentFixedDocument, - ContentFixedPage, - ContentDiscardControl, - ContentDocumentStructure, - ContentFont, - ContentICCProfile, - ContentObfuscatedFont, - ContentPrintTicket, - ContentRemoteResourceDictionary, - ContentStoryFragments, - ContentJPEGImage, - ContentPNGImage, - ContentTIFFImage, - ContentWindowsMediaPhotoImage, - ContentCoreProperties, - ContentDigitalSignatureCertificate, - ContentDigitalSignatureOrigin, - ContentDigitalSignatureXMLSignature, - ContentRelationships, - ContentUnknown, EContentTypeMax = ContentUnknown -}; - -typedef std::map ContentMap; - -typedef std::vector FileList; - -typedef std::map SentList; - -typedef std::pair RecordTracker; -typedef std::vector XPSPartStack; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp deleted file mode 100644 index 68800b31..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.cpp +++ /dev/null @@ -1,639 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsarch.cpp - -Abstract: - - Implementation of the XPS archive class. This class is responsible for providing - an interface to clients that removes the potentially interleaved nature of an - XPS document. This allows clients to manipulate files using the parts full name - instead of having to worry about the semantics of interleaved parts. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsarch.h" - -typedef HRESULT (*GetClassObject)(REFCLSID, REFIID, LPVOID FAR*); - -static PCSTR szPartNameFormatString = "%s/[%i].piece"; -static PCSTR szLastPartNameFormatString = "%s/[%i].last.piece"; - -// -// GUIDs for the archive handler -// -CONST GUID CLSID_PKArchiveHandler = {0x5a0f4115, 0xd4d3, 0x401e, {0x80, 0x71, 0xa4, 0x40, 0xd6, 0xd0, 0x70, 0x92}}; -CONST GUID IID_IPKArchive = {0xbdbbdf56, 0xc742, 0x4efd, {0x80, 0x75, 0xaf, 0x2c, 0x7b, 0x24, 0x7f, 0x38}}; - -/*++ - -Routine Name: - - CXPSArchive::CXPSArchive - -Routine Description: - - CXPSArchive class constructor - -Arguments: - - pReadStream - Pointer to the print read stream - pWriteStream - Pointer to the print write stream - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CXPSArchive::CXPSArchive( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream - ) : - m_pWriteStream(pWriteStream), - m_pPkArchive(NULL), - m_hPkArch(NULL) -{ - HRESULT hr = S_OK; - - // - // Get the current directory to load the pk archive library - // - DWORD cchName = 0; - TCHAR* szFileName = new(std::nothrow) TCHAR[MAX_PATH]; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_OUTOFMEMORY))) - { - cchName = GetModuleFileName(g_hInstance, szFileName, MAX_PATH); - - if (cchName == 0) - { - hr = GetLastErrorAsHResult(); - } - } - - if (SUCCEEDED(hr) && - cchName > 0) - { - // - // Remove the filespec - // - PathRemoveFileSpec(szFileName); - - try - { - // - // Append the PK archive DLL name - // - CStringXD cstrPath(szFileName); - cstrPath += TEXT("\\pkarch.dll"); - - // - // Try to load the PK archive DLL - // - m_hPkArch = LoadLibrary(cstrPath); - } - catch (CXDException& e) - { - hr = e; - } - } - - if (szFileName != NULL) - { - delete[] szFileName; - szFileName = NULL; - } - - if (SUCCEEDED(hr)) - { - // - // Get DllGetClassObject from the PK archive and instantiate the PK archive handler - // - if (m_hPkArch != NULL) - { - GetClassObject pfnGetClassObject = reinterpret_cast(GetProcAddress(m_hPkArch, "DllGetClassObject")); - - if (SUCCEEDED(hr = CHECK_POINTER(pfnGetClassObject, E_NOINTERFACE)) && - SUCCEEDED(hr = pfnGetClassObject(CLSID_PKArchiveHandler, IID_IPKArchive, reinterpret_cast(&m_pPkArchive)))) - { - hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE); - } - } - else - { - hr = E_NOINTERFACE; - } - } - - // - // Initialise the IO streams - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pReadStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pWriteStream, E_POINTER)) && - SUCCEEDED(hr = m_pPkArchive->SetReadStream(pReadStream)) && - SUCCEEDED(hr = m_pPkArchive->SetWriteStream(m_pWriteStream))) - { - // - // We can now process the read stream to create the file index - // - hr = m_pPkArchive->ProcessReadStream(); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CXPSArchive::~CXPSArchive - -Routine Description: - - CXPSArchive class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSArchive::~CXPSArchive() -{ - if (m_pPkArchive != NULL) - { - m_pPkArchive->Close(); - m_pPkArchive = NULL; - } - - if (m_pWriteStream != NULL) - { - m_pWriteStream->Close(); - } - - if (m_hPkArch != NULL) - { - FreeLibrary(m_hPkArch); - } -} - -/*++ - -Routine Name: - - CXPSArchive::InitialiseFile - -Routine Description: - - This routine intialises the named file ready for processing - or sending on. This entails locating all the PK archive files - that constitute the XPS part. - -Arguments: - - szFileName - The name of the part to intialise - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::InitialiseFile( - _In_z_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - CStringXDA cstrFileName(szFileName); - - // - // Open the file handler - if it is still in use this will fail - // - if (SUCCEEDED(hr = m_XpsFile.Open(szFileName))) - { - // - // Find the record or the parts comprising the record - // - hr = AddFile(szFileName); - } - else - { - RIP("File handler has not been closed correctly\n"); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::GetFileStream - -Routine Description: - - This routine retrieves the read stream for an XPS part. - -Arguments: - - szFileName - The name of the XPS part the stream is required for - ppFileStream - Pointer to an ISequentialStream pointer that recieves the stream - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::GetFileStream( - _In_z_ PCSTR szFileName, - _Outptr_ ISequentialStream** ppFileStream - ) -{ - HRESULT hr = S_OK; - - // - // Initialise the current XPS file - // - if (SUCCEEDED(hr = CHECK_POINTER(ppFileStream, E_POINTER)) && - SUCCEEDED(hr = InitialiseFile(szFileName))) - { - // - // Query the XPS file for the file stream - // - *ppFileStream = NULL; - hr = m_XpsFile.QueryInterface(IID_ISequentialStream, reinterpret_cast(ppFileStream)); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::CloseCurrent - -Routine Description: - - This routine closes the currently opened XPS file - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::CloseCurrent( - VOID - ) -{ - return m_XpsFile.Close(); -} - -/*++ - -Routine Name: - - CXPSArchive::SendCurrentFile - -Routine Description: - - This routine sends the current initialised file and requests the - PK archive handler compresses it according to the requested method - -Arguments: - - eCompType - The requested compression type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::SendCurrentFile( - _In_ ECompressionType eCompType - ) -{ - HRESULT hr = S_OK; - - ULONG cb = 0; - PVOID pv = NULL; - PSTR pName = NULL; - - // - // Get the data buffer and file name - // - if (SUCCEEDED(hr = m_XpsFile.GetBuffer(&pv, &cb)) && - SUCCEEDED(hr = m_XpsFile.GetFileName(&pName))) - { - hr = SendFile(pName, pv, cb, eCompType); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::SendCurrentFile - -Routine Description: - - This routine sends the current initialised file by requesting the - PK archive handler send the original constituent PK records - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::SendCurrentFile( - VOID - ) -{ - HRESULT hr = S_OK; - - XPSPartStack* pPartStack = NULL; - PSTR pName = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE)) && - SUCCEEDED(hr = m_XpsFile.GetFileParts(&pPartStack)) && - SUCCEEDED(hr = m_XpsFile.GetFileName(&pName))) - { - try - { - // - // Send all file parts on to the PK archive - // - if (!m_sentList[pName]) - { - XPSPartStack::const_iterator iterParts = pPartStack->begin(); - - for (; - iterParts != pPartStack->end() && SUCCEEDED(hr); - iterParts++) - { - hr = m_pPkArchive->SendFile(iterParts->first); - } - - if (SUCCEEDED(hr)) - { - m_sentList[pName] = TRUE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::SendFile - -Routine Description: - - This routine sends a file defined by it's name and constituent data. The - routine passes the name and buffer to the PK archive handler to compress - and add to the archive. - -Arguments: - - szFileName - The name of the part - pBuffer - The buffer containing the part data - cbBuffer - The size of the data buffer - eCompType - The requested compression type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSArchive::SendFile( - _In_z_ PCSTR szFileName, - _In_reads_bytes_(cbBuffer) PVOID pBuffer, - _In_ ULONG cbBuffer, - _In_ ECompressionType eCompType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE)) && - SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pBuffer, E_POINTER))) - { - if (eCompType == CompDeflated || - eCompType == CompNone) - { - try - { - // - // Get the PK archive to compress and send the file on - // - if (!m_sentList[szFileName]) - { - if (SUCCEEDED(hr = m_pPkArchive->SendFile(szFileName, pBuffer, cbBuffer, eCompType))) - { - m_sentList[szFileName] = TRUE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSArchive::AddFile - -Routine Description: - - This routine adds the PK file or constiuent PK files to the XPS file - ready for retrieval of the read stream. This hides the XPS piece handling - from the client which just adds the part by it's full un-interleaved name - -Arguments: - - szFileName - The name of the part - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - When part not present or badly formed in the container - E_* - On error - ---*/ -HRESULT -CXPSArchive::AddFile( - _In_z_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pPkArchive, E_NOINTERFACE)) && - SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - // - // Find the part or parts comprising the file - // - NameIndex* pNameIndex = NULL; - - if (SUCCEEDED(hr = m_pPkArchive->GetNameIndex(&pNameIndex))) - { - try - { - NameIndex::const_iterator iterNameIndex = pNameIndex->find(szFileName); - if (iterNameIndex != pNameIndex->end()) - { - // - // There is a single part - // - hr = m_XpsFile.AddFilePart(CStringXDA(szFileName), iterNameIndex->second); - } - else - { - // - // This could be a multipart interleaved file - // - UINT cPart = 0; - do - { - CStringXDA cstrPart; - cstrPart.Format(szPartNameFormatString, szFileName, cPart); - - iterNameIndex = pNameIndex->find(cstrPart); - if (iterNameIndex != pNameIndex->end()) - { - // - // We found the next part - // - hr = m_XpsFile.AddFilePart(CStringXDA(szFileName), iterNameIndex->second); - cPart++; - } - else - { - cstrPart.Format(szLastPartNameFormatString, szFileName, cPart); - iterNameIndex = pNameIndex->find(cstrPart); - - if (iterNameIndex != pNameIndex->end()) - { - // - // We found the last part - // - hr = m_XpsFile.AddFilePart(CStringXDA(szFileName), iterNameIndex->second); - cPart++; - break; - } - else - { - // - // The element is either not well constructed (i.e. missing a piece or the last - // part) or it does not exist - // - hr = E_ELEMENT_NOT_FOUND; - } - } - } - while (SUCCEEDED(hr)); - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h deleted file mode 100644 index c891faa2..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsarch.h +++ /dev/null @@ -1,91 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsarch.h - -Abstract: - - Definition of the XPS archive class. This class is responsible for providing - an interface to clients that removes the potentially interleaved nature of an - XPS document. This allows clients to manipulate files using the parts full name - instead of having to worry about the semantics of interleaved parts. - ---*/ - -#pragma once - -#include "ipkarch.h" -#include "xpsfiler.h" - -class CXPSArchive -{ -public: - CXPSArchive( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream - ); - - virtual ~CXPSArchive(); - - HRESULT - InitialiseFile( - _In_z_ PCSTR szFileName - ); - - HRESULT - GetFileStream( - _In_z_ PCSTR szFileName, - _Outptr_ ISequentialStream** ppFileStream - ); - - HRESULT - CloseCurrent( - VOID - ); - - HRESULT - SendCurrentFile( - _In_ ECompressionType eCompType - ); - - HRESULT - SendCurrentFile( - VOID - ); - - HRESULT - SendFile( - _In_z_ PCSTR szFileName, - _In_reads_bytes_(cbBuffer) PVOID pBuffer, - _In_ ULONG cbBuffer, - _In_ ECompressionType eCompType - ); - -private: - HRESULT - AddFile( - _In_z_ PCSTR szFileName - ); - -private: - HMODULE m_hPkArch; - - CComPtr m_pPkArchive; - - CXPSReadFile m_XpsFile; - - SentList m_sentList; - - CComPtr m_pWriteStream; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp deleted file mode 100644 index ebe78ee5..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfd.cpp - -Abstract: - - Implementation of the XPS Fixed Document (FD) SAX handler. This class is - responsible for retrieving and storing in the correct order the Fixed Pages - that comprise the Fixed Document. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsfd.h" - -static PCSTR szPageContent = "PageContent"; -static PCSTR szSource = "Source"; - -/*++ - -Routine Name: - - CFixedDocument::CFixedDocument - -Routine Description: - - CFixedDocument class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocument::CFixedDocument() -{ -} - -/*++ - -Routine Name: - - CFixedDocument::~CFixedDocument - -Routine Description: - - CFixedDocument class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocument::~CFixedDocument() -{ -} - -/*++ - -Routine Name: - - CFixedDocument::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse the fixed document mark-up retrieving and storing the list of - fixed pages in the document - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CFixedDocument::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (cstrElementName == szPageContent) - { - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying the document in the sequence - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szSource) - { - // - // Strip any leading "/" - // - if (cstrAttValue.GetAt(0) == '/') - { - cstrAttValue.Delete(0); - } - - try - { - // - // Add the fixed page to the list - // - m_FixedPageList.push_back(cstrAttValue); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFixedDocument::GetFixedPageList - -Routine Description: - - This routine retrieves the fixed page list constructed as the fixed document - mark-up was parsed - -Arguments: - - pFixedPageList - Pointer to the vector that recieves the fixed page list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocument::GetFixedPageList( - _Out_ FileList* pFixedPageList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFixedPageList, E_POINTER))) - { - try - { - pFixedPageList->assign(m_FixedPageList.begin(), m_FixedPageList.end()); - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - return hr; -} - -/*++ - -Routine Name: - - CFixedDocument::Clear - -Routine Description: - - This routine clears the fixed page list - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocument::Clear( - VOID - ) -{ - HRESULT hr = S_OK; - - m_FixedPageList.clear(); - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h deleted file mode 100644 index 65888511..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfd.h +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfd.h - -Abstract: - - Definition of the XPS Fixed Document (FD) SAX handler. This class is - responsible for retrieving and storing in the correct order the Fixed Pages - that comprise the Fixed Document. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CFixedDocument : public CSaxHandler -{ -public: - CFixedDocument(); - - virtual ~CFixedDocument(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - GetFixedPageList( - _Out_ FileList* pFixedPageList - ); - - HRESULT - Clear( - VOID - ); - -private: - FileList m_FixedPageList; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp deleted file mode 100644 index e4eb8bc8..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfds.cpp - -Abstract: - - Implementation of the XPS Fixed Document Sequence (FDS) SAX handler. - This class is responsible for retrieving and storing in the correct - order the Fixed Documentss that comprise the Fixed Document - Sequence. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsfds.h" - -static PCSTR szDocumentReference = "DocumentReference"; -static PCSTR szSource = "Source"; - -/*++ - -Routine Name: - - CFixedDocumentSequence::CFixedDocumentSequence - -Routine Description: - - CFixedDocumentSequence class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocumentSequence::CFixedDocumentSequence() -{ -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::~CFixedDocumentSequence - -Routine Description: - - CFixedDocumentSequence class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFixedDocumentSequence::~CFixedDocumentSequence() -{ -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse the fixed document sequence mark-up retrieving and storing the list of - fixed documents in the sequence - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CFixedDocumentSequence::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (cstrElementName == szDocumentReference) - { - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying the document in the sequence - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szSource) - { - // - // Strip any leading "/" - // - if (cstrAttValue.GetAt(0) == '/') - { - cstrAttValue.Delete(0); - } - - try - { - // - // Add the fixed document to the list - // - m_FixedDocumentList.push_back(cstrAttValue); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::GetFixedDocumentList - -Routine Description: - - This routine retrieves the fixed document list constructed as the fixed document - sequence mark-up was parsed - -Arguments: - - pFixedDocumentList - Pointer to the vector that recieves the fixed document list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocumentSequence::GetFixedDocumentList( - _Out_ FileList* pFixedDocumentList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pFixedDocumentList, E_POINTER))) - { - try - { - pFixedDocumentList->assign(m_FixedDocumentList.begin(), m_FixedDocumentList.end()); - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - return hr; -} - -/*++ - -Routine Name: - - CFixedDocumentSequence::Clear - -Routine Description: - - This routine clears the fixed page list - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFixedDocumentSequence::Clear( - VOID - ) -{ - HRESULT hr = S_OK; - - m_FixedDocumentList.clear(); - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h deleted file mode 100644 index 78860b70..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfds.h +++ /dev/null @@ -1,61 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfds.h - -Abstract: - - Definition of the XPS Fixed Document Sequence (FDS) SAX handler. - This class is responsible for retrieving and storing in the correct - order the Fixed Documentss that comprise the Fixed Document - Sequence. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CFixedDocumentSequence : public CSaxHandler -{ -public: - CFixedDocumentSequence(); - - virtual ~CFixedDocumentSequence(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - GetFixedDocumentList( - _Out_ FileList* pFixedDocumentList - ); - - HRESULT - Clear( - VOID - ); - -private: - FileList m_FixedDocumentList; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp deleted file mode 100644 index c8ee85cb..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.cpp +++ /dev/null @@ -1,679 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfiler.cpp - -Abstract: - - Implementation of the XPS file reader class. This class implements - ISequentialStream::Read by using the IPKFile interface to supply the - client with decompressed data as requested. This allows the file to - be passed directly to a SAX or DOM handler for parsing. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xpsfiler.h" - -/*++ - -Routine Name: - - CXPSReadFile::CXPSReadFile - -Routine Description: - - CXPSReadFile class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSReadFile::CXPSReadFile() : - CUnknown(IID_ISequentialStream), - m_cbSent(0), - m_cbExtracted(0), - m_bExtractedAll(FALSE) -{ -} - -/*++ - -Routine Name: - - CXPSReadFile::~CXPSReadFile - -Routine Description: - - CXPSReadFile class denstructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSReadFile::~CXPSReadFile() -{ - Close(); -} - -/*++ - -Routine Name: - - CXPSReadFile::Read - -Routine Description: - - This routine implements the ISequentialStream read interface allowing - clients to access file data without having to worry about part - interleaving or decompression. - -Arguments: - - pv - Pointer to the buffer to recieve the file data - cb - The size of the data buffer - pcbRead - Pointer to a ULONG that recieves the number of bytes read - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSReadFile::Read( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbRead, E_POINTER))) - { - *pcbRead = 0; - - if (cb > 0) - { - // - // Add data to our working buffer till we have enough to copy or - // we ran out of data - // - while (m_cbExtracted - m_cbSent < cb && - !m_bExtractedAll && - SUCCEEDED(hr)) - { - hr = DecompressNextFile(); - } - - // - // Copy the data into the copy buffer - // - if (SUCCEEDED(hr)) - { - hr = CopyBuffer(pv, cb, pcbRead); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::Write - -Routine Description: - - This routine is the ISequentialStream write implementation. It is not - implemented - -Arguments: - - Unused - -Return Value: - - HRESULT - E_NOTIMPL - This method is not implemented - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSReadFile::Write( - _In_reads_bytes_(cb) CONST void*, - _In_ ULONG cb, - _Out_opt_ ULONG* - ) -{ - UNREFERENCED_PARAMETER(cb); - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXPSReadFile::Open - -Routine Description: - - This routine intialises a file ready to be read - -Arguments: - - szFileName - The name of the part to be intialised - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::Open( - _In_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - if (m_partStack.empty()) - { - m_cstrFileName = szFileName; - } - else - { - RIP("The file must be closed before another is opened\n"); - - hr = E_FAIL; - } - - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::Close - -Routine Description: - - This routine closes the currently open file - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::Close( - VOID - ) -{ - HRESULT hr = S_OK; - - m_partStack.clear(); - m_cstrFileName.Empty(); - m_cbSent = 0; - m_cbExtracted = 0; - m_bExtractedAll = 0; - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::GetBuffer - -Routine Description: - - This routine retrieves the current populated buffer and the count - of bytes available - -Arguments: - - ppv - Pointer to a VOID pointer that recieves the buffer - pcb - Pointer to a ULONG that recieves the size of the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcb, E_POINTER))) - { - *ppv = NULL; - *pcb = 0; - - if (!m_bExtractedAll) - { - hr = E_PENDING; - } - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_workFile.GetBuffer(m_cbExtracted, ppv))) - { - *pcb = static_cast(m_cbExtracted); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::GetFileName - -Routine Description: - - This routine retrieves the file name of the currently opened file - -Arguments: - - pszFileName - Pointer to a string that recieves the filename - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::GetFileName( - _Outptr_ PSTR* pszFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszFileName, E_POINTER))) - { - try - { - if (m_cstrFileName.GetLength() > 0) - { - *pszFileName = m_cstrFileName.GetBuffer(); - } - else - { - hr = E_PENDING; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::AddFilePart - -Routine Description: - - This routine adds a PK file name to the stack of files that - constitute the XPS part - -Arguments: - - szFileName - The file name to add - pPkFile - The PK file to add to the stack - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::AddFilePart( - _In_ PCSTR szFileName, - _In_ CONST IPKFile* pPkFile - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPkFile, E_POINTER))) - { - try - { - if (m_cstrFileName == szFileName) - { - m_partStack.push_back(RecordTracker(pPkFile, FALSE)); - } - else - { - RIP("Filename differs from currently open file\n"); - - hr = E_FAIL; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::GetFileParts - -Routine Description: - - This routine retrieves the PK files that constitute the XPS part - -Arguments: - - ppPartStack - Pointer to an XPSPartStack pointer that recieves the part stack - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::GetFileParts( - _Outptr_ XPSPartStack** ppPartStack - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppPartStack, E_POINTER))) - { - *ppPartStack = &m_partStack; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::DecompressNextFile - -Routine Description: - - This routine decompresses the next compressed part in the part stack - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::DecompressNextFile( - VOID - ) -{ - HRESULT hr = S_OK; - - // - // If there are more files to decompress - // - if (!m_bExtractedAll) - { - try - { - // - // Decompress the next unprocessed file into the working buffer - // - XPSPartStack::iterator iterXpsStack = m_partStack.begin(); - - for (;iterXpsStack != m_partStack.end(); iterXpsStack++) - { - if (!iterXpsStack->second) - { - if (SUCCEEDED(hr = Decompress(iterXpsStack->first))) - { - iterXpsStack->second = TRUE; - } - - break; - } - } - - if (iterXpsStack == m_partStack.end()) - { - // - // That was the last record - // - m_bExtractedAll = TRUE; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - else - { - RIP("File has already been fully extracted\n"); - - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::Decompress - -Routine Description: - - This routine uses the PK archive handler to decompress the PK file specified - -Arguments: - - pRecord - The PK file to be decompressed - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::Decompress( - _In_ CONST IPKFile* pRecord - ) -{ - HRESULT hr = S_OK; - - ECompressionType eCompType; - ULONG cbDecompressed = 0; - - if (SUCCEEDED(hr = CHECK_POINTER(pRecord, E_POINTER)) && - SUCCEEDED(hr = pRecord->GetDecompressedSize(&cbDecompressed)) && - SUCCEEDED(hr = pRecord->GetCompressionMethod(&eCompType))) - { - if (eCompType == CompDeflated || - eCompType == CompNone) - { - PVOID pUnCompressedData = NULL; - - if (SUCCEEDED(hr = m_workFile.GetBuffer(m_cbExtracted + cbDecompressed, &pUnCompressedData))) - { - pUnCompressedData = reinterpret_cast(pUnCompressedData) + m_cbExtracted; - - if (SUCCEEDED(hr = pRecord->DecompressTo(pUnCompressedData, cbDecompressed))) - { - m_cbExtracted += cbDecompressed; - } - } - } - else - { - ERR("Unsupported compression method\n"); - - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSReadFile::CopyBuffer - -Routine Description: - - This routine copies the decompressed data from the working buffer to - the specified buffer - -Arguments: - - pv - Pointer to the buffer to recieve the file data - cb - The size of the data buffer - pcbRead - Pointer to a ULONG that recieves the number of bytes written to the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSReadFile::CopyBuffer( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbRead, E_POINTER))) - { - *pcbRead = 0; - - if (cb > 0) - { - // - // We return the smaller of the amount requested and the - // amount available - // - *pcbRead = static_cast(min(m_cbExtracted - m_cbSent, cb)); - - PVOID pData = NULL; - - if (SUCCEEDED(hr = m_workFile.GetBufferAt(static_cast(m_cbSent), static_cast(*pcbRead), &pData))) - { - CopyMemory(pv, pData, *pcbRead); - - m_cbSent += *pcbRead; - } - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h deleted file mode 100644 index 03603098..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfiler.h +++ /dev/null @@ -1,119 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfiler.h - -Abstract: - - Definition of the XPS file reader class. This class implements - ISequentialStream::Read by using the IPKFile interface to supply the - client with decompressed data as requested. This allows the file to - be passed directly to a SAX or DOM handler for parsing. - ---*/ - -#pragma once - -#include "xps.h" -#include "ipkarch.h" -#include "workbuff.h" -#include "cunknown.h" - -class CXPSReadFile : public CUnknown -{ -public: - CXPSReadFile(); - - virtual ~CXPSReadFile(); - - // - // ISequentialStream members - // - HRESULT STDMETHODCALLTYPE - Read( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ); - - HRESULT STDMETHODCALLTYPE - Write( - _In_reads_bytes_(cb) CONST void*, - _In_ ULONG cb, - _Out_opt_ ULONG* - ); - - HRESULT - Open( - _In_ PCSTR szFileName - ); - - HRESULT - Close( - VOID - ); - - HRESULT - AddFilePart( - _In_ PCSTR szFileName, - _In_ CONST IPKFile* pPkFile - ); - - HRESULT - GetFileParts( - _Outptr_ XPSPartStack** ppPartStack - ); - - HRESULT - GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ); - - HRESULT - GetFileName( - _Outptr_ PSTR* pszFileName - ); - -private: - HRESULT - DecompressNextFile( - VOID - ); - - HRESULT - Decompress( - _In_ CONST IPKFile* pRecord - ); - - HRESULT - CopyBuffer( - _Out_writes_bytes_(cb) void* pv, - _In_ ULONG cb, - _Out_ ULONG* pcbRead - ); - -private: - CWorkingBuffer m_workFile; - - CStringXDA m_cstrFileName; - - XPSPartStack m_partStack; - - SIZE_T m_cbSent; - - SIZE_T m_cbExtracted; - - BOOL m_bExtractedAll; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp deleted file mode 100644 index 64decfac..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfilew.cpp - -Abstract: - - Implementation of an XPS file writer. This implements ISequentialStream::Write - and essentially wraps a buffer that recieves and stores the part information - so that in can be later compressed and written out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xpsfilew.h" - -/*++ - -Routine Name: - - CXPSWriteFile::CXPSWriteFile - -Routine Description: - - CXPSWriteFile class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSWriteFile::CXPSWriteFile() : - CUnknown(IID_ISequentialStream), - m_cbWritten(0) -{ -} - -/*++ - -Routine Name: - - CXPSWriteFile::CXPSWriteFile - -Routine Description: - - CXPSWriteFile class constructor - -Arguments: - - szFileName - The name of the file to write to - -Return Value: - - None - ---*/ -CXPSWriteFile::CXPSWriteFile( - PCSTR szFileName - ) : - CUnknown(IID_ISequentialStream), - m_cbWritten(0), - m_cstrFileName(szFileName) -{ -} - -/*++ - -Routine Name: - - CXPSWriteFile::~CXPSWriteFile - -Routine Description: - - CXPSWriteFile class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSWriteFile::~CXPSWriteFile() -{ -} - -// -// ISequentialStream members -// -/*++ - -Routine Name: - - CXPSWriteFile::Read - -Routine Description: - - This is the ISequentialStream read method - this is not implemented in - the file writter - -Arguments: - - Unused - -Return Value: - - HRESULT - E_NOTIMPL - This method is not implemented - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSWriteFile::Read( - _Out_writes_bytes_to_(cb, *pcbRead) void*, - _In_ ULONG cb, - _Out_opt_ ULONG* pcbRead - ) -{ - UNREFERENCED_PARAMETER(cb); - UNREFERENCED_PARAMETER(pcbRead); - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXPSWriteFile::Write - -Routine Description: - - This routine implements the ISequentialStream wrte interface allowing - clients to write file data. - -Arguments: - - pData - Pointer to the source data - cbData - The size of the data buffer - pcbWritten - Pointer to a ULONG that recieves the number of bytes written - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXPSWriteFile::Write( - _In_reads_bytes_(cbData) CONST void* pData, - _In_ ULONG cbData, - _Out_ ULONG* pcbWritten - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pData, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbWritten, E_POINTER))) - { - *pcbWritten = 0; - - PBYTE pDest = NULL; - if (SUCCEEDED(hr = m_workFile.GetBuffer(m_cbWritten + cbData, reinterpret_cast(&pDest)))) - { - pDest += m_cbWritten; - - CopyMemory(pDest, pData, cbData); - - m_cbWritten += cbData; - *pcbWritten = cbData; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSWriteFile::GetBuffer - -Routine Description: - - This routine retrieves the buffer containing the file data written by - a client - -Arguments: - - ppv - Pointer to a VOID pointer that recieves the buffer - pcb - Pointer to a ULONG that recieves the size of the buffer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSWriteFile::GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcb, E_POINTER))) - { - *ppv = NULL; - *pcb = 0; - - if (SUCCEEDED(hr = m_workFile.GetBuffer(m_cbWritten, ppv))) - { - *pcb = static_cast(m_cbWritten); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSWriteFile::GetFileName - -Routine Description: - - This routine retrieves the file name of the currently opened file - -Arguments: - - pszFileName - Pointer to a string that recieves the filename - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSWriteFile::GetFileName( - _Outptr_ PSTR* pszFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pszFileName, E_POINTER))) - { - try - { - if (m_cstrFileName.GetLength() > 0) - { - *pszFileName = m_cstrFileName.GetBuffer(); - } - else - { - hr = E_PENDING; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h deleted file mode 100644 index 652027b1..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsfilew.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsfilew.h - -Abstract: - - Definition of an XPS file writer. This implements ISequentialStream::Write - and essentially wraps a buffer that recieves and stores the part information - so that in can be later compressed and written out. - ---*/ - -#pragma once - -#include "workbuff.h" -#include "cunknown.h" -#include "xdstring.h" - -class CXPSWriteFile : public CUnknown -{ -public: - CXPSWriteFile(); - - CXPSWriteFile( - PCSTR szFileName - ); - - virtual ~CXPSWriteFile(); - - // - // ISequentialStream members - // - HRESULT STDMETHODCALLTYPE - Read( - _Out_writes_bytes_to_(cb, *pcbRead) void*, - _In_ ULONG cb, - _Out_opt_ ULONG* pcbRead - ); - - HRESULT STDMETHODCALLTYPE - Write( - _In_reads_bytes_(cbData) CONST void* pData, - _In_ ULONG cbData, - _Out_ ULONG* pcbWritten - ); - - HRESULT - GetBuffer( - _Outptr_result_bytebuffer_(*pcb) PVOID* ppv, - _Out_ ULONG* pcb - ); - - HRESULT - GetFileName( - _Outptr_ PSTR* pszFileName - ); - -private: - CWorkingBuffer m_workFile; - - ULONG m_cbWritten; - - CStringXDA m_cstrFileName; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp deleted file mode 100644 index 14da1437..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.cpp +++ /dev/null @@ -1,916 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsproc.cpp - -Abstract: - - Implementation of the XPS processor. This class is responsible for handling - the logical document and page structure of the XPS container. The class starts - with the content types part and .rels part to find the Fixed Document Sequence. - It then parses the FDS to find the Fixed Documents and finally the FDs to find - each Fixed Page. Each fixed page is then reported to a client FixedPageProcessor - to interpret the mark-up and write out modifications as required. The class is - additionally responsible for ensuring all XPS parts and accompanying resources are - sent on to the PK archive handler to be written out. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsproc.h" -#include "xpsfilew.h" - -static PCSTR szContentTypes = "[Content_Types].xml"; -static PCSTR szRelsPre = "_rels/"; -static PCSTR szRelsPost = ".rels"; - -/*++ - -Routine Name: - - CXPSProcessor::CXPSProcessor - -Routine Description: - - CXPSProcessor class constructor - -Arguments: - - pReadStream - Pointer to the print read stream - pWriteStream - Pointer to the print write stream - pPageProcessor - Pointer to the page processor interface - pPropertyBag - Pointer to the filter pipeline property bag - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CXPSProcessor::CXPSProcessor( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream, - _In_ IFixedPageProcessor* pPageProcessor, - _In_ IPrintPipelinePropertyBag* pPropertyBag, - _In_ CPTManager* pPtManager - ) : - m_xpsArchive(pReadStream, pWriteStream), - m_pSaxRdr(NULL), - m_pPageProcessor(pPageProcessor), - m_pPrintPropertyBag(pPropertyBag), - m_pPtManager(pPtManager) -{ - HRESULT hr = S_OK; - - CComPtr pFileReader(NULL); - - // - // Setup the SAX reader and extract the content types - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pReadStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pWriteStream, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPageProcessor, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPtManager, E_POINTER)) && - SUCCEEDED(hr = m_pSaxRdr.CoCreateInstance(CLSID_SAXXMLReader60)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szContentTypes, &pFileReader)) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_contentTypes)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader)))) - { - // - // We've got all the data we need - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CXPSProcessor::~CXPSProcessor - -Routine Description: - - CXPSProcessor class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXPSProcessor::~CXPSProcessor() -{ -} - -/*++ - -Routine Name: - - CXPSProcessor::Start - -Routine Description: - - This routine kicks off the processing of the XPS archive struture. The - routine parses the Fixed Document Sequence mark-up to find the Fixed - Document parts, then parses the Fixed Document mark-up to find the Fixed - Page parts before passing these on to the Fixed Page processor. Additionally - the routine handles indentifying, processing and sending resources and part - relationships. Note: This limits the XPS document processing to only modifying - the fixed page data; the client is not presented the opportunity to modify any - other parts. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::Start( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Get the start part list and iterate over all parts - // - FileList fixedDocumentSequenceParts; - if (SUCCEEDED(hr = GetFixedDocumentSequenceParts(&fixedDocumentSequenceParts))) - { - FileList::const_iterator iterFDS = fixedDocumentSequenceParts.begin(); - - for (; - iterFDS != fixedDocumentSequenceParts.end() && - SUCCEEDED(hr) && - SUCCEEDED(hr = ProcessRelsParts(*iterFDS, ContentFixedDocumentSequence)); - iterFDS++) - { - // - // Parse the start part retrieving the FD list - iterate over all FDs - // - FileList fixedDocumentParts; - if (SUCCEEDED(hr = GetFixedDocumentParts(*iterFDS, &fixedDocumentParts))) - { - FileList::const_iterator iterFD = fixedDocumentParts.begin(); - - for (; - iterFD != fixedDocumentParts.end() && - SUCCEEDED(hr) && - SUCCEEDED(hr = ProcessRelsParts(*iterFD, ContentFixedDocument)); - iterFD++) - { - // - // Parse the FD retrieving the FP list - iterate over all FPs - // - FileList fixedPageParts; - if (SUCCEEDED(hr = GetFixedPageParts(*iterFD, &fixedPageParts))) - { - FileList::const_iterator iterFP = fixedPageParts.begin(); - - for (; - iterFP != fixedPageParts.end() && - SUCCEEDED(hr) && - SUCCEEDED(hr = ProcessRelsParts(*iterFP, ContentFixedPage)); - iterFP++) - { - // - // Process the fixed page - this calls on to the IFixedPageProcessor - // interface for the client to do the work - // - hr = ProcessFixedPage(*iterFP); - } - } - } - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetFixedDocumentSequenceParts - -Routine Description: - - This routine retrieves the Fixed Document Sequence from the root - relationships part. - -Arguments: - - pFixedDocumentSequencePartsList - List of fixed document sequences found to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetFixedDocumentSequenceParts( - _Inout_ FileList* pFixedDocumentSequencePartsList - ) -{ - HRESULT hr = S_OK; - - // - // Extract the .rels part to find the start part - // - if (SUCCEEDED(hr = CHECK_POINTER(pFixedDocumentSequencePartsList, E_POINTER)) && - SUCCEEDED(hr = GetRelsForPart(""))) - { - CONST RelsTypeList* pRelsTypeList = NULL; - - hr = m_rels.GetRelsTypeList("", &pRelsTypeList); - - RelsTypeList::const_iterator iterRels = pRelsTypeList->begin(); - - for (;iterRels != pRelsTypeList->end() && SUCCEEDED(hr); iterRels++) - { - if (iterRels->second == RelsStartPart) - { - // - // We have a start part add it to the part list - // - pFixedDocumentSequencePartsList->push_back(iterRels->first); - } - else - { - // - // Send any other part on - // - if (SUCCEEDED(hr = m_xpsArchive.InitialiseFile(iterRels->first)) && - SUCCEEDED(hr = m_xpsArchive.SendCurrentFile())) - { - m_xpsArchive.CloseCurrent(); - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetFixedDocumentParts - -Routine Description: - - This routine retrieves the list of fixed documents from the fixed document - sequence - -Arguments: - - szFixedDocSeq - The name of the FDS part to parse - pFixedDocumentParts - Pointer to the document list to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetFixedDocumentParts( - _In_ PCSTR szFixedDocSeq, - _Out_ FileList* pFixedDocumentParts - ) -{ - HRESULT hr = S_OK; - CComPtr pFileReader(NULL); - - // - // Set up the fixed document sequence as the current file in the - // XPS archive and parse the file stream using the FDS SAX content - // handler to retrieve all fixed documents in the sequence - // - if (SUCCEEDED(hr = CHECK_POINTER(szFixedDocSeq, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedDocumentParts, E_POINTER)) && - SUCCEEDED(hr = m_contentTypes.ValidateContentType(szFixedDocSeq, ContentFixedDocumentSequence)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szFixedDocSeq, &pFileReader)) && - SUCCEEDED(hr = m_fixedDocSeq.Clear()) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_fixedDocSeq)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader))) && - SUCCEEDED(hr = m_fixedDocSeq.GetFixedDocumentList(pFixedDocumentParts))) - { - // - // We are done with the FDS - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetFixedPageParts - -Routine Description: - - This routine retrieves the list of fixed pages from the Fixed Document - -Arguments: - - szFixedDoc - The name of the FD part to parse - pFixedPageParts - Pointer to the page list to be populated - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetFixedPageParts( - _In_ PCSTR szFixedDoc, - _Out_ FileList* pFixedPageParts - ) -{ - HRESULT hr = S_OK; - CComPtr pFileReader(NULL); - - // - // Set up the fixed document as the current file in the XPS - // archive and parse the file stream using the FD SAX content - // handler to retrieve all fixed pages in the document - // - if (SUCCEEDED(hr = CHECK_POINTER(szFixedDoc, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pFixedPageParts, E_POINTER)) && - SUCCEEDED(hr = m_contentTypes.ValidateContentType(szFixedDoc, ContentFixedDocument)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szFixedDoc, &pFileReader)) && - SUCCEEDED(hr = m_fixedDoc.Clear()) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_fixedDoc)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader))) && - SUCCEEDED(hr = m_fixedDoc.GetFixedPageList(pFixedPageParts))) - { - // - // We are done with the FD - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::GetRelsForPart - -Routine Description: - - This routine retrieves and populates the rels object with the relationships - for the specified part - -Arguments: - - szPartName - The name of the part to retrieve the relationships for - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::GetRelsForPart( - _In_ PCSTR szPartName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER))) - { - try - { - CStringXDA cstrRelsPartName; - CComPtr pFileReader(NULL); - - // - // Construct the rels part from the parent part name and parse for - // relationships - // - if (SUCCEEDED(hr = MakeRelsPartName(szPartName, &cstrRelsPartName)) && - SUCCEEDED(hr = m_contentTypes.ValidateContentType(cstrRelsPartName, ContentRelationships)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(cstrRelsPartName, &pFileReader)) && - SUCCEEDED(hr = m_pSaxRdr->putContentHandler(&m_rels)) && - SUCCEEDED(hr = m_rels.SetCurrentFileName(szPartName)) && - SUCCEEDED(hr = m_pSaxRdr->parse(CComVariant(pFileReader)))) - { - // - // We are done with the .rels part - send it on - // - hr = m_xpsArchive.SendCurrentFile(); - } - - // - // Close the curent file ready for the next - // - m_xpsArchive.CloseCurrent(); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::MakeRelsPartName - -Routine Description: - - This routine converts a part name into the appropriate .rels name. - The rules for naming are: - rels parts are stored in a directory named _rels relative to the current part - rels parts always end in .rels - e.g. \Documents\FixedDoc.fdseq has rels part \Documents\_rels\FixedDoc.fdseq.rels - -Arguments: - - szPartName - The name of the part to be converted - pcstrRelsPartName - Pointer to a CStringXDA that recieves the new name - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::MakeRelsPartName( - _In_ PCSTR szPartName, - _Out_ CStringXDA* pcstrRelsPartName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcstrRelsPartName, E_POINTER))) - { - try - { - *pcstrRelsPartName = szPartName; - - // - // Find the slash that splits the directory and part name - // - INT cLastSlash = -1; - for (;;) - { - INT cSlash = pcstrRelsPartName->Find("/", cLastSlash + 1); - - if (cSlash != -1) - { - cLastSlash = cSlash; - } - else - { - break; - } - } - cLastSlash++; - - // - // Insert "_rels/" after the slash and append ".rels" - // - pcstrRelsPartName->Insert(cLastSlash, szRelsPre); - pcstrRelsPartName->Append(szRelsPost); - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::ProcessRelsParts - -Routine Description: - - This routine processes the related parts for a given part - -Arguments: - - szPartName - The name of the part - eContentType - The type of the part to be processed. This must be either an FDS, FD or FP. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::ProcessRelsParts( - _In_ PCSTR szPartName, - _In_ CONST EContentType eContentType - ) -{ - HRESULT hr = S_OK; - - BOOL bPrintTicketSent = FALSE; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER))) - { - if (eContentType != ContentFixedDocumentSequence && - eContentType != ContentFixedDocument && - eContentType != ContentFixedPage) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - try - { - // - // Validate the part content type - // Get the rels and handle any print tickets - // - CONST RelsTypeList* pRelsTypeList; - if (SUCCEEDED(hr = m_contentTypes.ValidateContentType(szPartName, eContentType)) && - SUCCEEDED(hr = GetRelsForPart(szPartName)) && - SUCCEEDED(hr = m_rels.GetRelsTypeList(szPartName, &pRelsTypeList))) - { - - RelsTypeList::const_iterator iterRels = pRelsTypeList->begin(); - - for (;iterRels != pRelsTypeList->end() && SUCCEEDED(hr); iterRels++) - { - // - // Strip any leading "/" - // - CStringXDA cstrName(iterRels->first); - if (cstrName.GetAt(0) == '/') - { - cstrName.Delete(0); - } - - // - // The second of the pair in the RelsTypeList iterator is the rels type - // - switch (iterRels->second) - { - case RelsPrintTicket: - { - hr = AddPrintTicket(cstrName, eContentType); - bPrintTicketSent = TRUE; - } - break; - - case RelsAnnotations: - case RelsDigitalSignatureDefinitions: - case RelsDiscardControl: - case RelsDocumentStructure: - case RelsRequiredResource: - case RelsRestrictedFont: - case RelsStoryFragments: - case RelsCoreProperties: - case RelsDigitalSignature: - case RelsDigitalSignatureCertificate: - case RelsDigitalSignatureOrigin: - case RelsThumbnail: - { - // - // We are not interested in the content so intialise the current - // file in the XPS archive and send it on - // - if (SUCCEEDED(hr = m_xpsArchive.InitialiseFile(cstrName))) - { - hr = m_xpsArchive.SendCurrentFile(); - } - } - break; - - default: - { - ERR("Unrecognised rels part\n"); - - hr = E_FAIL; - } - break; - } - - // - // Close the current file ready for the next - // - m_xpsArchive.CloseCurrent(); - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // There is no PrintTicket - // - hr = S_OK; - } - - // - // No print ticket has been sent so just inform the print ticket - // manager that a suitable ticket needs to be set for this level - // - if (bPrintTicketSent == FALSE) - { - switch (eContentType) - { - case ContentFixedPage: - { - hr = m_pPtManager->SetTicket(kPTPageScope, NULL); - } - break; - case ContentFixedDocument: - { - hr = m_pPtManager->SetTicket(kPTDocumentScope, NULL); - } - break; - case ContentFixedDocumentSequence: - { - hr = m_pPtManager->SetTicket(kPTJobScope, NULL); - } - break; - default: - { - hr = ERROR_NOT_SUPPORTED; - } - break; - } - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::AddPrintTicket - -Routine Description: - - This routine retrieves the PrintTicket information and updates the PrintTicket - manager at the appropriate scope - -Arguments: - - szPTPartName - The part name for the PrintTicket - eContentType - The type of the containing part. This must be either an FDS, FD or FP. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::AddPrintTicket( - _In_ PCSTR szPTPartName, - _In_ CONST EContentType eContentType - ) -{ - HRESULT hr = S_OK; - - // - // Validate the parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(szPTPartName, E_POINTER))) - { - if (eContentType != ContentFixedDocumentSequence && - eContentType != ContentFixedDocument && - eContentType != ContentFixedPage) - { - hr = E_INVALIDARG; - } - } - - // - // Extract the PrintTicket from the current file in the XPS archive - // and pass to the PrinTicket manager at the appropriate scope - // - CComPtr pFileReader(NULL); - CComPtr pPT(NULL); - - VARIANT_BOOL fLoaded = VARIANT_FALSE; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szPTPartName, &pFileReader)) && - SUCCEEDED(hr = pPT.CoCreateInstance(CLSID_DOMDocument60)) && - SUCCEEDED(hr = pPT->load(CComVariant(pFileReader), &fLoaded))) - { - if (fLoaded == VARIANT_TRUE) - { - // - // Determine the scope from the parent parts content type - // - EPrintTicketScope ePTScope = kPTPageScope; - - if (eContentType == ContentFixedDocumentSequence) - { - ePTScope = kPTJobScope; - } - else if (eContentType == ContentFixedDocument) - { - ePTScope = kPTDocumentScope; - } - - if (SUCCEEDED(hr = m_pPtManager->SetTicket(ePTScope, pPT))) - { - // - // Make sure the PrintTicket is passed on - // - hr = m_xpsArchive.SendCurrentFile(); - } - } - else - { - ERR("Failed to load PT\n"); - - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXPSProcessor::AddPrintTicket - -Routine Description: - - This routine intialises the appropriate read and write streams for a fixed - page processor and calls the processor to do the work - -Arguments: - - szFPPartName - The name of the FixedPage part - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXPSProcessor::ProcessFixedPage( - _In_ PCSTR szFPPartName - ) -{ - HRESULT hr = S_OK; - // - // Retrieve the file stream and pass to the page scaling handler - // - CComPtr pFileReader(NULL); - CXPSWriteFile* pXpsWriteFile = new(std::nothrow) CXPSWriteFile(szFPPartName); - - IXMLDOMDocument2* pPT = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pXpsWriteFile, E_OUTOFMEMORY)) && - SUCCEEDED(hr = CHECK_POINTER(m_pPageProcessor, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(szFPPartName, E_PENDING)) && - SUCCEEDED(hr = m_xpsArchive.GetFileStream(szFPPartName, &pFileReader)) && - SUCCEEDED(hr = m_pPtManager->GetTicket(kPTPageScope, &pPT)) && - SUCCEEDED(hr = CHECK_POINTER(pPT, E_FAIL)) && - SUCCEEDED(hr = m_pPageProcessor->ProcessFixedPage(pPT, pFileReader, pXpsWriteFile))) - { - // - // Send the new fixed page - // - ULONG cb = 0; - PVOID pv = NULL; - - if (SUCCEEDED(hr = pXpsWriteFile->GetBuffer(&pv, &cb))) - { - hr = m_xpsArchive.SendFile(szFPPartName, pv, cb, CompDeflated); - } - } - else if (hr == HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)) - { - // - // The page processor does not want to do any work - just send the page - // - hr = m_xpsArchive.SendCurrentFile(); - } - - if (pXpsWriteFile != NULL) - { - delete pXpsWriteFile; - pXpsWriteFile = NULL; - } - - // - // Close the current file ready for the next - // - m_xpsArchive.CloseCurrent(); - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h deleted file mode 100644 index 70b08ec6..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsproc.h +++ /dev/null @@ -1,137 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsproc.h - -Abstract: - - Definition of the XPS processor. This class is responsible for handling - the logical document and page structure of the XPS container. The class starts - with the content types part and .rels part to find the Fixed Document Sequence. - It then parses the FDS to find the Fixed Documents and finally the FDs to find - each Fixed Page. Each fixed page is then reported to a client FixedPageProcessor - to interpret the mark-up and write out modifications as required. The class is - additionally responsible for ensuring all XPS parts and accompanying resources are - sent on to the PK archive handler to be written out. - ---*/ - -#pragma once - -#include "xps.h" -#include "xpsarch.h" -#include "xpstype.h" -#include "xpsrels.h" -#include "xpsfds.h" -#include "xpsfd.h" -#include "ptmanage.h" - -class IFixedPageProcessor -{ -public: - IFixedPageProcessor(){} - - virtual ~IFixedPageProcessor(){} - - virtual HRESULT - ProcessFixedPage( - _In_ IXMLDOMDocument2* pFPPT, - _In_ ISequentialStream* pPageReadStream, - _Out_ ISequentialStream* pPageWriteStream - ) = 0; -}; - -class CXPSProcessor -{ -public: - CXPSProcessor( - _In_ IPrintReadStream* pReadStream, - _In_ IPrintWriteStream* pWriteStream, - _In_ IFixedPageProcessor* pPageProcessor, - _In_ IPrintPipelinePropertyBag* pPropertyBag, - _In_ CPTManager* pPtManager - ); - - virtual ~CXPSProcessor(); - - HRESULT - Start( - VOID - ); - -private: - HRESULT - GetFixedDocumentSequenceParts( - _Inout_ FileList* pFixedDocumentSequenceParts - ); - - HRESULT - GetFixedDocumentParts( - _In_ PCSTR szFixedDocSeq, - _Out_ FileList* pFixedDocumentParts - ); - - HRESULT - GetFixedPageParts( - _In_ PCSTR szFixedDoc, - _Out_ FileList* pFixedPageParts - ); - - HRESULT - GetRelsForPart( - _In_ PCSTR szPartName - ); - - HRESULT - MakeRelsPartName( - _In_ PCSTR szPartName, - _Out_ CStringXDA* pcstrRelsPartName - ); - - HRESULT - ProcessRelsParts( - _In_ PCSTR szPartName, - _In_ CONST EContentType contentType - ); - - HRESULT - AddPrintTicket( - _In_ PCSTR szPartName, - _In_ CONST EContentType eContentType - ); - - HRESULT - ProcessFixedPage( - _In_ PCSTR szPartName - ); - -private: - CXPSArchive m_xpsArchive; - - CContentTypes m_contentTypes; - - CRels m_rels; - - CFixedDocumentSequence m_fixedDocSeq; - - CFixedDocument m_fixedDoc; - - CComPtr m_pSaxRdr; - - IFixedPageProcessor* m_pPageProcessor; - - CPTManager* m_pPtManager; - - CComPtr m_pPrintPropertyBag; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp deleted file mode 100644 index 8bb8fed8..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsrels.cpp - -Abstract: - - Implementation of the XPS rels part SAX handler. This class is responsible - for retrieving all the rels parts for a particular rels file and storing - them for access by the XPS processor. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpsrels.h" - -static PCSTR szRelationship = "Relationship"; -static PCSTR szTarget = "Target"; -static PCSTR szType = "Type"; - -static PCSTR szRels[ERelsTypeMax] = { - "http://schemas.microsoft.com/xps/2005/06/annotations", - "http://schemas.microsoft.com/xps/2005/06/signature-definitions", - "http://schemas.microsoft.com/xps/2005/06/discard-control", - "http://schemas.microsoft.com/xps/2005/06/documentstructure", - "http://schemas.microsoft.com/xps/2005/06/printticket", - "http://schemas.microsoft.com/xps/2005/06/required-resource", - "http://schemas.microsoft.com/xps/2005/06/restricted-font", - "http://schemas.microsoft.com/xps/2005/06/fixedrepresentation", - "http://schemas.microsoft.com/xps/2005/06/storyfragments", - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", - "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature", - "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/certificate", - "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin", - "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail", -}; - -/*++ - -Routine Name: - - CRels::CRels - -Routine Description: - - CRels class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CRels::CRels() -{ -} - -/*++ - -Routine Name: - - CRels::~CRels - -Routine Description: - - CRels class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CRels::~CRels() -{ -} - -/*++ - -Routine Name: - - CRels::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse a relationships part mark-up retrieving and storing the list of - relationships - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CRels::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (SUCCEEDED(hr) && - cstrElementName == szRelationship) - { - CStringXDA cstrTargetName; - CStringXDA cstrRelsType; - - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying part names and part types - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szTarget) - { - cstrTargetName = cstrAttValue; - } - else if (cstrAttName == szType) - { - cstrRelsType = cstrAttValue; - } - } - } - - if (cstrTargetName.GetLength() > 0) - { - if (cstrRelsType.GetLength() > 0) - { - ERelsType relsType; - if (SUCCEEDED(hr = GetRelsTypeFromString(cstrRelsType, &relsType))) - { - // - // Strip any leading "/" - // - if (cstrTargetName.GetAt(0) == '/') - { - cstrTargetName.Delete(0); - } - - try - { - m_relsMap[m_cstrCurrentFileName].push_back(RelsNameType(cstrTargetName, relsType)); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - else - { - RIP("Target name identified with no corresponding type\n"); - - hr = E_FAIL; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRels::SetCurrentFileName - -Routine Description: - - This routine sets the filename of the part for which the relationships - are being identified - -Arguments: - - szFileName - The name of the XPS part - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRels::SetCurrentFileName( - _In_ PCSTR szFileName - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szFileName, E_POINTER))) - { - try - { - m_cstrCurrentFileName = szFileName; - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRels::GetRelsTypeList - -Routine Description: - - This routine retrieves the list of the relationships for the specified - part name - -Arguments: - - szFileName - The name of the XPS part to retrieve the relationships list for - ppFileList - Pointer to a RelsTypeList pointer that recieves the relationships list - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRels::GetRelsTypeList( - _In_ PCSTR szFileName, - _Outptr_ CONST RelsTypeList** ppFileList - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppFileList, E_POINTER))) - { - try - { - RelsMap::const_iterator iterRels = m_relsMap.find(szFileName); - if (iterRels != m_relsMap.end()) - { - *ppFileList = &(iterRels->second); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_FOUND); - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CRels::GetRelsTypeFromString - -Routine Description: - - This routine retrieves the relationship enumeration defining the type from the - relationships string defining the type - -Arguments: - - cstrRelsType - The string defining the rels type - pRelsType - Pointer to the rels type that recieves the type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CRels::GetRelsTypeFromString( - _In_ CONST CStringXDA& cstrRelsType, - _Out_ ERelsType* pRelsType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pRelsType, E_POINTER))) - { - *pRelsType = RelsUnknown; - - try - { - if (cstrRelsType.GetLength() > 0) - { - for (ERelsType relsType = ERelsTypeMin; - relsType < ERelsTypeMax; - relsType = static_cast(relsType + 1)) - { - if (cstrRelsType.CompareNoCase(szRels[relsType]) == 0) - { - *pRelsType = relsType; - break; - } - } - - if (*pRelsType == RelsUnknown) - { - ERR("Unrecognized relationships type string.\n"); - - hr = E_FAIL; - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h b/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h deleted file mode 100644 index 29ee4a9c..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpsrels.h +++ /dev/null @@ -1,70 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpsrels.h - -Abstract: - - Definition of the XPS rels part SAX handler. This class is responsible - for retrieving all the rels parts for a particular rels file and storing - them for access by the XPS processor. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CRels : public CSaxHandler -{ -public: - CRels(); - - virtual ~CRels(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - GetRelsTypeList( - _In_ PCSTR szFileName, - _Outptr_ CONST RelsTypeList** ppFileList - ); - - HRESULT - SetCurrentFileName( - _In_ PCSTR szFileName - ); - -private: - HRESULT - GetRelsTypeFromString( - _In_ CONST CStringXDA& cstrRelsType, - _Out_ ERelsType* pRelsType - ); - -private: - RelsMap m_relsMap; - - CStringXDA m_cstrCurrentFileName; -}; - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp b/print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp deleted file mode 100644 index 35dca7cf..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpstype.cpp - -Abstract: - - Implementation of the XPS content type part SAX handler. This class is responsible - for retrieving all the content types information and storing them for access by the - XPS processor. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "xpstype.h" - -static PCSTR szCTOverride = "Override"; -static PCSTR szCTPartName = "PartName"; -static PCSTR szCTContentType = "ContentType"; -static PCSTR szCTDefault = "Default"; -static PCSTR szCTExtension = "Extension"; - -static PCSTR szContentType[EContentTypeMax] = { - "application/vnd.ms-package.xps-fixeddocumentsequence+xml", - "application/vnd.ms-package.xps-fixeddocument+xml", - "application/vnd.ms-package.xps-fixedpage+xml", - "application/vnd.ms-package.xps-discard-control+xml", - "application/vnd.ms-package.xps-documentstructure+xml", - "application/vnd.ms-opentype", - "application/vnd.ms-color.iccprofile", - "application/vnd.ms-package.obfuscated-opentype", - "application/vnd.ms-printing.printticket+xml", - "application/vnd.ms-package.xps-resourcedictionary+xml", - "application/vnd.ms-package.xps-storyfragments+xml", - "image/jpeg", - "image/png", - "image/tiff", - "image/vnd.ms-photo", - "application/vnd.openxmlformats-package.core-properties+xml", - "application/vnd.openxmlformats-package.digital-signature-certificate", - "application/vnd.openxmlformats-package.digital-signature-origin", - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml", - "application/vnd.openxmlformats-package.relationships+xml", -}; - -/*++ - -Routine Name: - - CContentTypes::CContentTypes - -Routine Description: - - CContentTypes class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CContentTypes::CContentTypes() -{ -} - -/*++ - -Routine Name: - - CContentTypes::~CContentTypes - -Routine Description: - - CContentTypes class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CContentTypes::~CContentTypes() -{ -} - -/*++ - -Routine Name: - - CContentTypes::startElement - -Routine Description: - - This routine is the startElement method of the SAX handler. This is used - to parse the content types part mark-up retrieving and storing the list of - content types - -Arguments: - - pwchNamespaceUri - Unused: Local namespace URI - cchNamespaceUri - Unused: Length of the namespace URI - pwchLocalName - Unused: Local name string - cchLocalName - Unused: Length of the local name string - pwchQName - The qualified name with prefix - cchQName - The length of the qualified name with prefix - pAttributes - Pointer to the ISAXAttributes interface containing attributes attached to the element - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CContentTypes::startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pwchQName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pAttributes, E_POINTER))) - { - if (cchQName <= 0) - { - hr = E_INVALIDARG; - } - } - - try - { - CStringXDA cstrElementName(pwchQName, cchQName); - - if (cstrElementName == szCTOverride || - cstrElementName == szCTDefault) - { - CStringXDA cstrPartName; - CStringXDA cstrPartType; - - INT cAttributes = 0; - - if (SUCCEEDED(hr)) - { - hr = pAttributes->getLength(&cAttributes); - } - - // - // Run over all attributes identifying part names and part types - // - for (INT cIndex = 0; cIndex < cAttributes && SUCCEEDED(hr); cIndex++) - { - PCWSTR pszAttUri = NULL; - INT cchAttUri = 0; - PCWSTR pszAttName = NULL; - INT cchAttName = 0; - PCWSTR pszAttQName = NULL; - INT cchAttQName = 0; - PCWSTR pszAttValue = NULL; - INT cchAttValue = 0; - - // - // Get the attribute data ready to write out - // - if (SUCCEEDED(hr = pAttributes->getName(cIndex, &pszAttUri, &cchAttUri, &pszAttName, &cchAttName, &pszAttQName, &cchAttQName)) && - SUCCEEDED(hr = pAttributes->getValue(cIndex, &pszAttValue, &cchAttValue))) - { - CStringXDA cstrAttName(pszAttQName, cchAttQName); - CStringXDA cstrAttValue(pszAttValue, cchAttValue); - - if (cstrAttName == szCTPartName || - cstrAttName == szCTExtension) - { - cstrPartName = cstrAttValue; - } - else if (cstrAttName == szCTContentType) - { - cstrPartType = cstrAttValue; - } - } - } - - if (cstrPartName.GetLength() > 0) - { - if (cstrPartType.GetLength() > 0) - { - EContentType contentType; - if (SUCCEEDED(hr = GetContentTypeFromString(cstrPartType, &contentType))) - { - // - // Strip any leading "/" - // - if (cstrPartName.GetAt(0) == '/') - { - cstrPartName.Delete(0); - } - - try - { - m_contentMap[cstrPartName] = contentType; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - else - { - RIP("Part name identified with no corresponding type\n"); - - hr = E_FAIL; - } - } - } - } - catch (CXDException& e) - { - hr = e; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CContentTypes::ValidateContentType - -Routine Description: - - This routine validates a part against a content type - -Arguments: - - szPartName - The name of the XPS part - contentType - The content type to validate against - -Return Value: - - HRESULT - S_OK - On success - E_ELEMENT_NOT_FOUND - When the part is not present - E_* - On error - ---*/ -HRESULT -CContentTypes::ValidateContentType( - _In_ PCSTR szPartName, - _In_ CONST EContentType contentType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(szPartName, E_POINTER))) - { - try - { - CStringXDA cstrPartName(szPartName); - - if (cstrPartName.GetLength() > 0) - { - // - // Check if the content type is defined for the full part name - // - ContentMap::const_iterator iterContents = m_contentMap.find(cstrPartName); - if (iterContents == m_contentMap.end()) - { - // - // Check if the type is defined by the extension - // - CStringXDA partExt(PathFindExtensionA(cstrPartName)); - - // - // Strip any leading "/" - // - if (partExt.GetAt(0) == '/') - { - partExt.Delete(0); - } - - iterContents = m_contentMap.find(partExt); - } - - if (iterContents != m_contentMap.end()) - { - if (contentType != iterContents->second) - { - hr = E_FAIL; - } - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (CXDException& e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR_EXC(hr, E_ELEMENT_NOT_FOUND); - return hr; -} - -/*++ - -Routine Name: - - CContentTypes::GetContentTypeFromString - -Routine Description: - - This routine retrieves the content type enumeration defining the type from the - content type string defining the type - -Arguments: - - cstrPartType - The string defining the content type - pContentType - Pointer to the content type that recieves the type - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CContentTypes::GetContentTypeFromString( - _In_ CONST CStringXDA& cstrPartType, - _Out_ EContentType* pContentType - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pContentType, E_POINTER))) - { - *pContentType = ContentUnknown; - - try - { - if (cstrPartType.GetLength() > 0) - { - for (EContentType contentType = EContentTypeMin; - contentType < EContentTypeMax; - contentType = static_cast(contentType + 1)) - { - if (cstrPartType.CompareNoCase(szContentType[contentType]) == 0) - { - *pContentType = contentType; - break; - } - } - - if (*pContentType == ContentUnknown) - { - ERR("Unrecognized content type string.\n"); - - hr = E_FAIL; - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.h b/print/XPSDrvSmpl/src/filters/xdcont/xpstype.h deleted file mode 100644 index 0a5b5b06..00000000 --- a/print/XPSDrvSmpl/src/filters/xdcont/xpstype.h +++ /dev/null @@ -1,63 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xpstype.h - -Abstract: - - Definition of the XPS content type part SAX handler. This class is responsible - for retrieving all the content types information and storing them for access by the - XPS processor. - ---*/ - -#pragma once - -#include "saxhndlr.h" -#include "xps.h" - -class CContentTypes : public CSaxHandler -{ -public: - CContentTypes(); - - virtual ~CContentTypes(); - - virtual HRESULT STDMETHODCALLTYPE - startElement( - CONST wchar_t*, - INT, - CONST wchar_t*, - INT, - _In_reads_(cchQName) CONST wchar_t* pwchQName, - _In_ INT cchQName, - _In_ ISAXAttributes* pAttributes - ); - - HRESULT - ValidateContentType( - _In_ PCSTR szPartName, - _In_ CONST EContentType contentType - ); - -private: - HRESULT - GetContentTypeFromString( - _In_ CONST CStringXDA& cstrPartType, - _Out_ EContentType* pContentType - ); - -private: - ContentMap m_contentMap; -}; - diff --git a/print/XPSDrvSmpl/src/inc/cunknown.h b/print/XPSDrvSmpl/src/inc/cunknown.h deleted file mode 100644 index c7cceff0..00000000 --- a/print/XPSDrvSmpl/src/inc/cunknown.h +++ /dev/null @@ -1,212 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - cunknown.h - -Abstract: - - Provides a simple template implementation for classes that need to - implement IUnknown. - ---*/ - -#pragma once - -template -class CUnknown : public _T -{ -public: - /*++ - - Routine Name: - - CUnknown - - Routine Description: - - CUnknown class constructor - - Arguments: - - IIDTarget - The target interface guid - - Return Value: - - None - - --*/ - CUnknown( - REFIID IIDTarget - ) : - m_IIDTarget(IIDTarget), - m_cRef(1) - { - } - - /*++ - - Routine Name: - - ~CUnknown - - Routine Description: - - CUnknown class destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - virtual ~CUnknown() - { - } - - // - // IUnknown methods - // - /*++ - - Routine Name: - - QueryInterface - - Routine Description: - - This routine implements the IUnknown::QueryInterface method. Returns the raw interface - pointer for the requested IID if it matches the target IID - - Arguments: - - riid - The IID of the requested interface - ppv - The raw interface pointer - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT STDMETHODCALLTYPE - QueryInterface( - REFIID riid, - _Out_ PVOID* ppv - ) - { - HRESULT hr = S_OK; - - if (ppv != NULL) - { - if (riid == IID_IUnknown || - riid == m_IIDTarget) - { - *ppv = static_cast<_T*>(this); - } - else - { - *ppv = NULL; - - hr = E_NOINTERFACE; - } - } - else - { - hr = E_POINTER; - } - - if (SUCCEEDED(hr)) - { - AddRef(); - } - - return hr; - } - - /*++ - - Routine Name: - - AddRef - - Routine Description: - - This routine increments the reference count on the current interface - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual ULONG STDMETHODCALLTYPE - AddRef() - { - return InterlockedIncrement(&m_cRef); - } - - /*++ - - Routine Name: - - Release - - Routine Description: - - This routine decrements the reference count on the current interface - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - Notes: - - The drv_at annotation tells Prefast to consider this object's memory - freed after Release has been called. - - --*/ - virtual - ULONG STDMETHODCALLTYPE - Release() - { - ULONG cRef = InterlockedDecrement(&m_cRef); - - if (0 == cRef) - { - delete this; - } - - return cRef; - } - -private: - LONG m_cRef; - - IID m_IIDTarget; -}; - diff --git a/print/XPSDrvSmpl/src/inc/gdip.h b/print/XPSDrvSmpl/src/inc/gdip.h deleted file mode 100644 index 923c3430..00000000 --- a/print/XPSDrvSmpl/src/inc/gdip.h +++ /dev/null @@ -1,121 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - gdip.h - -Abstract: - - Provides a wrapper class around GDIPlus that takes care of intialisation - and shutdown. A class only need define this as a member variable to use - GDIPlus - intialisation and shutdown are handled during construction and - destruction. - -Known issues: - - The class does not yet implement debug event handling. - ---*/ - -#pragma once - -class GDIPlus -{ -public: - /*++ - - Routine Name: - - GDIPlus - - Routine Description: - - GDIPlus class constructor - - Arguments: - - None - - Return Value: - - None - - --*/ - GDIPlus() : - m_pGDIPlusToken(NULL), - m_GDIPlusStartStatus(GdiplusNotInitialized) - { - GdiplusStartupInput gdiPlusStartInput; - - m_GDIPlusStartStatus = GdiplusStartup(&m_pGDIPlusToken, &gdiPlusStartInput, NULL); - } - - /*++ - - Routine Name: - - ~GDIPlus - - Routine Description: - - GDIPlus class destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - virtual ~GDIPlus() - { - GdiplusShutdown(m_pGDIPlusToken); - m_pGDIPlusToken = NULL; - m_GDIPlusStartStatus = GdiplusNotInitialized; - } - - /*++ - - Routine Name: - - GetGDIPlusStartStatus - - Routine Description: - - This routine returns the start status of GDI Plus - - Arguments: - - None - - Return Value: - - Gdiplus::Status - Ok - On success - Gdiplus error - On Error - - --*/ - Status GetGDIPlusStartStatus( - VOID - ) - { - return m_GDIPlusStartStatus; - } - -private: - ULONG_PTR m_pGDIPlusToken; - - Status m_GDIPlusStartStatus; -}; - diff --git a/print/XPSDrvSmpl/src/inc/ipkarch.h b/print/XPSDrvSmpl/src/inc/ipkarch.h deleted file mode 100644 index 7721a2db..00000000 --- a/print/XPSDrvSmpl/src/inc/ipkarch.h +++ /dev/null @@ -1,230 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ipkarch.h - -Abstract: - - Definition of the interface supported by the PK archive handling module. - ---*/ - -#pragma once - -#include "ipkfile.h" - -// -// {5A0F4115-D4D3-401e-8071-A440D6D07092} -// -DEFINE_GUID(CLSID_PKArchiveHandler, 0x5a0f4115, 0xd4d3, 0x401e, 0x80, 0x71, 0xa4, 0x40, 0xd6, 0xd0, 0x70, 0x92); - -// -// {BDBBDF56-C742-4efd-8075-AF2C7B247F38} -// -DEFINE_GUID(IID_IPKArchive, 0xbdbbdf56, 0xc742, 0x4efd, 0x80, 0x75, 0xaf, 0x2c, 0x7b, 0x24, 0x7f, 0x38); - - -typedef map NameIndex; - -class IPKArchive : public IUnknown -{ -public: - /*++ - - Routine Name: - - SetReadStream - - Routine Description: - - This routine sets the read stream for the PK archive handler - - Arguments: - - pReadStream - Pointer to the print read stream interface - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SetReadStream( - _In_ IPrintReadStream* pReadStream - ) = 0; - - /*++ - - Routine Name: - - SetWriteStream - - Routine Description: - - This routine sets the write stream for the PK archive handler - - Arguments: - - pWriteStream - Pointer to the print write stream interface - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SetWriteStream( - _In_ IPrintWriteStream* pWriteStream - ) = 0; - - /*++ - - Routine Name: - - ProcessReadStream - - Routine Description: - - This method instructs the PK archive handler to process the PK archive for all records - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual ProcessReadStream( - VOID - ) = 0; - - /*++ - - Routine Name: - - GetNameIndex - - Routine Description: - - This routine retrieves the archives indexed by name - - Arguments: - - ppNameIdx - Pointer to a NameIndex pointer that recieves the archive index - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual GetNameIndex( - _Outptr_ NameIndex** ppNameIdx - ) = 0; - - /*++ - - Routine Name: - - SendFile - - Routine Description: - - This routine sends the PK file to the write stream - - Arguments: - - pFile - Pointer to the IPKFile to be sent to the write stream - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SendFile( - _In_ CONST IPKFile* pFile - ) = 0; - - /*++ - - Routine Name: - - SendFile - - Routine Description: - - This routine compresses and sends a buffer as a PK archive to the write stream - - Arguments: - - szFileName - The name of the archive to be created - pBuffer - The buffer containing the uncompressed archive data - cbBuffer - The size of the uncompressed archive data - compressionType - The type of compression to be used (only CompNone and CompDeflated are supported) - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual SendFile( - _In_z_ PCSTR szFileName, - _In_reads_bytes_(cbBuffer) PVOID pBuffer, - ULONG cbBuffer, - ECompressionType eCompType - ) = 0; - - /*++ - - Routine Name: - - Close - - Routine Description: - - This routine closes and finalises the PK archive - - Arguments: - - None - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - virtual Close( - VOID - ) = 0; -}; - diff --git a/print/XPSDrvSmpl/src/inc/ipkfile.h b/print/XPSDrvSmpl/src/inc/ipkfile.h deleted file mode 100644 index 184b194c..00000000 --- a/print/XPSDrvSmpl/src/inc/ipkfile.h +++ /dev/null @@ -1,128 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ipkfile.h - -Abstract: - - Definition of the PK file interface supported by the PK archive handling module. - ---*/ - -#pragma once - -// -// All compression types added for completeness. Only CompNone and -// CompDeflated are correctly supported. -// -enum ECompressionType -{ - CompNone = 0, - CompShrunk, - CompFactor1, - CompFactor2, - CompFactor3, - CompFactor4, - CompImploded, - CompTokenized, - CompDeflated, - CompDefalted64, - CompPKImploded, - CompPKReserved, - CompBZIP2 -}; - -class IPKFile -{ -public: - /*++ - - Routine Name: - - GetCompressionMethod - - Routine Description: - - This method returns the current compression methof for the archive file - - Arguments: - - pCompType - Pointer to the ECompressionType enumeration that recieves the compression type - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - GetCompressionMethod( - _Out_ ECompressionType* peCompType - ) CONST = 0; - - /*++ - - Routine Name: - - GetDecompressedSize - - Routine Description: - - This routine retrieves the size of the uncompressed archive file - - Arguments: - - pcbUnCompressed - Pointer to a ULONG that recieves the decompressed data size - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - GetDecompressedSize( - _Out_ ULONG* pcbUnCompressed - ) CONST = 0; - - /*++ - - Routine Name: - - DecompressTo - - Routine Description: - - This routine decompresses the archive file data to the buffer passed - - Arguments: - - pDecompBuffer - Pointer to the buffer to be filled with decompressed data - cbDecompBuffer - Size of the decompresssion buffer passed - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - DecompressTo( - _Out_writes_bytes_(cbDecompBuffer) PVOID pDecompBuffer, - ULONG cbDecompBuffer - ) CONST = 0; -}; - diff --git a/print/XPSDrvSmpl/src/inc/streamcnv.h b/print/XPSDrvSmpl/src/inc/streamcnv.h deleted file mode 100644 index 2877073f..00000000 --- a/print/XPSDrvSmpl/src/inc/streamcnv.h +++ /dev/null @@ -1,593 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - streamcnv.h - -Abstract: - - This wrapper class presents an IStream interface to an IPrintReadStream object. - This is useful for where an IStream interface is required for an API but is not - available without creating a seperate buffer and copying data in, e.g. decoding - bitmap data in WIC. This is not appropriate for use with interfaces that write - back into the stream. - ---*/ - -#pragma once - -#include "cunknown.h" - -class CPrintReadStreamToIStream : public CUnknown -{ -public: - /*++ - - Routine Name: - - CPrintReadStreamToIStream - - Routine Description: - - CPrintReadStreamToIStream constructor - - Arguments: - - pReadStream - the print read stream to wrap with an IStream interface - - Return Value: - - None - - --*/ - CPrintReadStreamToIStream( - _In_ IPrintReadStream* pReadStream - ) : - CUnknown(IID_IStream), - m_pReadStream(pReadStream) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CoFileTimeNow(&m_mTime)) && - SUCCEEDED(hr = CoFileTimeNow(&m_cTime)) && - SUCCEEDED(hr = CoFileTimeNow(&m_aTime))) - { - m_cbStream.QuadPart = 0; - if (m_pReadStream == NULL) - { - hr = E_POINTER; - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - ~CPrintReadStreamToIStream - - Routine Description: - - CPrintReadStreamToIStream destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - virtual ~CPrintReadStreamToIStream() - { - } - - // - // ISequentialStream methods - // - /*++ - - Routine Name: - - Read - - Routine Description: - - Implements IStream::Read by calling on to IPrintReadStream::ReadBytes - - Arguments: - - pv - Pointer to the buffer to read into - cb - Count of bytes avaiable in the buffer pointed to by pv - pcbRead - pointer to a ULONG that recieves the count of bytes actually read - - Return Value: - - HRESULT - S_OK - On success and *pcbRead == cb - S_FALSE - On success and *pcbRead < cb - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - Read( - _Out_writes_bytes_to_(cb, *pcbRead) PVOID pv, - _In_ ULONG cb, - _Out_opt_ PULONG pcbRead - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pv, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcbRead, E_POINTER)) && - SUCCEEDED(hr = CoFileTimeNow(&m_aTime))) - { - BOOL bEOF = FALSE; - - *pcbRead = 0; - - while (SUCCEEDED(hr) && - !bEOF && - *pcbRead < cb) - { - DWORD cbRead = 0; - - hr = m_pReadStream->ReadBytes(reinterpret_cast(reinterpret_cast(pv) + *pcbRead), cb - *pcbRead, &cbRead, &bEOF); - - if (SUCCEEDED(hr)) - { - *pcbRead += cbRead; - } - } - } - - if (SUCCEEDED(hr) && - *pcbRead < cb) - { - hr = S_FALSE; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - Write - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Write( - _In_reads_bytes_(cb) CONST VOID*, - _In_ ULONG cb, - _Out_opt_ PULONG - ) - { - UNREFERENCED_PARAMETER(cb); - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - // - // IStream methods - // - /*++ - - Routine Name: - - Seek - - Routine Description: - - Implements IStream::Seek by calling on to IPrintReadStream::Seek - - Arguments: - - dlibMove - Count of bytes to displace the current position relative to the dwOrigin parameter - dwOrigin - The origin to apply the displacement from - plibNewPosition - Pointer to a variable to recieve the new position of the seek pointer - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - Seek( - LARGE_INTEGER dlibMove, - DWORD dwOrigin, - _Out_opt_ ULARGE_INTEGER* plibNewPosition - ) - { - HRESULT hr = S_OK; - - ULONGLONG libNewPos = 0; - if (SUCCEEDED(hr = m_pReadStream->Seek(dlibMove.QuadPart, dwOrigin, &libNewPos)) && - plibNewPosition != NULL) - { - plibNewPosition->QuadPart = libNewPos; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - SetSize - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - SetSize( - ULARGE_INTEGER - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - CopyTo - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - CopyTo( - _In_ IStream*, - ULARGE_INTEGER, - _Out_opt_ ULARGE_INTEGER*, - _Out_opt_ ULARGE_INTEGER* - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - Commit - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Commit( - DWORD - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - Revert - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Revert( - VOID - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - LockRegion - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - LockRegion( - ULARGE_INTEGER, - ULARGE_INTEGER, - DWORD - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - UnlockRegion - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - UnlockRegion( - ULARGE_INTEGER, - ULARGE_INTEGER, - DWORD - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - - /*++ - - Routine Name: - - Stat - - Routine Description: - - Retrieves the STATSG structure for this stream - - Arguments: - - pstatstg - Pointer to the STATSG structure to be completed - grfStatFlag - Flag determining what should be completed - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE Stat( - STATSTG* pstatstg, - DWORD grfStatFlag - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pstatstg, E_POINTER)) && - SUCCEEDED(hr = GetStreamSize(&pstatstg->cbSize))) - { - if (grfStatFlag == STATFLAG_DEFAULT) - { - CComBSTR bstrStoreName(L"PrintReadStream"); - UINT cchStoreName = bstrStoreName.Length(); - - pstatstg->pwcsName = reinterpret_cast(CoTaskMemAlloc((cchStoreName + 1) * sizeof(BSTR))); - - if (pstatstg->pwcsName != NULL) - { - CopyMemory(pstatstg->pwcsName, bstrStoreName.m_str, cchStoreName * sizeof(BSTR)); - pstatstg->pwcsName[cchStoreName] = 0; - } - else - { - hr = E_OUTOFMEMORY; - } - } - else - { - pstatstg->pwcsName = NULL; - } - - pstatstg->type = STGTY_STREAM; - pstatstg->mtime = m_mTime; - pstatstg->ctime = m_cTime; - pstatstg->atime = m_aTime; - pstatstg->grfMode = STGM_READ | STGM_SHARE_DENY_WRITE; - pstatstg->grfLocksSupported = LOCK_WRITE; - pstatstg->clsid = CLSID_NULL; - pstatstg->grfStateBits = 0; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - Clone - - Routine Description: - - Not implemented - - Arguments: - - None - - Return Value: - - E_NOTIMPL - - --*/ - HRESULT STDMETHODCALLTYPE - Clone( - IStream** - ) - { - ERR("Unsupported method called.\n"); - return E_NOTIMPL; - } - -private: - /*++ - - Routine Name: - - GetStreamSize - - Routine Description: - - Retrieves the stream size. If this is the first time the stream size is accessed - the method retrieves teh size by seeking to the end of the stream and reporting - the offset from the start. This value is then stored and used in subsequent - calls to this method - - Arguments: - - pcbSize - Pointer to the size to be filled out - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT - GetStreamSize( - ULARGE_INTEGER* pcbSize - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pcbSize, E_POINTER))) - { - // - // This stream implementation can never shrink, so if the size is greater - // than 0 we do not need to re-acquire. - // - if (m_cbStream.QuadPart > 0) - { - *pcbSize = m_cbStream; - } - else - { - // - // Seek to the end of the stream to find the size then reset to the current position - // - ULONGLONG libOldPosition = 0; - if (SUCCEEDED(hr = m_pReadStream->Seek(0, STREAM_SEEK_CUR, &libOldPosition)) && - SUCCEEDED(hr = m_pReadStream->Seek(0, STREAM_SEEK_END, &pcbSize->QuadPart)) && - SUCCEEDED(hr = m_pReadStream->Seek(libOldPosition, STREAM_SEEK_SET, NULL))) - { - // - // Store the result - // - m_cbStream.QuadPart = pcbSize->QuadPart; - } - } - } - - ERR_ON_HR(hr); - return hr; - } - - -private: - CComPtr m_pReadStream; - - ULARGE_INTEGER m_cbStream; - - FILETIME m_mTime; - - FILETIME m_cTime; - - FILETIME m_aTime; -}; - diff --git a/print/XPSDrvSmpl/src/inc/xdexcept.h b/print/XPSDrvSmpl/src/inc/xdexcept.h deleted file mode 100644 index 6dfc653f..00000000 --- a/print/XPSDrvSmpl/src/inc/xdexcept.h +++ /dev/null @@ -1,104 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdexcept.h - -Abstract: - - XPSDrv sample driver exception class - ---*/ - -#pragma once - -class CXDException -{ -public: - /*++ - - Routine Name: - - CXDException - - Routine Description: - - Class constructor - - Arguments: - - None - - Return Value: - - None - - --*/ - CXDException() throw() : - m_hr(E_FAIL) - { - } - - /*++ - - Routine Name: - - CXDException - - Routine Description: - - Class constructor - - Arguments: - - hr - HRESULT value for the error for which the exception is thrown - - Return Value: - - None - - --*/ - CXDException( - HRESULT hr - ) throw() : - m_hr(hr) - { - } - - /*++ - - Routine Name: - - operator HRESULT() - - Routine Description: - - HRESULT cast operator - - Arguments: - - None - - Return Value: - - The HRESULT value associated with the exception - - --*/ - operator HRESULT() CONST throw() - { - return m_hr; - } - -public: - HRESULT m_hr; -}; - diff --git a/print/XPSDrvSmpl/src/inc/xdstring.h b/print/XPSDrvSmpl/src/inc/xdstring.h deleted file mode 100644 index 0a1f7177..00000000 --- a/print/XPSDrvSmpl/src/inc/xdstring.h +++ /dev/null @@ -1,2889 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdstring.h - -Abstract: - - A string class that emulates the CStringT class interface. The class uses an - internal string of default length 128 characters. The string size is doubled - on each resize. - ---*/ - -#pragma once - -#include -#include "xdexcept.h" - -#define CCH_INITIAL_BUFFER 128 - -template< typename _T = CHAR > -class ChTraitsBaseXD -{ -public: - typedef CHAR XCHARXD; - typedef WCHAR YCHARXD; -}; - -template<> -class ChTraitsBaseXD< WCHAR > -{ -public: - typedef WCHAR XCHARXD; - typedef CHAR YCHARXD; -}; - -template -class CStringXDT -{ -public: - typedef typename ChTraitsBaseXD<_T>::XCHARXD XCHARXD; - typedef typename ChTraitsBaseXD<_T>::YCHARXD YCHARXD; - -public: - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - None - - Return Value: - - None - - --*/ - CStringXDT() : - m_pszData(NULL) - { - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - cstrSrc - source CStringXDT class to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_ CONST CStringXDT<_T>& cstrSrc - ) : - m_pszData(NULL) - { - CreateString(cstrSrc.GetString()); - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string that matches the template argument to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_z_ CONST XCHARXD* pszSrc - ) : - m_pszData(NULL) - { - CreateString(pszSrc); - } - - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string to construct from. This is the "cross" - string, i.e. CHAR for WCHAR template and vice versa - - Return Value: - - None - - --*/ - CStringXDT( - _In_z_ CONST YCHARXD* pszSrc - ) : - m_pszData(NULL) - { - CreateStringFromY(pszSrc); - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string that matches the template argument to construct from - cchSrc - the length of the source string to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_reads_(cchSrc) CONST XCHARXD* pszSrc, - _In_ INT cchSrc - ) : - m_pszData(NULL) - { - if (cchSrc < 0) - { - RIP("Negative string size requested.\n"); - throw CXDException(E_INVALIDARG); - } - - CreateString(pszSrc, static_cast(cchSrc)); - } - - /*++ - - Routine Name: - - CStringXDT - - Routine Description: - - Class constructor - - Arguments: - - pszSrc - source string to construct from. This is the "cross" - string, i.e. CHAR for WCHAR template and vice versa - cchSrc - the length of the source string to construct from - - Return Value: - - None - - --*/ - CStringXDT( - _In_reads_(cchSrc) CONST YCHARXD* pszSrc, - _In_ INT cchSrc - ) : - m_pszData(NULL) - { - if (cchSrc < 0) - { - RIP("Negative string size requested.\n"); - throw CXDException(E_INVALIDARG); - } - - CreateStringFromY(pszSrc, static_cast(cchSrc)); - } - - /*++ - - Routine Name: - - ~CStringXDT - - Routine Description: - - Class destructor - - Arguments: - - None - - Return Value: - - None - - --*/ - ~CStringXDT() - { - if (m_pszData != NULL) - { - HeapFree(GetProcessHeap(), 0, GetDataBuffer()); - m_pszData = NULL; - } - } - - // - // Operators - // - /*++ - - Routine Name: - - operator= - - Routine Description: - - Assignment operator - - Arguments: - - cstrSrc - const reference to the source CStringXDT - - Return Value: - - Reference to the newly assigned CStringXDT instance - - --*/ - CStringXDT<_T>& - operator=( - _In_ CONST CStringXDT<_T>& cstrSrc - ) - { - *this = cstrSrc.m_pszData; - - return *this; - } - - /*++ - - Routine Name: - - operator= - - Routine Description: - - Assignment operator - - Arguments: - - pszSrc - const pointer to the source string of the same type as the template - - Return Value: - - Reference to the newly assigned CStringXDT instance - - --*/ - CStringXDT<_T>& - operator=( - _In_z_ CONST XCHARXD* pszSrc - ) - { - if (this->operator!=(pszSrc)) - { - Empty(); - CreateString(pszSrc); - } - - return *this; - } - - /*++ - - Routine Name: - - operator= - - Routine Description: - - Assignment operator - - Arguments: - - pszSrc - const pointer to the source string of the opposite type to the template - - Return Value: - - Reference to the newly assigned CStringXDT instance - - --*/ - CStringXDT<_T>& - operator=( - _In_z_ CONST YCHARXD* pszSrc - ) - { - if (this->operator!=(pszSrc)) - { - Empty(); - CreateStringFromY(pszSrc); - } - - return *this; - } - - /*++ - - Routine Name: - - operator+= - - Routine Description: - - Addition assignment operator - appends a source string to the current underlying string - - Arguments: - - pszSrc - pointer to the native string to append - - Return Value: - - Reference to this instance - - --*/ - CStringXDT<_T>& - operator+=( - _In_z_ CONST XCHARXD* pszSrc - ) - { - size_t cchSrc = StringLength(pszSrc); - size_t cchCur = StringLength(GetString()); - - SetBufferSize(cchSrc + cchCur); - CopyString(GetString() + cchCur, GetBufferCharCount() - cchCur, pszSrc, cchSrc); - - return *this; - } - - /*++ - - Routine Name: - - operator+= - - Routine Description: - - Addition assignment operator - appends a source string to the current underlying string - - Arguments: - - pszSrc - pointer to the opposite string type to append - - Return Value: - - Reference to this instance - - --*/ - CStringXDT<_T>& - operator+=( - _In_z_ CONST YCHARXD* pszSrc - ) - { - size_t cchSrc = StringLength(pszSrc); - size_t cchCur = StringLength(GetString()); - - SetBufferSize(cchSrc + cchCur); - CopyYString(GetString() + cchCur, GetBufferCharCount() - cchCur, pszSrc, cchSrc); - - return *this; - } - - /*++ - - Routine Name: - - operator CONST _T*() - - Routine Description: - - const cast operator - - Arguments: - - None - - Return Value: - - Pointer to the underlying string - - --*/ - operator CONST _T*() CONST throw() - { - return GetString(); - } - - /*++ - - Routine Name: - - operator!= - - Routine Description: - - Inequality operator - compares against the native string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings do not match - false - the strings match - - --*/ - bool - operator!=( - _In_z_ CONST XCHARXD* pszCompare - ) CONST - { - return !operator==(pszCompare); - } - - /*++ - - Routine Name: - - operator== - - Routine Description: - - Equality operator - compares against the native string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings match - false - the strings do not match - - --*/ - bool - operator==( - _In_z_ CONST XCHARXD* pszCompare - ) CONST - { - return CompareXDString(GetString(), pszCompare) == 0; - } - - /*++ - - Routine Name: - - operator!= - - Routine Description: - - Inequality operator - compares against the oposite string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings do not match - false - the strings match - - --*/ - bool - operator!=( - _In_z_ CONST YCHARXD* pszCompare - ) CONST - { - return !operator==(pszCompare); - } - - /*++ - - Routine Name: - - operator== - - Routine Description: - - Equality operator - compares against the opposite string type - - Arguments: - - pszCompare - the string to compare to - - Return Value: - - true - the strings match - false - the strings do not match - - --*/ - bool - operator==( - _In_z_ CONST YCHARXD* pszCompare - ) CONST - { - CStringXDT cstrCompare(pszCompare); - return CompareXDString(GetString(), cstrCompare) == 0; - } - - /*++ - - Routine Name: - - operator< - - Routine Description: - - Less than operator - - Arguments: - - cstrCompare - The CStringXDT instance to compare to - - Return Value: - - true - this string instance is less than the compare string - false - this string instance is not less than the compare string - - --*/ - bool - operator<( - _In_ CONST CStringXDT<_T>& cstrCompare - ) CONST - { - return CompareXDString(GetString(), cstrCompare.GetString()) < 0; - } - - /*++ - - Routine Name: - - operator< - - Routine Description: - - Less than operator - - Arguments: - - cstrCompare - pointer to a native string to compate with - - Return Value: - - true - this string instance is less than the compare string - false - this string instance is not less than the compare string - - --*/ - bool - operator<( - _In_z_ CONST XCHARXD* pszCompare - ) CONST - { - return CompareXDString(GetString(), pszCompare) < 0; - } - - /*++ - - Routine Name: - - operator< - - Routine Description: - - Less than operator - - Arguments: - - cstrCompare - pointer to a opposite string type to compate with - - Return Value: - - true - this string instance is less than the compare string - false - this string instance is not less than the compare string - - --*/ - bool - operator<( - _In_z_ CONST YCHARXD* pszCompare - ) CONST - { - CStringXDT cstrCompare(pszCompare); - return CompareXDString(GetString(), cstrCompare) < 0; - } - - /*++ - - Routine Name: - - operator[] - - Routine Description: - - Array index operator - - Arguments: - - cchIndex - the character index into the string - - Return Value: - - The value of the character at the specified index - - --*/ - _T operator[]( - _In_ INT cchIndex - ) CONST - { - if (cchIndex < 0 || - cchIndex > GetLength()) - { - throw CXDException(E_INVALIDARG); - } - - return GetString()[cchIndex]; - } - - // - // Methods - // - /*++ - - Routine Name: - - AllocSysString - - Routine Description: - - Allocates a BSTR from the underlying string - - Arguments: - - None - - Return Value: - - The newly allocated BSTR - - --*/ - BSTR - AllocSysString() - { - return AllocSysString(GetString()); - } - - /*++ - - Routine Name: - - Find - - Routine Description: - - Finds the location of a sub string in the underlying string - - Arguments: - - pszSub - the sub string to search for - cchStart - the point to start searching the underlying string from - - Return Value: - - -1 if the sub string is not found - the index of the sub-string in the underlying strings - - --*/ - INT - Find( - _In_z_ CONST _T* pszSub, - _In_ INT cchStart = 0 - ) CONST throw() - { - return Find(GetString(), pszSub, cchStart); - } - - /*++ - - Routine Name: - - Delete - - Routine Description: - - Deletes one or more characters from a given offset - - Arguments: - - cchStart - the starting character to delete from - cchDelete - the number of characters to delete - - Return Value: - - The length of the remaining string - - --*/ - INT - Delete( - INT cchStart, - INT cchDelete = 1 - ) - { - if (cchStart < 0) - { - cchStart = 0; - } - - if (cchDelete < 0) - { - cchDelete = 0; - } - - size_t cchStr = StringLength(GetString()); - if (cchStr < static_cast(cchStart + cchDelete)) - { - throw CXDException(E_INVALIDARG); - } - - size_t cchToMove = cchStr + 1 - static_cast(cchDelete + cchStart); - MoveMemory(GetString() + cchStart, m_pszData + cchStart + cchDelete, cchToMove * sizeof(_T)); - - return GetLength(); - } - - /*++ - - Routine Name: - - GetLength - - Routine Description: - - Retrieves the length of the string - - Arguments: - - None - - Return Value: - - The count of characters in the string - - --*/ - INT - GetLength() CONST throw() - { - INT cch = 0; - - try - { - cch = static_cast(StringLength(GetString())); - } - catch (CXDException&) - { - } - - return cch; - } - - /*++ - - Routine Name: - - Format - - Routine Description: - - Writes formatted data to the string. - - Arguments: - - pszFormat - the format string - ... - Variable argument list - - Return Value: - - None - - --*/ - VOID - Format( - _In_z_ CONST _T* pszFormat, - ... - ) - { - if (pszFormat == NULL) - { - throw CXDException(E_INVALIDARG); - } - - va_list argList; - va_start(argList, pszFormat); - Format(pszFormat, argList); - va_end(argList); - } - - /*++ - - Routine Name: - - Empty - - Routine Description: - - Sets the string to zero length - - Arguments: - - None - - Return Value: - - None - - --*/ - VOID - Empty() - { - try - { - *GetString() = 0; - } - catch (CXDException&) - { - } - } - - /*++ - - Routine Name: - - Compare - - Routine Description: - - Compares the string data with a compare string passed in - case sensitive. - This is the same functionality as strcmp. - - Arguments: - - pszCompare - the string to compare against - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - INT - Compare( - _In_z_ CONST _T* pszCompare - ) CONST - { - return CompareXDString(GetString(), pszCompare); - } - - /*++ - - Routine Name: - - CompareNoCase - - Routine Description: - - Compares the string data with a compare string passed in - case insensitive. - This is the same functionality as stricmp. - - Arguments: - - pszCompare - the string to compare against - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - INT - CompareNoCase( - _In_z_ CONST _T* pszCompare - ) CONST throw() - { - return CompareXDStringNoCase(GetString(), pszCompare); - } - - /*++ - - Routine Name: - - Replace - - Routine Description: - - Replaces all instances of a target string with a new string - - Arguments: - - pszOld - the string to replace - pszNew - the replacement string - - Return Value: - - The number of replaced instances - - --*/ - INT - Replace( - _In_z_ CONST _T* pszOld, - _In_z_ CONST _T* pszNew - ) - { - // - // Find the length of the old and new strings - // - size_t cchOld = StringLength(pszOld); - size_t cchNew = StringLength(pszNew); - - // - // Count the instances of the string to replace - // - _T* pszCurr = GetString(); - INT cReplace = 0; - INT cchStart = Find(pszCurr, pszOld, 0); - while (cchStart >= 0) - { - cReplace++; - pszCurr += cchStart + cchOld; - cchStart = Find(pszCurr, pszOld, 0); - } - - if (cReplace > 0) - { - // - // Resize the buffer to accomodate the replacements - // - INT cchDelta = static_cast(cchNew - cchOld); - INT cchDeltaBuffer = cReplace * cchDelta; - SetBufferSize(StringLength(GetString()) + cchDeltaBuffer); - - // - // Replace all instances of the old string and replace with - // the new string - // - pszCurr = GetString(); - cchStart = Find(pszCurr, pszOld, 0); - while (cchStart >= 0) - { - // - // Move the remainder of the string up by the length of the replacement - // this makes room to insert the replacement string - // - pszCurr += cchStart; - _T* pszOldEnd = pszCurr + cchOld; - size_t cchToMove = StringLength(pszOldEnd) + 1; - MoveMemory(pszCurr + cchNew, pszOldEnd, cchToMove * sizeof(_T)); - - // - // Fill the "gap" with the new string - // - CopyMemory(pszCurr, pszNew, cchNew * sizeof(_T)); - - // - // Look for the next string from the end of the current instance - // - pszCurr += cchNew; - cchStart = Find(pszCurr, pszOld, 0); - } - } - - return cReplace; - } - - /*++ - - Routine Name: - - Append - - Routine Description: - - Appends a string to the current string data - - Arguments: - - pszSrc - the string to append - - Return Value: - - None - - --*/ - VOID - Append( - _In_z_ CONST _T* pszSrc - ) - { - *this += pszSrc; - } - - /*++ - - Routine Name: - - Insert - - Routine Description: - - Inserts a string to the current string data - - Arguments: - - cch - the index at which to insert the string - pszSrc - the string to insert - - Return Value: - - None - - --*/ - INT - Insert( - _In_ CONST INT& cch, - _In_z_ CONST _T* pszSrc - ) - { - if (cch >= 0 && - pszSrc != NULL) - { - _T* pszCurr = GetString(); - size_t cchCurr = StringLength(pszCurr); - - if (cchCurr >= static_cast(cch)) - { - size_t cchSrc = StringLength(pszSrc); - SetBufferSize(cchCurr + cchSrc); - - // - // Move the remainder of the string up by the length of the replacement - // this makes room to insert the replacement string - // - pszCurr += cch; - size_t cchToMove = StringLength(pszCurr) + 1; - MoveMemory(pszCurr + cchSrc, pszCurr, cchToMove * sizeof(_T)); - - // - // Fill the "gap" with the new string - // - CopyMemory(pszCurr, pszSrc, cchSrc * sizeof(_T)); - } - } - else - { - throw CXDException(E_INVALIDARG); - } - - return static_cast(StringLength(GetString())); - } - - /*++ - - Routine Name: - - IsEmpty - - Routine Description: - - Indicates whether the string is zero length - - Arguments: - - None - - Return Value: - - true - the string is empty - false - otherwise - - --*/ - bool - IsEmpty() CONST throw() - { - return GetLength() == 0; - } - - /*++ - - Routine Name: - - GetBuffer - - Routine Description: - - Returns the underlying string buffer - - Arguments: - - None - - Return Value: - - The underlying string buffer - - --*/ - _T* - GetBuffer() - { - return GetString(); - } - - /*++ - - Routine Name: - - Tokenize - - Routine Description: - - Retrieves the position of the next token in a string - - Arguments: - - pszTokens - string defining the token - cchStart - the point at which the token search should start. This value is updated - by the call to the posiion following the end character of the token. - - Return Value: - - Returns a CStringXDT object containing the token value. - - --*/ - CStringXDT<_T> - Tokenize( - _In_z_ CONST _T* pszTokens, - _Inout_ INT& cchStart - ) CONST - { - CStringXDT<_T> cstrResult; - - if (cchStart < 0) - { - throw CXDException(E_INVALIDARG); - } - - INT cchTokens = static_cast(StringLength(pszTokens)); - if (cchTokens == 0) - { - if (cchStart < GetLength()) - { - cstrResult = GetString() + cchStart; - } - else - { - // - // There are no tokens or data - // - cchStart = -1; - } - } - else - { - // - // Skip leading tokens - // - while (Find(pszTokens, cchStart) == cchStart) - { - cchStart += cchTokens; - } - - INT cchFirstToken = Find(pszTokens, cchStart); - - if (cchFirstToken > 0) - { - // - // The result string runs from the start to the first token - // - cstrResult = Mid(cchStart, cchFirstToken - cchStart); - cchStart = cchFirstToken + cchTokens; - } - else - { - if (cchStart < GetLength()) - { - // - // There are no more tokens but there is data left - // - cstrResult = GetString() + cchStart; - cchStart = GetLength() + cchTokens; - } - else - { - // - // There are no more tokens or data - // - cchStart = -1; - } - } - } - - return cstrResult; - } - - /*++ - - Routine Name: - - GetAt - - Routine Description: - - Retrieves character at the given index - - Arguments: - - cchAt - character count index of the character to return - - Return Value: - - The character value at the specified index - - --*/ - _T GetAt( - _In_ INT cchAt - ) CONST - { - if (cchAt < 0 || - cchAt > GetLength()) - { - throw CXDException(E_INVALIDARG); - } - - return GetString()[cchAt]; - } - - /*++ - - Routine Name: - - Trim - - Routine Description: - - Trims the string of leading and trailing white space - - Arguments: - - None - - Return Value: - - Reference to the trimmed CStringXDT object - - --*/ - CStringXDT<_T>& - Trim() - { - return TrimRight().TrimLeft(); - } - - /*++ - - Routine Name: - - TrimRight - - Routine Description: - - Trims the string of trailing white space - - Arguments: - - None - - Return Value: - - Reference to the trimmed CStringXDT object - - --*/ - CStringXDT<_T>& - TrimRight() - { - _T* pszFirstTrailing = NULL; - _T* pszData = GetString(); - while (*pszData != 0) - { - if (IsSpace(*pszData)) - { - if (pszFirstTrailing == NULL) - { - pszFirstTrailing = pszData; - } - } - else - { - pszFirstTrailing = NULL; - } - pszData++; - } - - if (pszFirstTrailing != NULL) - { - Truncate(static_cast(pszFirstTrailing - GetString())); - } - - return *this; - } - - /*++ - - Routine Name: - - Trim - - Routine Description: - - Trims the string of leading white space - - Arguments: - - None - - Return Value: - - Reference to the trimmed CStringXDT object - - --*/ - CStringXDT<_T>& - TrimLeft() - { - _T* pszData = GetString(); - - while (IsSpace(*pszData)) - { - pszData++; - } - - INT cchWhite = static_cast(pszData - GetString()); - if (cchWhite > 0) - { - Delete(0, cchWhite); - } - - return *this; - } - - /*++ - - Routine Name: - - Left - - Routine Description: - - Returns a CStringXDT object containing the string of the specified length - from the left of the string data - - Arguments: - - cchLeft - count of characters to return from the string data - - Return Value: - - The CStringXDT object containing the requested string - - --*/ - CStringXDT<_T> - Left( - _In_ INT cchLeft - ) CONST - { - if (cchLeft < 0) - { - cchLeft = 0; - } - - if (cchLeft > GetLength()) - { - return *this; - } - - return CStringXDT<_T>(GetString(), cchLeft); - } - - /*++ - - Routine Name: - - Mid - - Routine Description: - - Returns a CStringXDT object containing the string from the specified offset - to the end of the string data - - Arguments: - - cchFirst - the index of the character to start the string - - Return Value: - - The CStringXDT object containing the requested string - - --*/ - CStringXDT<_T> - Mid( - _In_ INT cchFirst - ) CONST - { - return Mid(cchFirst, GetLength() - cchFirst); - } - - /*++ - - Routine Name: - - Mid - - Routine Description: - - Returns a CStringXDT object containing the string from the specified offset - of the requested length - - Arguments: - - cchFirst - the index of the character to start the string - cchSize - the count of characters to compose the return string from - - Return Value: - - The CStringXDT object containing the requested string - - --*/ - CStringXDT<_T> - Mid( - _In_ INT cchFirst, - _In_ INT cchSize - ) CONST - { - INT cchCurr = GetLength(); - - if (cchFirst < 0 || - cchSize < 0 || - cchSize + cchFirst > cchCurr || - cchFirst > cchCurr) - { - throw CXDException(E_INVALIDARG); - } - - if (cchFirst == 0 && - cchSize == cchCurr) - { - return *this; - } - - return CStringXDT<_T>(GetString() + cchFirst, cchSize); - } - - /*++ - - Routine Name: - - MakeLower - - Routine Description: - - Makes all characters in the string lower case - - Arguments: - - None - - Return Value: - - Reference to the modified string object - - --*/ - CStringXDT<_T>& - MakeLower() - { - MakeLower(GetString(), GetBufferCharCount()); - return *this; - } - - /*++ - - Routine Name: - - Truncate - - Routine Description: - - Truncates the string data to the specified size - - Arguments: - - cchNew - the length to which the string data is to be truncated - - Return Value: - - None - - --*/ - VOID - Truncate( - INT cchNew - ) - { - if (cchNew < 0) - { - cchNew = 0; - } - - if (cchNew < GetLength()) - { - GetString()[cchNew] = 0; - } - } - - /*++ - - Routine Name: - - Preallocate - - Routine Description: - - Preallocate the string buffer to accomodate a string of length cChars - Note: this function adds one for the NULL terminator - - Arguments: - - cChars - the count of chars to allocate for - - Return Value: - - None - - --*/ - VOID - Preallocate( - INT cChars - ) - { - if (cChars < 0) - { - cChars = 0; - } - - SetBufferSize(static_cast(cChars) + 1); - } - - -private: - /*++ - - Routine Name: - - CreateString - - Routine Description: - - Creates a native string specifically from a WCHAR source string - - Arguments: - - pszSrc - the WCHAR source string - - Return Value: - - None - - --*/ - VOID - CreateString( - _In_z_ CONST WCHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateString(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateString - - Routine Description: - - Creates a native string specifically from a CHAR source string - - Arguments: - - pszSrc - the CHAR source string - - Return Value: - - None - - --*/ - VOID - CreateString( - _In_z_ CONST CHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateString(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateString - - Routine Description: - - Creates a snative tring from a native source string and character count - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateString( - _In_reads_(cchSrc) CONST _T* pszSrc, - _In_ size_t cchSrc - ) - { - if (pszSrc != NULL) - { - SetBufferSize(cchSrc); - CopyString(GetString(), GetBufferCharCount(), pszSrc, cchSrc); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type. - WCHAR specific implementation. - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_z_ CONST WCHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateStringFromY(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type and character count. - WCHAR specific implementation. - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_reads_(cchSrc) CONST WCHAR* pszSrc, - _In_ size_t cchSrc - ) - { - if (pszSrc != NULL && - cchSrc > 0) - { - SetBufferSize(cchSrc); - CopyYString(GetString(), GetBufferCharCount(), pszSrc, cchSrc); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type and a chacter count. - CHAR specific implementation. - - Arguments: - - pszSrc - the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_z_ CONST CHAR* pszSrc - ) - { - if (pszSrc != NULL) - { - CreateStringFromY(pszSrc, StringLength(pszSrc)); - } - } - - /*++ - - Routine Name: - - CreateStringFromY - - Routine Description: - - Creates a string from a source string of the opposite type. - CHAR specific implementation. - - Arguments: - - pszSrc - the source string - cchSrc - count of characters to copy from the source string - - Return Value: - - None - - --*/ - VOID - CreateStringFromY( - _In_reads_(cchSrc) CONST CHAR* pszSrc, - _In_ size_t cchSrc - ) - { - if (pszSrc != NULL && - cchSrc > 0) - { - SetBufferSize(cchSrc); - CopyYString(GetString(), GetBufferCharCount(), pszSrc, cchSrc); - } - } - - /*++ - - Routine Name: - - StringLength - - Routine Description: - - Returns the character count of the string. WCHAR specific. - - Arguments: - - pszSrc - source to string to retrieve the length of - - Return Value: - - The count of characters in the string - - --*/ - static size_t - StringLength( - _In_opt_z_ CONST WCHAR* pszSrc - ) - { - size_t cch = 0; - if( pszSrc != NULL ) - { - while( *pszSrc != 0 ) - { - cch++; - pszSrc++; - } - } - - return cch; - } - - /*++ - - Routine Name: - - StringLength - - Routine Description: - - Returns the character count of the string. CHAR specific. - - Arguments: - - pszSrc - source to string to retrieve the length of - - Return Value: - - The count of characters in the string - - --*/ - static size_t - StringLength( - _In_opt_z_ CONST CHAR* pszSrc - ) - { - size_t cch = 0; - - if( pszSrc != NULL ) - { - while( *pszSrc != 0 ) - { - cch++; - pszSrc++; - } - } - - return cch; - } - - /*++ - - Routine Name: - - GetBufferCharCount - - Routine Description: - - Gets the total count of available characters in the buffer. This is the length - of the buffer as opposed to the count of characters in the string (the buffer) - can be larger. - - Arguments: - - None - - Return Value: - - The count of available characters in the data buffer - - --*/ - size_t - GetBufferCharCount( - VOID - ) CONST - { - size_t cch = 0; - - if (m_pszData != NULL) - { - cch = *reinterpret_cast(reinterpret_cast(m_pszData) - sizeof(size_t)); - } - else - { - throw CXDException(E_PENDING); - } - - return cch; - } - - /*++ - - Routine Name: - - GetDataBuffer - - Routine Description: - - Retrieves the pointer to the start of the data buffer. The size of the - buffer is stored before the actual string data. - - Arguments: - - None - - Return Value: - - Pointer to the start of the data buffer - - --*/ - PVOID - GetDataBuffer( - VOID - ) CONST - { - PVOID pData = NULL; - - if (m_pszData != NULL) - { - pData = reinterpret_cast(reinterpret_cast(m_pszData) - sizeof(size_t)); - } - else - { - throw CXDException(E_PENDING); - } - - return pData; - } - - /*++ - - Routine Name: - - SetBufferSize - - Routine Description: - - Sets the size of the buffer according to the character count passed in. If - the character count is less than that available no action is required. If it - is larger the data buffer is doubled in size till it is sufficient. - - Arguments: - - cch - count of characters the buffer must accomodate - - Return Value: - - None - - --*/ - VOID - SetBufferSize( - size_t cch - ) CONST - { - if (m_pszData == NULL) - { - // - // Allocate a new buffer - // - size_t cchAllocate = CCH_INITIAL_BUFFER; - - // - // Double the buffer size till we have enough room - // - while (cch >= cchAllocate) - { - cchAllocate *= 2; - } - - LPVOID pData = HeapAlloc(GetProcessHeap(), 0, cchAllocate * sizeof(_T) + sizeof(size_t)); - - if (pData != NULL) - { - *static_cast(pData) = cchAllocate; - m_pszData = reinterpret_cast<_T*>(reinterpret_cast(pData) + sizeof(size_t)); - *m_pszData = 0; - } - else - { - throw CXDException(E_OUTOFMEMORY); - } - } - else - { - size_t cchAllocated = GetBufferCharCount(); - - if (cch >= cchAllocated) - { - // - // Double the buffer size till we have enough room - // - while (cch >= cchAllocated) - { - cchAllocated *= 2; - } - - // - // Re-allocate the existing buffer - // - LPVOID pData = HeapReAlloc(GetProcessHeap(), 0, GetDataBuffer(), cchAllocated * sizeof(_T) + sizeof(size_t)); - - if (pData != NULL) - { - *static_cast(pData) = cchAllocated; - m_pszData = reinterpret_cast<_T*>(reinterpret_cast(pData) + sizeof(size_t)); - } - else - { - throw CXDException(E_OUTOFMEMORY); - } - } - } - } - - /*++ - - Routine Name: - - CopyString - - Routine Description: - - Copys a native string from one buffer to another. WCHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyString( - _Inout_updates_(cchDst) WCHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST WCHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - hr = StringCchCopyNW(pszDst, cchDst, pszSrc, cchSrc); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CopyString - - Routine Description: - - Copys a native string from one buffer to another. CHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyString( - _Inout_updates_(cchDst) CHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST CHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - hr = StringCchCopyNA(pszDst, cchDst, pszSrc, cchSrc); - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CopyYString - - Routine Description: - - Copys a string of the opposite type from one buffer to another. CHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyYString( - _Inout_updates_(cchDst) CHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST WCHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - size_t cbWritten = WideCharToMultiByte(CP_ACP, - 0, - pszSrc, - static_cast(cchSrc), - pszDst, - static_cast(cchDst * sizeof(_T)), - NULL, - NULL); - - if (cbWritten == cchSrc && - cchSrc < cchDst) - { - pszDst[cchSrc] = 0; - } - else - { - ERR("Failed to convert wide char to multibyte string\n"); - throw CXDException(E_FAIL); - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CopyYString - - Routine Description: - - Copys a string of the opposite type from one buffer to another. WCHAR specific implementation. - - Arguments: - - pszDst - pointer to the destination buffer to copy to - cchDst - count of characters available in the destination buffer - pszSrc - pointer to the source buffer - cchSrc - count of characters to copy - - Return Value: - - None - - --*/ - static VOID - CopyYString( - _Inout_updates_(cchDst) WCHAR* pszDst, - _In_ size_t cchDst, - _In_reads_(cchSrc) CONST CHAR* pszSrc, - _In_ size_t cchSrc - ) - { - HRESULT hr = S_OK; - - if (cchDst < cchSrc) - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else if (pszDst == NULL) - { - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - pszSrc != NULL && - cchSrc > 0) - { - size_t cchWritten = MultiByteToWideChar(CP_ACP, - 0, - pszSrc, - static_cast(cchSrc), - pszDst, - static_cast(cchDst)); - - if (cchWritten == cchSrc && - cchSrc < cchDst) - { - pszDst[cchSrc] = 0; - } - else - { - ERR("Failed to convert multibyte to wide char string\n"); - throw CXDException(E_FAIL); - } - } - - if (FAILED(hr)) - { - throw CXDException(hr); - } - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case sensitive comparison of a native string with another - WCHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDString( - _In_z_ CONST WCHAR* psz, - _In_z_ CONST WCHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return wcscmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case sensitive comparison of a native string with another - CHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDString( - _In_z_ CONST CHAR* psz, - _In_z_ CONST CHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return strcmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case insensitive comparison of a native string with another - WCHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDStringNoCase( - _In_z_ CONST WCHAR* psz, - _In_z_ CONST WCHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return _wcsicmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - CompareXDString - - Routine Description: - - Case insensitive comparison of a native string with another - CHAR specific implementation. - - Arguments: - - psz - first string in comparison - pszCmp - second string in comparison - - Return Value: - - < 0 if the string data is less than the compare string - 0 if the strings are identical - > 0 if the string data is more than the compare string - - --*/ - static INT - CompareXDStringNoCase( - _In_z_ CONST CHAR* psz, - _In_z_ CONST CHAR* pszCmp - ) - { - if (pszCmp == NULL) - { - throw CXDException(E_FAIL); - } - - return _stricmp(psz, pszCmp); - } - - /*++ - - Routine Name: - - AllocSysString - - Routine Description: - - Allocates a system string from the string data. WCHAR specific implementation. - - Arguments: - - psz - The string to allocate from - - Return Value: - - The newly allocated BSTR - - --*/ - static BSTR - AllocSysString( - _In_z_ CONST WCHAR* psz - ) - { - BSTR bstr = ::SysAllocString(psz); - - if (bstr == NULL) - { - throw CXDException(E_OUTOFMEMORY); - } - - return bstr; - } - - /*++ - - Routine Name: - - AllocSysString - - Routine Description: - - Allocates a system string from the string data. CHAR specific implementation. - - Arguments: - - psz - The string to allocate from - - Return Value: - - The newly allocated BSTR - - --*/ - static BSTR - AllocSysString( - _In_z_ CONST CHAR* psz - ) - { - CStringXDW cstrWide(psz); - BSTR bstr = ::SysAllocString(cstrWide); - - if (bstr == NULL) - { - throw CXDException(E_OUTOFMEMORY); - } - - return bstr; - } - - /*++ - - Routine Name: - - Find - - Routine Description: - - Retrieves the location of a sub string in another string. This is the - CHAR spzecific implementation for native string type - - Arguments: - - pszSrc - string to search in - pszSub - sub string to search for - cchStart - starting point for the search - - Return Value: - - < 0 if the substring was not found - Otherwise, the location of the substring - - --*/ - static INT - Find( - _In_z_ CONST CHAR* pszSrc, - _In_z_ CONST CHAR* pszSub, - _In_ INT cchStart = 0 - ) throw() - { - INT cchIndex = -1; - size_t cchLen = StringLength(pszSrc); - - if (pszSrc != NULL && - pszSub != NULL && - cchStart >= 0 && - cchStart <= static_cast(cchLen)) - { - CHAR* psz = strstr(const_cast(pszSrc + cchStart), pszSub); - - if (psz != NULL) - { - cchIndex = static_cast(psz - pszSrc); - } - } - - return cchIndex; - } - - /*++ - - Routine Name: - - Find - - Routine Description: - - Retrieves the location of a sub string in another string. This is the - WCHAR spzecific implementation for native string type - - Arguments: - - pszSrc - string to search in - pszSub - sub string to search for - cchStart - starting point for the search - - Return Value: - - < 0 if the substring was not found - Otherwise, the location of the substring - - --*/ - static INT - Find( - _In_z_ CONST WCHAR* pszSrc, - _In_z_ CONST WCHAR* pszSub, - _In_ INT cchStart = 0 - ) throw() - { - INT cchIndex = -1; - size_t cchLen = StringLength(pszSrc); - - if (pszSrc != NULL && - pszSub != NULL && - cchStart >= 0 && - cchStart <= static_cast(cchLen)) - { - WCHAR* psz = wcsstr(const_cast(pszSrc + cchStart), pszSub); - - if (psz != NULL) - { - cchIndex = static_cast(psz - pszSrc); - } - } - - return cchIndex; - } - - /*++ - - Routine Name: - - Format - - Routine Description: - - Writes formatted data to the string. WCHAR specific implementation. - - Arguments: - - pszFormat - the format string - argList - Variable argument list - - Return Value: - - None - - --*/ - VOID - Format( - _In_z_ CONST WCHAR* pszFormat, - va_list argList - ) - { - INT cchFormatedLen = _vscwprintf(pszFormat, argList); - - if (cchFormatedLen >= 0) - { - SetBufferSize(cchFormatedLen); - vswprintf_s(GetString(), GetBufferCharCount(), pszFormat, argList); - } - else - { - throw CXDException(E_INVALIDARG); - } - } - - /*++ - - Routine Name: - - Format - - Routine Description: - - Writes formatted data to the string. CHAR specific implementation. - - Arguments: - - pszFormat - the format string - argList - Variable argument list - - Return Value: - - None - - --*/ - VOID - Format( - _In_z_ CONST CHAR* pszFormat, - va_list argList - ) - { - INT cchFormatedLen = _vscprintf(pszFormat, argList); - - if (cchFormatedLen >= 0) - { - SetBufferSize(cchFormatedLen); - vsprintf_s(GetString(), GetBufferCharCount(), pszFormat, argList); - } - else - { - throw CXDException(E_INVALIDARG); - } - } - - /*++ - - Routine Name: - - IsSpace - - Routine Description: - - Determinese if a character is white space character. WCHAR specific implementation. - - Arguments: - - szCandidate - candidate character value - - Return Value: - - true - if the character is a white space character - false - otherwise - - --*/ - static bool - IsSpace( - _In_ CONST WCHAR& szCandidate - ) - { - return iswspace(szCandidate) != 0; - } - - /*++ - - Routine Name: - - IsSpace - - Routine Description: - - Determinese if a character is white space character. CHAR specific implementation. - - Arguments: - - szCandidate - candidate character value - - Return Value: - - true - if the character is a white space character - false - otherwise - - --*/ - static bool - IsSpace( - _In_z_ CONST CHAR& szCandidate - ) - { - return isspace(szCandidate) != 0; - } - - /*++ - - Routine Name: - - MakeLower - - Routine Description: - - Converts all characters in the source string to lower case characters. - WCHAR specific implementation. - - Arguments: - - pszSrc - string to be converted - cchSrc - character count of the string - - Return Value: - - NULL if the conversion fails - Pointer to the converted string on success - - --*/ - static PWSTR - MakeLower( - PWSTR pszSrc, - size_t cchSrc - ) - { - PWSTR pszRet = NULL; - if (_wcslwr_s(pszSrc, cchSrc) == 0) - { - pszRet = pszSrc; - } - - return pszRet; - } - - /*++ - - Routine Name: - - MakeLower - - Routine Description: - - Converts all characters in the source string to lower case characters. - CHAR specific implementation. - - Arguments: - - pszSrc - string to be converted - cchSrc - character count of the string - - Return Value: - - NULL if the conversion fails - Pointer to the converted string on success - - --*/ - static PSTR - MakeLower( - PSTR pszSrc, - size_t cchSrc - ) - { - PSTR pszRet = NULL; - if (_strlwr_s(pszSrc, cchSrc) == 0) - { - pszRet = pszSrc; - } - - return pszRet; - } - - /*++ - - Routine Name: - - GetString - - Routine Description: - - Retrieves the underlying string. - - Arguments: - - None - - Return Value: - - The underlying string - - --*/ - _T*& - GetString( - VOID - ) CONST - { - if (m_pszData == NULL) - { - SetBufferSize(1); - } - - return m_pszData; - } - -private: - mutable _T* m_pszData; -}; - -typedef CStringXDT CStringXD; -typedef CStringXDT CStringXDW; -typedef CStringXDT CStringXDA; - diff --git a/print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp b/print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp deleted file mode 100644 index 00c4e905..00000000 --- a/print/XPSDrvSmpl/src/ui/bkdmptcnv.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkdmptcnv.cpp - -Abstract: - - Booklet/Binding devmode <-> PrintTicket conversion class implementation. The class - defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "bkdmptcnv.h" -#include "bkpchndlr.h" - -using XDPrintSchema::Binding::BindingData; -using XDPrintSchema::Binding::EBinding; -using XDPrintSchema::Binding::EBindingMin; -using XDPrintSchema::Binding::JobBindAllDocuments; -using XDPrintSchema::Binding::DocumentBinding; -using XDPrintSchema::Binding::EBindingMax; - -using XDPrintSchema::Binding::EBindingOption; -using XDPrintSchema::Binding::None; -using XDPrintSchema::Binding::BindLeft; -using XDPrintSchema::Binding::BindRight; -using XDPrintSchema::Binding::BindTop; -using XDPrintSchema::Binding::BindBottom; - -PCSTR g_pszBindFeature[EBindingMax] = { - "JobBindAllDocuments", - "DocumentBinding", -}; -static GPDStringToOption g_bindingTypeOption[] = { - {"None", None}, - {"BindLeft", BindLeft}, - {"BindRight", BindRight}, - {"BindTop", BindTop}, - {"BindBottom", BindBottom}, -}; -UINT g_cBindOption = sizeof(g_bindingTypeOption)/sizeof(GPDStringToOption); - -/*++ - -Routine Name: - - CBookletDMPTConv::CBookletDMPTConv - -Routine Description: - - CBookletDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletDMPTConv::CBookletDMPTConv() -{ -} - -/*++ - -Routine Name: - - CBookletDMPTConv::~CBookletDMPTConv - -Routine Description: - - CBookletDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CBookletDMPTConv::~CBookletDMPTConv() -{ -} - -/*++ - -Routine Name: - - CBookletDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the booklet data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to booklet data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ BookletSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings for both Job and Document binding - // - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax && SUCCEEDED(hr); - bindFeature = static_cast(bindFeature + 1)) - { - pDataSettings->settings[bindFeature].bindFeature = bindFeature; - hr = GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszBindFeature[bindFeature], - g_bindingTypeOption, - g_cBindOption, - pDataSettings->settings[bindFeature].bindOption); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the booklet data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the booklet data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ BookletSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the binding settings from the PrintTicket and set the options in - // the appropriate Job or Document equivalent in the BookletSettings structure - // - BindingData bindData; - CBookPTHandler bkPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = bkPTHndlr.GetData(&bindData))) - { - // - // Only update settings relevant to the feature - // - if (bindData.bindFeature < EBindingMax && - bindData.bindFeature >= EBindingMin) - { - pDataSettings->settings[bindData.bindFeature] = bindData; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // Binding setting not in the PT - make sure neither Job or - // Document binding are set in the outgoing data structure - // - pDataSettings->settings[JobBindAllDocuments].bindOption = None; - pDataSettings->settings[DocumentBinding].bindOption = None; - - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the booklet options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to booklet data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::SetPTDataInDM( - _In_ CONST BookletSettings& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - for (EBinding bindFeature = EBindingMin; - bindFeature < EBindingMax && SUCCEEDED(hr); - bindFeature = static_cast(bindFeature + 1)) - { - hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszBindFeature[bindFeature], - g_bindingTypeOption, - g_cBindOption, - dataSettings.settings[bindFeature].bindOption); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from booklet data structure. - -Arguments: - - dataSettings - Reference to booklet data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CBookletDMPTConv::SetPTDataInPT( - _In_ CONST BookletSettings& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CBookPTHandler bkPTHndlr(pPrintTicket); - BindingData bkData; - - // - // Preferentially set Job over Document - // - if (dataSettings.settings[JobBindAllDocuments].bindOption != None) - { - bkData.bindFeature = JobBindAllDocuments; - bkData.bindOption = dataSettings.settings[JobBindAllDocuments].bindOption; - } - else - { - bkData.bindFeature = DocumentBinding; - bkData.bindOption = dataSettings.settings[DocumentBinding].bindOption; - } - - // - // If the option is enabled set, otherwise delete it from the PT - // - if (bkData.bindOption != None) - { - hr = bkPTHndlr.SetData(&bkData); - } - else - { - hr = bkPTHndlr.Delete(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CBookletDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CBookletDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CBookPCHandler bookpcHandler(pPrintCapabilities); - bookpcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/bkdmptcnv.h b/print/XPSDrvSmpl/src/ui/bkdmptcnv.h deleted file mode 100644 index bd6640c9..00000000 --- a/print/XPSDrvSmpl/src/ui/bkdmptcnv.h +++ /dev/null @@ -1,84 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - bkdmptcnv.h - -Abstract: - - Booklet/Binding devmode <-> PrintTicket conversion class definition. The class - defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "bkpthndlr.h" - -// -// The PT handling code defines a single BindingData structure that covers both -// JobBindAllDocuments and DocumentBinding to avoid conflicts. The GPD however -// controls both so we re-use the BindingData structure to handle both in -// the DevMode -// -struct BookletSettings -{ - XDPrintSchema::Binding::BindingData settings[XDPrintSchema::Binding::EBindingMax]; -}; - -class CBookletDMPTConv : public CFeatureDMPTConvert -{ -public: - CBookletDMPTConv(); - - ~CBookletDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ BookletSettings* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ BookletSettings* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST BookletSettings& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST BookletSettings& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; diff --git a/print/XPSDrvSmpl/src/ui/colctrls.cpp b/print/XPSDrvSmpl/src/ui/colctrls.cpp deleted file mode 100644 index acffdada..00000000 --- a/print/XPSDrvSmpl/src/ui/colctrls.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colctrls.cpp - -Abstract: - - Implementation of the color management specific UI controls. These are the - combo box used to select the PageColorManagement option, a list box - for selecting the PageSourceColorProfile option and a combo box for - selecting the PageSourceColorProfile option. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "resource.h" -#include "colctrls.h" - -PCSTR CUICtrlPageColManCombo::m_pszPageColManName = "PageColorManagement"; -PCSTR CUICtrlColProfList::m_pszDestColProf = "PageSourceColorProfile"; -PCSTR CUICtrlPageColIntentCombo::m_pszPageIntentName = "PageICMRenderingIntent"; - -#define DRIVER_COL_MAN_SEL 2 - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::CUICtrlPageColManCombo - -Routine Description: - - CUICtrlPageColManCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColManCombo::CUICtrlPageColManCombo() : - CUICtrlDefaultCombo(m_pszPageColManName, IDC_COMBO_COL_MANAGE) -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::~CUICtrlPageColManCombo - -Routine Description: - - CUICtrlPageColManCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColManCombo::~CUICtrlPageColManCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlPageColManCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_DEVICE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_DRIVER))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SYSTEM); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlPageColManCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlPageColManCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TEXT_COLPROF), E_HANDLE))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_LIST_COLPROF), E_HANDLE)))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_COL_INTENT), E_HANDLE)))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_COL_INTENT), E_HANDLE)))) - { - EnableWindow(hWnd, lSel == DRIVER_COL_MAN_SEL); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlColProfList::CUICtrlColProfList - -Routine Description: - - CUICtrlColProfList class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColProfList::CUICtrlColProfList() : - CUICtrlDefaultList(m_pszDestColProf, IDC_LIST_COLPROF) -{ -} - -/*++ - -Routine Name: - - CUICtrlColProfList::~CUICtrlColProfList - -Routine Description: - - CUICtrlColProfList class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColProfList::~CUICtrlColProfList() -{ -} - -/*++ - -Routine Name: - - CUICtrlColProfList::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the list - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlColProfList::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_CMYK))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SCRGB); - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CUICtrlPageColIntentCombo::CUICtrlPageColIntentCombo - -Routine Description: - - CUICtrlPageColIntentCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColIntentCombo::CUICtrlPageColIntentCombo() : - CUICtrlDefaultCombo(m_pszPageIntentName, IDC_COMBO_COL_INTENT) -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColIntentCombo::~CUICtrlPageColIntentCombo - -Routine Description: - - CUICtrlPageColIntentCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlPageColIntentCombo::~CUICtrlPageColIntentCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlPageColIntentCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlPageColIntentCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_ABSCOLINTENT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RELCOLINTENT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_PHOTOINTENT))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BIZINTENT); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/colctrls.h b/print/XPSDrvSmpl/src/ui/colctrls.h deleted file mode 100644 index 90ebd21c..00000000 --- a/print/XPSDrvSmpl/src/ui/colctrls.h +++ /dev/null @@ -1,83 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colctrls.h - -Abstract: - - Definition of the color management specific UI controls. These are the - combo box used to select the PageColorManagement option, a list box - for selecting the PageSourceColorProfile option and a combo box for - selecting the PageSourceColorProfile option. - ---*/ - -#pragma once - -#include "uictrl.h" - -class CUICtrlPageColManCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlPageColManCombo(); - - virtual ~CUICtrlPageColManCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszPageColManName; -}; - -class CUICtrlColProfList : public CUICtrlDefaultList -{ -public: - CUICtrlColProfList(); - - virtual ~CUICtrlColProfList(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszDestColProf; -}; - -class CUICtrlPageColIntentCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlPageColIntentCombo(); - - virtual ~CUICtrlPageColIntentCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszPageIntentName; -}; - diff --git a/print/XPSDrvSmpl/src/ui/coldmptcnv.cpp b/print/XPSDrvSmpl/src/ui/coldmptcnv.cpp deleted file mode 100644 index 3d20af57..00000000 --- a/print/XPSDrvSmpl/src/ui/coldmptcnv.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - coldmptcnv.cpp - -Abstract: - - PageSourceColorProfile devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "cmprofpchndlr.h" -#include "coldmptcnv.h" - -using XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData; -using XDPrintSchema::PageSourceColorProfile::EProfileOption; -using XDPrintSchema::PageSourceColorProfile::RGB; -using XDPrintSchema::PageSourceColorProfile::CMYK; - -PCWSTR g_pszCMYKProfileName = L"xdCMYKPrinter.icc"; -PCWSTR g_pszRGBProfileName = L"xdwscRGB.icc"; -PCSTR g_pszColProfFeature = "PageSourceColorProfile"; -static GPDStringToOption g_colProfTypeOption[] = { - {"CMYK", CMYK}, - {"scRGB", RGB}, -}; -UINT g_cColProfOption = sizeof(g_colProfTypeOption)/sizeof(GPDStringToOption); - -/*++ - -Routine Name: - - CColorProfileDMPTConv::CColorProfileDMPTConv - -Routine Description: - - CColorProfileDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorProfileDMPTConv::CColorProfileDMPTConv() -{ -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::~CColorProfileDMPTConv - -Routine Description: - - CColorProfileDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorProfileDMPTConv::~CColorProfileDMPTConv() -{ -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the color profile data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to color profile data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ PageSourceColorProfileData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Defer setting up the profile file names until we write to the PT - // as they only have meaning at that point - // - if (SUCCEEDED(hr)) - { - GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszColProfFeature, - g_colProfTypeOption, - g_cColProfOption, - pDataSettings->cmProfile); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the color profile data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the color profile data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ PageSourceColorProfileData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - PageSourceColorProfileData profData; - CColorManageProfilePTHandler profPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = profPTHndlr.GetData(&profData))) - { - pDataSettings->cmProfile = profData.cmProfile; - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // The property is not in the PT. This is not an error - reset hresult - // and continue - // - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the color profile options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to color profile data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::SetPTDataInDM( - _In_ CONST PageSourceColorProfileData& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszColProfFeature, - g_colProfTypeOption, - g_cColProfOption, - dataSettings.cmProfile); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from color profile data structure. - -Arguments: - - dataSettings - Reference to color profile data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorProfileDMPTConv::SetPTDataInPT( - _In_ CONST PageSourceColorProfileData& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CColorManageProfilePTHandler cmProfPTHndlr(pPrintTicket); - PageSourceColorProfileData profData; - profData.cmProfile = dataSettings.cmProfile; - - // - // Ensure profile file names are set from the enumerated type - // - if (profData.cmProfile == CMYK) - { - profData.cmProfileName = g_pszCMYKProfileName; - } - else - { - profData.cmProfileName = g_pszRGBProfileName; - } - - hr = cmProfPTHndlr.SetData(&profData); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CColorProfileDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CColorProfileDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CColorManageProfilePCHandler cmProfPCHandler(pPrintCapabilities); - cmProfPCHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/coldmptcnv.h b/print/XPSDrvSmpl/src/ui/coldmptcnv.h deleted file mode 100644 index 0c890758..00000000 --- a/print/XPSDrvSmpl/src/ui/coldmptcnv.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - coldmptcnv.h - -Abstract: - - PageSourceColorProfile devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "cmprofpthndlr.h" -#include "cmprofiledata.h" - -class CColorProfileDMPTConv : - public CFeatureDMPTConvert -{ -public: - CColorProfileDMPTConv(); - - virtual ~CColorProfileDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST XDPrintSchema::PageSourceColorProfile::PageSourceColorProfileData& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/colppg.cpp b/print/XPSDrvSmpl/src/ui/colppg.cpp deleted file mode 100644 index 24e9eb35..00000000 --- a/print/XPSDrvSmpl/src/ui/colppg.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colppg.cpp - -Abstract: - - Implementation of the color management property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "resource.h" -#include "colppg.h" -#include "colctrls.h" - -/*++ - -Routine Name: - - CColorPropPage::CColorPropPage - -Routine Description: - - CColorPropPage class constructor. - Creates a handler class object for every control on the color profile property page. - Each of these handlers is stored in a collection. - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CColorPropPage::CColorPropPage() -{ - HRESULT hr = S_OK; - - try - { - CUIControl* pControl = new(std::nothrow) CUICtrlPageColManCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_COL_MANAGE, pControl); - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlColProfList(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_LIST_COLPROF, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlPageColIntentCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_COL_INTENT, pControl); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - if (FAILED(hr)) - { - DestroyUIComponents(); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CColorPropPage::~CColorPropPage - -Routine Description: - - CColorPropPage class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CColorPropPage::~CColorPropPage() -{ -} - -/*++ - -Routine Name: - - CColorPropPage::InitDlgBox - -Routine Description: - - Provides the base class with the data required to intialise the dialog box. - -Arguments: - - ppszTemplate - Pointer to dialog box template to be intialised. - ppszTitle - Pointer to dialog box title to be intialised. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CColorPropPage::InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppszTemplate, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(ppszTitle, E_POINTER))) - { - *ppszTemplate = MAKEINTRESOURCE(IDD_COL_MANAGE); - *ppszTitle = MAKEINTRESOURCE(IDS_COLMAN); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/colppg.h b/print/XPSDrvSmpl/src/ui/colppg.h deleted file mode 100644 index 76fff12d..00000000 --- a/print/XPSDrvSmpl/src/ui/colppg.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - colppg.h - -Abstract: - - Definition of the color management property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#pragma once - -#include "precomp.h" -#include "docppg.h" - -class CColorPropPage : public CDocPropPage -{ -public: - CColorPropPage(); - - virtual ~CColorPropPage(); - - HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/devmode.h b/print/XPSDrvSmpl/src/ui/devmode.h deleted file mode 100644 index c5e74fbc..00000000 --- a/print/XPSDrvSmpl/src/ui/devmode.h +++ /dev/null @@ -1,82 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - devmode.h - -Abstract: - - Definition of the OEM devmode structure. - ---*/ - -#pragma once - - -//////////////////////////////////////////////////////// -// OEM Devmode Defines -//////////////////////////////////////////////////////// - -#define MAX_WATERMARK_TEXT 24 - -//////////////////////////////////////////////////////// -// OEM Devmode Type Definitions -//////////////////////////////////////////////////////// - -// -//Can add info to the private devmode bellow here. -//Note : -// This structure must be prefixed by OEM_DMEXTRAHEADER -// Your plug-in must implement the IPrintOemUI::DevMode method -// -typedef struct tagOEMDEV -{ - OEM_DMEXTRAHEADER dmOEMExtra; - - // - //Private DevMode Members - // - - // - // Page Scaling Members - // - - DWORD dwPgScaleX; - DWORD dwPgScaleY; - INT iPgOffsetX; - INT iPgOffsetY; - - // - // Watermark Members - // - INT iWMTransparency; - INT iWMAngle; - INT iWMOffsetX; - INT iWMOffsetY; - - // - // Text Watermark Members - // - INT iWMFontSize; - DWORD dwColText; - TCHAR strWMText[MAX_WATERMARK_TEXT]; - - // - // Bitmap / Vector Members - // - INT iWMWidth; - INT iWMHeight; - -} OEMDEV, *POEMDEV; - -typedef CONST OEMDEV *PCOEMDEV; - diff --git a/print/XPSDrvSmpl/src/ui/dllentry.cpp b/print/XPSDrvSmpl/src/ui/dllentry.cpp deleted file mode 100644 index 47c8a728..00000000 --- a/print/XPSDrvSmpl/src/ui/dllentry.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - dllentry.cpp - -Abstract: - - Implementation of the UI plugin dllentry points. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdsmplcf.h" - -/*++ - -Routine Name: - - DllMain - -Routine Description: - - Entry point into the dynamic-link library (DLL). - Called by the system when processes and threads are initialized and terminated, - or upon calls to the LoadLibrary and FreeLibrary functions. - -Arguments: - - hInst - Handle to the DLL module. - wReason - Indicates why the DLL entry-point function is being called. - -Return Value: - - TRUE - ---*/ -BOOL WINAPI -DllMain( - _In_ HINSTANCE hInst, - _In_ WORD wReason, - _In_opt_ LPVOID - ) -{ - switch (wReason) - { - case DLL_PROCESS_ATTACH: - { - g_hInstance = hInst; - } - break; - } - - return TRUE; -} - -/*++ - -Routine Name: - - DllCanUnloadNow - -Routine Description: - - Determines whether the DLL is in use. - If not, the caller can unload the DLL from memory. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - Dll can unload - S_FALSE - Dll can't unload - ---*/ -STDAPI -DllCanUnloadNow() -{ - if (g_cServerLocks == 0) - { - return S_OK ; - } - else - { - return S_FALSE; - } -} - -/*++ - -Routine Name: - - DllGetClassObject - -Routine Description: - - Retrieves the class objects for the DLL. - Supported class ids are CLSID_OEMUI and CLSID_OEMPTPROVIDER. - Called from within the CoGetClassObject function. - -Arguments: - - rclsid - CLSID that will associate the correct data and code. - riid - Reference to the identifier of the interface that the caller is to use to communicate with the class object. - ppv - Address of pointer variable that receives the interface pointer requested in riid. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - CLASS_E_CLASSNOTAVAILABLE - On unsupported class - ---*/ -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID FAR* ppv - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppv, E_POINTER))) - { - *ppv = NULL; - - // - // Make sure the appropriate CLSID is being requested - // - if (rclsid == CLSID_OEMUI || - rclsid == CLSID_OEMPTPROVIDER) - { - CXDSmplUICF* pXDSmplUICF = new(std::nothrow) CXDSmplUICF(); - hr = CHECK_POINTER(pXDSmplUICF, E_OUTOFMEMORY); - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface. - // - hr = pXDSmplUICF->QueryInterface(riid, ppv); - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pXDSmplUICF->Release(); - } - } - else - { - hr = CLASS_E_CLASSNOTAVAILABLE; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/docppg.cpp b/print/XPSDrvSmpl/src/ui/docppg.cpp deleted file mode 100644 index c297741a..00000000 --- a/print/XPSDrvSmpl/src/ui/docppg.cpp +++ /dev/null @@ -1,1314 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - docppg.cpp - -Abstract: - - Implementation of the document property page class. This is an abstract - class that provides common functionality for all property pages including - accessors and the dialog proc. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "docppg.h" - -/*++ - -Routine Name: - - CDocPropPage::CDocPropPage - -Routine Description: - - CDocPropPage class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CDocPropPage::CDocPropPage() : - m_hPage(NULL), - m_hComPropSheet(NULL), - m_pOemCUIPParam(NULL), - m_pfnComPropSheet(NULL), - m_pDriverUIHelp(NULL), - m_pUIProperties(NULL) -{ -} - -/*++ - -Routine Name: - - CDocPropPage::~CDocPropPage - -Routine Description: - - CDocPropPage class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CDocPropPage::~CDocPropPage() -{ - HRESULT hr = S_OK; - hr = DestroyUIComponents(); - - ASSERTMSG(SUCCEEDED(hr), "Error Deleting Property Pages/n"); -} - -/*++ - -Routine Name: - - CDocPropPage::PropPageInit - -Routine Description: - - Adds an additional Feature property page to the existing Unidrv supplied property pages. - Called from the Unidrv UI Plug-in entry point for DocumentPropertySheets(), - on the PROPSHEETUI_REASON_INIT message. - - This base class implementation provides common property page intialisation functionality for - all property pages. Derived property page classes are required to provide the dialog box template - and the dialog box title. - -Arguments: - - pPSUIInfo - Pointer to a PPROPSHEETUI_INFO structure. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::PropPageInit( - _In_ CONST PPROPSHEETUI_INFO pPSUIInfo - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - // - // Only proceed if we have effectively published the helper interfaces to the UI - // control objects. - // - // We also need to retrieve the dialog template resource and dialog title from the - // derived property page class. - // - PROPSHEETPAGE page = {0}; - if (SUCCEEDED(hr = PublishHelpToControls()) && - SUCCEEDED(hr = InitDlgBox(&page.pszTemplate, &page.pszTitle))) - { - page.dwSize = sizeof(PROPSHEETPAGE); - page.dwFlags = PSP_DEFAULT | PSP_USETITLE; - page.hInstance = g_hInstance; - - page.pfnDlgProc = CDocPropPage::DlgProc; - page.lParam = reinterpret_cast(this); - - pPSUIInfo->Result = pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet, - CPSFUNC_ADD_PROPSHEETPAGE, - reinterpret_cast(&page), - 0); - - if (SUCCEEDED(hr = SetComPropSheetFunc(pPSUIInfo->pfnComPropSheet)) && - SUCCEEDED(hr = SetPageHandle(reinterpret_cast(pPSUIInfo->Result)))) - { - hr = SetComPropSheetHandle(pPSUIInfo->hComPropSheet); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::StoreThis - -Routine Description: - - Stores a pointer to this instance of the CDocPropPage class - that will be associated with the windows handle provided. - -Arguments: - - hDlg - Handle of the property page window associated with this class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::StoreThis( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - if (!SetProp(hDlg, MAKEINTATOM(ID_XDSMPL_DLG_ATOM), reinterpret_cast(this))) - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::RetrieveThis - -Routine Description: - - Obtains the instance of the CDocPropPage class that is associated with a windows handle. - -Arguments: - - hDlg - Handle of the property page Window associated with this class. - pDocPropPage - Address of a pointer to be filled out with the instance of this class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ - -HRESULT -CDocPropPage::RetrieveThis( - _In_ CONST HWND hDlg, - _Outptr_ CDocPropPage** pDocPropPage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hDlg, E_HANDLE)) && - SUCCEEDED(hr = CHECK_POINTER(pDocPropPage, E_POINTER))) - { - *pDocPropPage = reinterpret_cast(GetProp(hDlg, MAKEINTATOM(ID_XDSMPL_DLG_ATOM))); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::RemoveThis - -Routine Description: - - Removes the class pointer from the associated windows handle. - -Arguments: - - hDlg - Handle of the property page Window associated with this class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::RemoveThis( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hDlg, E_HANDLE))) - { - RemoveProp(hDlg, MAKEINTATOM(ID_XDSMPL_DLG_ATOM)); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetComPropSheetFunc - -Routine Description: - - Store the pointer to the PFNCOMPROPSHEET function. - -Arguments: - - pfnComPropSheet - pointer to the PFNCOMPROPSHEET function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetComPropSheetFunc( - _In_ CONST PFNCOMPROPSHEET pfnComPropSheet - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(pfnComPropSheet != NULL, "NULL pointer to common propert sheet functions.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(pfnComPropSheet, E_POINTER))) - { - m_pfnComPropSheet = pfnComPropSheet; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetPageHandle - -Routine Description: - - Store the handle of a property page window. - -Arguments: - - hPage - Handle of a property page window. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetPageHandle( - _In_ CONST HANDLE hPage - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hPage, E_HANDLE))) - { - m_hPage = hPage; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetComPropSheetHandle - -Routine Description: - - Store the handle of the Common Property Sheet window. - -Arguments: - - hComPropSheet - Handle of the common property sheet window. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetComPropSheetHandle( - _In_ CONST HANDLE hComPropSheet - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_HANDLE(hComPropSheet, E_HANDLE))) - { - m_hComPropSheet = hComPropSheet; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::GetComPropSheetFunc - -Routine Description: - - Retrieve the pointer of the PFNCOMPROPSHEET function. - -Arguments: - - ppfnComPropSheet - Address of a pointer that will be filled out with the PFNCOMPROPSHEET function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::GetComPropSheetFunc( - _Outptr_ PFNCOMPROPSHEET* ppfnComPropSheet - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppfnComPropSheet, E_POINTER))) - { - *ppfnComPropSheet = m_pfnComPropSheet; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::GetPageHandle - -Routine Description: - - Retrieves the property page handle. - -Arguments: - - None - -Return Value: - - Handle to the property page - ---*/ -HANDLE -CDocPropPage::GetPageHandle( - VOID - ) -{ - return m_hPage; -} - -/*++ - -Routine Name: - - CDocPropPage::GetComPropSheetHandle - -Routine Description: - - Retrieves the common property sheet handle - -Arguments: - - None - -Return Value: - - Handle to the common property sheet - ---*/ -HANDLE -CDocPropPage::GetComPropSheetHandle( - VOID - ) -{ - return m_hComPropSheet; -} - -/*++ - -Routine Name: - - CDocPropPage::DestroyUIComponents - -Routine Description: - - Destroy all control handler classes that have been added into the collection. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::DestroyUIComponents( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - UIControlMap::iterator iterUIComponents = m_UIControls.begin(); - - while (iterUIComponents != m_UIControls.end()) - { - if (iterUIComponents->second != NULL) - { - delete iterUIComponents->second; - iterUIComponents->second = NULL; - } - iterUIComponents++; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::AddUIControl - -Routine Description: - - Adds a control handler class into the collection. - -Arguments: - - iCtrlID - Resource Identifier of control. - pUIControl - Pointer to a control handler class. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::AddUIControl( - _In_ CONST INT iCtrlID, - _In_ CUIControl* pUIControl - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIControl, E_POINTER))) - { - try - { - m_UIControls[iCtrlID] = pUIControl; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::GetUIComponents - -Routine Description: - - Obtains the collection of control handlers. - -Arguments: - - ppUIComponents - Address of the pointer that will be filled out with the contain handler collection. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::GetUIComponents( - _Outptr_ UIControlMap** ppUIComponents - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppUIComponents, E_POINTER))) - { - *ppUIComponents = &m_UIControls; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetOemCUIPParam - -Routine Description: - - Store the pointer to the POEMCUIPPARAM function. - -Arguments: - - pOemCUIPParam - pointer to the POEMCUIPPARAM function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER))) - { - m_pOemCUIPParam = pOemCUIPParam; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetUIProperties - -Routine Description: - - Store the pointer to an CUIProperties interface. - -Arguments: - - pUIProperties - pointer to an CUIProperties interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetUIProperties( - _In_ CUIProperties* pUIProperties - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIProperties, E_POINTER))) - { - m_pUIProperties = pUIProperties; - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CDocPropPage::GetOemCUIPParam - -Routine Description: - - Retrieve the pointer to the OEMCUIPPARAM function. - -Arguments: - - ppOemCUIPParam - Address of a pointer that will be filled out with the POEMCUIPPARAM function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::GetOemCUIPParam( - _Outptr_ POEMCUIPPARAM* ppOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppOemCUIPParam, E_POINTER))) - { - *ppOemCUIPParam = m_pOemCUIPParam; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SetPrintOemDriverUI - -Routine Description: - - Store a pointer to the IPrintOemDriverUI interface. - -Arguments: - - pOEMDriverUI - pointer to the IPrintOemDriverUI interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOEMDriverUI, E_POINTER))) - { - m_pDriverUIHelp = const_cast(pOEMDriverUI); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::PublishHelpToControls - -Routine Description: - - Propagate any useful interfaces used in this class down to the collection of control handlers. - This allows access to these helper interfaces in the control handlers classes. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::PublishHelpToControls( - VOID - ) -{ - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to CUIProperties.\n"); - - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING))) - { - try - { - // - // Iterate over all controls and report the helper interfaces - // - if (!m_UIControls.empty()) - { - UIControlMap::iterator iterUIComponents = m_UIControls.begin(); - - while (iterUIComponents != m_UIControls.end()) - { - CUIControl* pControl = iterUIComponents->second; - - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER)) && - SUCCEEDED(hr = pControl->SetPrintOemDriverUI(m_pDriverUIHelp)) && - SUCCEEDED(hr = pControl->SetUIProperties(m_pUIProperties)) && - SUCCEEDED(hr = pControl->SetOemCUIPParam(m_pOemCUIPParam))) - { - iterUIComponents++; - } - } - - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendCommand - -Routine Description: - - Call the OnCommand() method in the relevant control handler in the collection. - -Arguments: - - hDlg - Handle of property page. - wParam - Windows WPARAM value passed with the windows message WM_COMMAND. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendCommand( - _In_ CONST HWND hDlg, - _In_ CONST WPARAM wParam - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control that generated the command - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - CUIControl* pControl = (*pComponents)[LOWORD(wParam)]; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - hr = pControl->OnCommand(hDlg, HIWORD(wParam)); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendNotify - -Routine Description: - - Call the OnNotify() method in the relevant control handler in the collection. - -Arguments: - - hDlg - Handle of property page. - pNMhdr - Windows Notify structure that was passed with the windows message WM_NOTIFY. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNMhdr - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control of an activation - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - CUIControl* pControl = (*pComponents)[pNMhdr->idFrom]; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - hr = pControl->OnNotify(hDlg, pNMhdr); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendSetActive - -Routine Description: - - Call the OnActivate() method in all control handlers in the collection. - -Arguments: - - hDlg - Handle of property page. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendSetActive( - _In_ CONST HWND hDlg - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control of an activation - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - UIControlMap::iterator iterUIComponents = pComponents->begin(); - - while (iterUIComponents != pComponents->end()) - { - CUIControl* pControl = iterUIComponents->second; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - if (FAILED(hr = pControl->OnActivate(hDlg))) - { - break; - } - } - - iterUIComponents++; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::SendInit - -Routine Description: - - Call the OnInit() method in all control handlers in the collection. - -Arguments: - - hDlg - Handle of property page. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CDocPropPage::SendInit( - _In_ CONST HWND hDlg - ) -{ - // - // Use the wParam as the index into the control map and - // inform the control of an activation - // - HRESULT hr = S_OK; - - UIControlMap* pComponents = NULL; - - if (SUCCEEDED(hr = GetUIComponents(&pComponents)) && - SUCCEEDED(hr = CHECK_POINTER(pComponents, E_POINTER))) - { - try - { - UIControlMap::iterator iterUIComponents = pComponents->begin(); - - while (iterUIComponents != pComponents->end()) - { - CUIControl* pControl = iterUIComponents->second; - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_POINTER))) - { - if (FAILED(hr = pControl->OnInit(hDlg))) - { - break; - } - } - - iterUIComponents++; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CDocPropPage::DlgProc - -Routine Description: - - Dialog proccedure for the property page. - This handles all windows messages that are sent to the property page. - -Arguments: - - hDlg - Handle of the property page. - uiMessage - Specifies the message. - wParam - Specifies additional message-specific information. - lParam - Specifies additional message-specific information. - -Return Value: - - The return value is the result of the message processing and depends on the message sent. - ---*/ -INT_PTR CALLBACK -CDocPropPage::DlgProc( - _In_ CONST HWND hDlg, - _In_ CONST UINT uiMessage, - _In_ CONST WPARAM wParam, - _In_ CONST LPARAM lParam - ) -{ - HRESULT hr = S_OK; - BOOL retVal = FALSE; - - switch (uiMessage) - { - case WM_INITDIALOG: - { - // - // Store the class instance - // - PROPSHEETPAGE* pPage = reinterpret_cast(lParam); - - if (SUCCEEDED(hr = CHECK_POINTER(pPage, E_POINTER))) - { - if (pPage->lParam != NULL) - { - CDocPropPage* thisInst = reinterpret_cast(pPage->lParam); - - if (SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - if (SUCCEEDED(hr = thisInst->StoreThis(hDlg))) - { - hr = thisInst->SendInit(hDlg); - } - } - } - else - { - hr = E_FAIL; - } - } - - // - // Set the keyboard focus to the control specified by wParam - // - retVal = TRUE; - } - break; - - case WM_COMMAND: - { - switch (HIWORD(wParam)) - { - case EN_CHANGE: - case BN_CLICKED: - case CBN_SELCHANGE: - // case LBN_SELCHANGE: CBN_SELCHANGE=LBN_SELCHANGE - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst))) - { - if (SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->SendCommand(hDlg, wParam); - } - } - - // - // Set to FALSE to indiate that the message has been handled. - // - retVal = FALSE; - } - break; - - default: - { - // - // Unhandled command so return TRUE - // - retVal = TRUE; - } - break; - } - } - break; - - case WM_NOTIFY: - { - NMHDR* pHdr = reinterpret_cast(lParam); - if (SUCCEEDED(hr = CHECK_POINTER(pHdr, E_POINTER))) - { - switch (pHdr->code) - { - case PSN_SETACTIVE: - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->SendSetActive(hDlg); - } - - // - // Return FALSE to accept the page activation - // - retVal = FALSE; - } - break; - - case PSN_KILLACTIVE: - { - // - // Return FALSE to allow the page to lose activation - // - retVal = FALSE; - } - break; - - case PSN_APPLY: - { - PFNCOMPROPSHEET pfnComPropSheet = NULL; - - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL)) && - SUCCEEDED(hr = thisInst->GetComPropSheetFunc(&pfnComPropSheet)) && - SUCCEEDED(hr = CHECK_POINTER(pfnComPropSheet, E_FAIL))) - { - // - // Ensure that the last error is in a known state. - // - SetLastError(0); - - // - // We do not need to validate any settings so set PSNRET_NOERROR - // - if (SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR) == 0) - { - // - // A return value of 0 does not necessarily indicate a failure. - // - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - if (SUCCEEDED(hr)) - { - // - // We have applied the change... - // - PropSheet_UnChanged(GetParent(hDlg), hDlg); - - // - // Inform the propsheet - // - pfnComPropSheet(thisInst->GetComPropSheetHandle(), - CPSFUNC_SET_RESULT, - reinterpret_cast(thisInst->GetPageHandle()), - (LPARAM)CPSUI_OK); - } - } - - retVal = TRUE; - } - break; - - case UDN_DELTAPOS: - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->SendNotify(hDlg, pHdr); - } - - // - // Set return to FALSE to allow the control value - // - retVal = FALSE; - } - break; - } - } - } - break; - - case WM_NCDESTROY: - { - CDocPropPage* thisInst; - - if (SUCCEEDED(hr = CDocPropPage::RetrieveThis(hDlg, &thisInst)) && - SUCCEEDED(hr = CHECK_POINTER(thisInst, E_FAIL))) - { - hr = thisInst->RemoveThis(hDlg); - } - - // - // Set return to FALSE to indicate that the message was processed - // - retVal = FALSE; - } - break; - } - - ERR_ON_HR(hr); - return retVal; -} - diff --git a/print/XPSDrvSmpl/src/ui/docppg.h b/print/XPSDrvSmpl/src/ui/docppg.h deleted file mode 100644 index 1a6d1dc5..00000000 --- a/print/XPSDrvSmpl/src/ui/docppg.h +++ /dev/null @@ -1,186 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - docppg.h - -Abstract: - - Definition of the document property page class. This is an abstract - class that provides common functionality for all property pages including - accessors and the dialog proc. - ---*/ - -#pragma once - -#include "uictrl.h" - -#define ID_XDSMPL_DLG_ATOM 1000 - -typedef std::map UIControlMap; - -class CDocPropPage -{ -public: - CDocPropPage(); - - virtual ~CDocPropPage(); - - virtual HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) = 0; - - // - // Implementation - // - virtual HRESULT - PropPageInit( - _In_ CONST PPROPSHEETUI_INFO pPSUIInfo - ); - - virtual HRESULT - SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ); - - virtual HRESULT - SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIParam - ); - - virtual HRESULT - SetUIProperties( - _In_ CUIProperties* pUIProperties - ); - - static INT_PTR CALLBACK - DlgProc( - _In_ HWND hDlg, - _In_ UINT uiMessage, - _In_ WPARAM wParam, - _In_ LPARAM lParam - ); - -protected: - HRESULT - StoreThis( - _In_ CONST HWND hDlg - ); - - static HRESULT - RetrieveThis( - _In_ CONST HWND hDlg, - _Outptr_ CDocPropPage** pDocPropPage - ); - - HRESULT - RemoveThis( - _In_ CONST HWND hDlg - ); - - HRESULT - SetComPropSheetFunc( - _In_ CONST PFNCOMPROPSHEET pfnComPropSheet - ); - - HRESULT - SetPageHandle( - _In_ CONST HANDLE hPage - ); - - HRESULT - SetComPropSheetHandle( - _In_ CONST HANDLE hComPropSheet - ); - - HRESULT - GetComPropSheetFunc( - _Outptr_ PFNCOMPROPSHEET* ppfnComPropSheet - ); - - HANDLE - GetPageHandle( - VOID - ); - - HANDLE - GetComPropSheetHandle( - VOID - ); - - HRESULT - AddUIControl( - _In_ CONST INT iCtrlID, - _In_ CUIControl* pUIControl - ); - - HRESULT - GetUIComponents( - _Outptr_ UIControlMap** ppUIComponents - ); - - HRESULT - GetOemCUIPParam( - _Outptr_ POEMCUIPPARAM* ppOemCUIPParam - ); - - HRESULT - PublishHelpToControls( - VOID - ); - - HRESULT - SendCommand( - _In_ CONST HWND hDlg, - _In_ CONST WPARAM wParam - ); - - HRESULT - SendSetActive( - _In_ CONST HWND hDlg - ); - - HRESULT - SendInit( - _In_ CONST HWND hDlg - ); - - HRESULT - SendNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNMhdr - ); - - HRESULT - DestroyUIComponents( - VOID - ); - -private: - UIControlMap m_UIControls; - - CComPtr m_pDriverUIHelp; - - HANDLE m_hPage; - - HANDLE m_hComPropSheet; - - PFNCOMPROPSHEET m_pfnComPropSheet; - - POEMCUIPPARAM m_pOemCUIPParam; - - CUIProperties* m_pUIProperties; -}; - diff --git a/print/XPSDrvSmpl/src/ui/ftrctrls.cpp b/print/XPSDrvSmpl/src/ui/ftrctrls.cpp deleted file mode 100644 index 94923e9a..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrctrls.cpp +++ /dev/null @@ -1,1667 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ftrctrls.cpp - -Abstract: - - Implementation of the features property page UI controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "resource.h" -#include "ftrctrls.h" -#include "privatedefs.h" - -PCSTR CUICtrlFeatPgScaleCombo::m_pszFeatPgScale = "PageScaling"; - -PCSTR CUICtrlFeatScaleOffsetCombo::m_pszFeatScaleOffset = "ScaleOffsetAlignment"; - -PCSTR CUICtrlFeatPgScaleXEdit::m_pszFeatPgScaleX = "PageScalingScaleWidth"; -PCSTR CUICtrlFeatPgScaleXSpin::m_pszFeatPgScaleX = "PageScalingScaleWidth"; -PCSTR CUICtrlFeatPgScaleYEdit::m_pszFeatPgScaleY = "PageScalingScaleHeight"; -PCSTR CUICtrlFeatPgScaleYSpin::m_pszFeatPgScaleY = "PageScalingScaleHeight"; -PCSTR CUICtrlFeatPgOffsetXEdit::m_pszFeatPgOffsetX = "PageScalingOffsetWidth"; -PCSTR CUICtrlFeatPgOffsetXSpin::m_pszFeatPgOffsetX = "PageScalingOffsetWidth"; -PCSTR CUICtrlFeatPgOffsetYEdit::m_pszFeatPgOffsetY = "PageScalingOffsetHeight"; -PCSTR CUICtrlFeatPgOffsetYSpin::m_pszFeatPgOffsetY = "PageScalingOffsetHeight"; - -PCSTR CUICtrlFeatNUpCombo::m_pszFeatNUp = "DocumentNUp"; -PCSTR CUICtrlFeatNUpOrderCombo::m_pszFeatNUpOrder = "DocumentNUpPresentationOrder"; - -PCSTR CUICtrlFeatDocDuplexCombo::m_pszFeatDocDuplex = "DocumentDuplex"; -PCSTR CUICtrlFeatPhotIntCombo::m_pszFeatPhotInt = "PagePhotoPrintingIntent"; -PCSTR CUICtrlFeatBordersCheck::m_pszFeatBorders = "PageBorderless"; - -PCSTR CUICtrlFeatJobBindCombo::m_pszFeatJobBind = "JobBindAllDocuments"; -PCSTR CUICtrlFeatDocBindCombo::m_pszFeatDocBind = "DocumentBinding"; - -#define PGSCALE_NONE_SEL 0 -#define PGSCALE_CUSTOM_SEL 1 -#define PGSCALE_CUSTSQUARE_SEL 2 -#define PGSCALE_FITBLEED_SEL 3 -#define PGSCALE_FITCONTENT_SEL 4 -#define PGSCALE_FITPAGE_SEL 5 -#define PGSCALE_SCALEPAGETOPAGE_SEL 6 - -#define JOBBIND_NONE_SEL 0 - -// -// Page scale selection combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::CUICtrlFeatPgScaleCombo - -Routine Description: - - CUICtrlFeatPgScaleCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleCombo::CUICtrlFeatPgScaleCombo() : - CUICtrlDefaultCombo(m_pszFeatPgScale, IDC_COMBO_PGSCALE) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::~CUICtrlFeatPgScaleCombo - -Routine Description: - - CUICtrlFeatPgScaleCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleCombo::~CUICtrlFeatPgScaleCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatPgScaleCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_CUSTOM)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_CUSTSQUARE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_FITBLEED)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_FITCONTENT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_FITPAGE))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALEPAGETOPAGE); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatPgScaleCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - BOOL bNone = (lSel == PGSCALE_NONE_SEL); - BOOL bCustom = (lSel == PGSCALE_CUSTOM_SEL); - BOOL bCustomSquare = (lSel == PGSCALE_CUSTSQUARE_SEL); - BOOL bFit = !(bCustom | bCustomSquare) && !bNone; - - // - // Here we are enabling/disabling and showing/hiding the page scale controls - // based on the currently selected options. - // - // If custom scaling is selected we need to enable and show the X/Y offset and X/Y - // scaling controls and hide the "fit to" options. If we custom square scaling is - // selected we show the same controls as custom scaling but disable the Y scaling - // control so the user can only apply the scale in one dimension. - // - // If one of the "fit to" options (FitApplicationBleedSizeToPageImageableSize etc.) - // is selected we disable and hide the custom controls (X/Y offset and scale) and enable - // the offset alignment option control. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGSCALEX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGSCALEX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGSCALEX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGSCALEY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGSCALEY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGSCALEY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_PGOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_PGOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_PGOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bCustom | bCustomSquare); - ShowWindow(hWnd, (bCustom | bCustomSquare | bNone) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_SCALEOFF), E_HANDLE))) - { - EnableWindow(hWnd, bFit); - ShowWindow(hWnd, bFit ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_SCALEOFF), E_HANDLE))) - { - EnableWindow(hWnd, bFit); - ShowWindow(hWnd, bFit ? SW_SHOW : SW_HIDE); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Page scale selection combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatScaleOffsetCombo::CUICtrlFeatScaleOffsetCombo - -Routine Description: - - CUICtrlFeatScaleOffsetCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatScaleOffsetCombo::CUICtrlFeatScaleOffsetCombo() : - CUICtrlDefaultCombo(m_pszFeatScaleOffset, IDC_COMBO_SCALEOFF) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatScaleOffsetCombo::~CUICtrlFeatScaleOffsetCombo - -Routine Description: - - CUICtrlFeatScaleOffsetCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatScaleOffsetCombo::~CUICtrlFeatScaleOffsetCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatScaleOffsetCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatScaleOffsetCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_BC)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_BL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_BR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_CC)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_LC)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_CR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_CT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_TL))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_SCALE_ALIGN_TR); - } - - ERR_ON_HR(hr); - return hr; -} - -#define NUP_1PPS_SEL 0 - -// -// NUp page per sheet combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::CUICtrlFeatNUpCombo - -Routine Description: - - CUICtrlFeatNUpCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpCombo::CUICtrlFeatNUpCombo() : - CUICtrlDefaultCombo(m_pszFeatNUp, IDC_COMBO_NUP) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::~CUICtrlFeatNUpCombo - -Routine Description: - - CUICtrlFeatNUpCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpCombo::~CUICtrlFeatNUpCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatNUpCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_1PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_2PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_4PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_6PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_8PPS)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_9PPS))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_16PPS); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatNUpCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - // - // Here we are enabling/disabling the NUp and Binding controls depending on the current - // NUp selection. - // - // When NUp is more than 1 page per sheet we enable the NUp order controls and disable - // binding option controls. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, lSel > NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, lSel > NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_JOBBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_JOBBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_DOCBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_DOCBIND), E_HANDLE))) - { - EnableWindow(hWnd, lSel == NUP_1PPS_SEL); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// NUp presentation order combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatNUpOrderCombo::CUICtrlFeatNUpOrderCombo - -Routine Description: - - CUICtrlFeatNUpOrderCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpOrderCombo::CUICtrlFeatNUpOrderCombo() : - CUICtrlDefaultCombo(m_pszFeatNUpOrder, IDC_COMBO_NUP_ORDER) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpOrderCombo::~CUICtrlFeatNUpOrderCombo - -Routine Description: - - CUICtrlFeatNUpOrderCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatNUpOrderCombo::~CUICtrlFeatNUpOrderCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatNUpOrderCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatNUpOrderCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTORTTOB)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOBLTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOLTTOB)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOBRTOL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTORBTOT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOTLTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOLBTOT))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOTRTOL); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Binding combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::CUICtrlFeatJobBindCombo - -Routine Description: - - CUICtrlFeatJobBindCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatJobBindCombo::CUICtrlFeatJobBindCombo() : - CUICtrlDefaultCombo(m_pszFeatJobBind, IDC_COMBO_JOBBIND) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::~CUICtrlFeatJobBindCombo - -Routine Description: - - CUICtrlFeatJobBindCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatJobBindCombo::~CUICtrlFeatJobBindCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatJobBindCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOB))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOT); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatJobBindCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatJobBindCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - // - // Here we are enabling/disabling binding and NUp controls based off the current - // binding option. - // - // If JobBindAllDocuments option is selected we disable DocumentBinding and NUp controls. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_DOCBIND), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_DOCBIND), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP_ORDER), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Binding Direction combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::CUICtrlFeatDocBindCombo - -Routine Description: - - CUICtrlFeatDocBindCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocBindCombo::CUICtrlFeatDocBindCombo() : - CUICtrlDefaultCombo(m_pszFeatDocBind, IDC_COMBO_DOCBIND) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::~CUICtrlFeatDocBindCombo - -Routine Description: - - CUICtrlFeatDocBindCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocBindCombo::~CUICtrlFeatDocBindCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatDocBindCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_LTOR)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RTOL)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TTOB))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_BTOT); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlFeatDocBindCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatDocBindCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - // - // Here we are enabling/disabling binding and NUp controls based off the current - // DocumentBinding option. - // - // If DocumentBinding option is selected we disable JobBindAllDocuments and NUp controls. - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_NUP_ORDER), E_HANDLE))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_NUP_ORDER), E_HANDLE)))) - { - EnableWindow(hWnd, (lSel == JOBBIND_NONE_SEL)); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Document photo printing intent combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatPhotIntCombo::CUICtrlFeatPhotIntCombo - -Routine Description: - - CUICtrlFeatPhotIntCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPhotIntCombo::CUICtrlFeatPhotIntCombo() : - CUICtrlDefaultCombo(m_pszFeatPhotInt, IDC_COMBO_PHOTO_INTENT) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPhotIntCombo::~CUICtrlFeatPhotIntCombo - -Routine Description: - - CUICtrlFeatPhotIntCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPhotIntCombo::~CUICtrlFeatPhotIntCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPhotIntCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatPhotIntCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_BEST)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_DRAFT))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_STANDARD); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Document duplex combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatDocDuplexCombo::CUICtrlFeatDocDuplexCombo - -Routine Description: - - CUICtrlFeatDocDuplexCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocDuplexCombo::CUICtrlFeatDocDuplexCombo() : - CUICtrlDefaultCombo(m_pszFeatDocDuplex, IDC_COMBO_DOCDUPLEX) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocDuplexCombo::~CUICtrlFeatDocDuplexCombo - -Routine Description: - - CUICtrlFeatDocDuplexCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatDocDuplexCombo::~CUICtrlFeatDocDuplexCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatDocDuplexCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlFeatDocDuplexCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE))&& - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_HORIZONTAL))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_VERTICAL); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Document duplex combo box control -// -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXEdit::CUICtrlFeatPgScaleXEdit - -Routine Description: - - CUICtrlFeatPgScaleXEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXEdit::CUICtrlFeatPgScaleXEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgScaleX, - IDC_EDIT_PGSCALEX, - pgscParamDefIntegers[ePageScalingScaleWidth].min_length, - pgscParamDefIntegers[ePageScalingScaleWidth].max_length, - IDC_SPIN_PGSCALEX) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXEdit::~CUICtrlFeatPgScaleXEdit - -Routine Description: - - CUICtrlFeatPgScaleXEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXEdit::~CUICtrlFeatPgScaleXEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXSpin::CUICtrlFeatPgScaleXSpin - -Routine Description: - - CUICtrlFeatPgScaleXSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXSpin::CUICtrlFeatPgScaleXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleXSpin::~CUICtrlFeatPgScaleXSpin - -Routine Description: - - CUICtrlFeatPgScaleXSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleXSpin::~CUICtrlFeatPgScaleXSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYEdit::CUICtrlFeatPgScaleYEdit - -Routine Description: - - CUICtrlFeatPgScaleYEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYEdit::CUICtrlFeatPgScaleYEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgScaleY, - IDC_EDIT_PGSCALEY, - pgscParamDefIntegers[ePageScalingScaleHeight].min_length, - pgscParamDefIntegers[ePageScalingScaleHeight].max_length, - IDC_SPIN_PGSCALEY) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYEdit::~CUICtrlFeatPgScaleYEdit - -Routine Description: - - CUICtrlFeatPgScaleYEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYEdit::~CUICtrlFeatPgScaleYEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYSpin::CUICtrlFeatPgScaleYSpin - -Routine Description: - - CUICtrlFeatPgScaleYSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYSpin::CUICtrlFeatPgScaleYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgScaleYSpin::~CUICtrlFeatPgScaleYSpin - -Routine Description: - - CUICtrlFeatPgScaleYSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgScaleYSpin::~CUICtrlFeatPgScaleYSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXEdit::CUICtrlFeatPgOffsetXEdit - -Routine Description: - - CUICtrlFeatPgOffsetXEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXEdit::CUICtrlFeatPgOffsetXEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgOffsetX, - IDC_EDIT_PGOFFX, - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].min_length), - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].max_length), - IDC_SPIN_PGOFFX) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXEdit::~CUICtrlFeatPgOffsetXEdit - -Routine Description: - - CUICtrlFeatPgOffsetXEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXEdit::~CUICtrlFeatPgOffsetXEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXSpin::CUICtrlFeatPgOffsetXSpin - -Routine Description: - - CUICtrlFeatPgOffsetXSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXSpin::CUICtrlFeatPgOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetXSpin::~CUICtrlFeatPgOffsetXSpin - -Routine Description: - - CUICtrlFeatPgOffsetXSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetXSpin::~CUICtrlFeatPgOffsetXSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYEdit::CUICtrlFeatPgOffsetYEdit - -Routine Description: - - CUICtrlFeatPgOffsetYEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYEdit::CUICtrlFeatPgOffsetYEdit() : - CUICtrlDefaultEditNum(m_pszFeatPgOffsetY, - IDC_EDIT_PGOFFY, - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].min_length), - MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].max_length), - IDC_SPIN_PGOFFY) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYEdit::~CUICtrlFeatPgOffsetYEdit - -Routine Description: - - CUICtrlFeatPgOffsetYEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYEdit::~CUICtrlFeatPgOffsetYEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYSpin::CUICtrlFeatPgOffsetYSpin - -Routine Description: - - CUICtrlFeatPgOffsetYSpin class constructor - -Arguments: - - pEdit - Pointer to the edit num buddy control - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYSpin::CUICtrlFeatPgOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatPgOffsetYSpin::~CUICtrlFeatPgOffsetYSpin - -Routine Description: - - CUICtrlFeatPgOffsetYSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatPgOffsetYSpin::~CUICtrlFeatPgOffsetYSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatBordersCheck::CUICtrlFeatBordersCheck - -Routine Description: - - CUICtrlFeatBordersCheck class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatBordersCheck::CUICtrlFeatBordersCheck() : - CUICtrlDefaultCheck(m_pszFeatBorders, IDC_CHECK_BORDERLESS) -{ -} - -/*++ - -Routine Name: - - CUICtrlFeatBordersCheck::~CUICtrlFeatBordersCheck - -Routine Description: - - CUICtrlFeatBordersCheck class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlFeatBordersCheck::~CUICtrlFeatBordersCheck() -{ -} - diff --git a/print/XPSDrvSmpl/src/ui/ftrctrls.h b/print/XPSDrvSmpl/src/ui/ftrctrls.h deleted file mode 100644 index 6351bb49..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrctrls.h +++ /dev/null @@ -1,288 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ftrctrls.h - -Abstract: - - Definition of the features property page UI controls. - ---*/ - -#pragma once - -#include "uictrl.h" - -class CUICtrlFeatPgScaleCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatPgScaleCombo(); - - virtual ~CUICtrlFeatPgScaleCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatPgScale; -}; - -class CUICtrlFeatScaleOffsetCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatScaleOffsetCombo(); - - virtual ~CUICtrlFeatScaleOffsetCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatScaleOffset; -}; - -class CUICtrlFeatPgScaleXEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgScaleXEdit(); - - virtual ~CUICtrlFeatPgScaleXEdit(); - -private: - static PCSTR m_pszFeatPgScaleX; -}; - -class CUICtrlFeatPgScaleXSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgScaleXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgScaleXSpin(); - -private: - static PCSTR m_pszFeatPgScaleX; -}; - -class CUICtrlFeatPgOffsetXEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgOffsetXEdit(); - - virtual ~CUICtrlFeatPgOffsetXEdit(); - -private: - static PCSTR m_pszFeatPgOffsetX; -}; - -class CUICtrlFeatPgOffsetXSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgOffsetXSpin(); - -private: - static PCSTR m_pszFeatPgOffsetX; -}; - -class CUICtrlFeatPgScaleYEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgScaleYEdit(); - - virtual ~CUICtrlFeatPgScaleYEdit(); - -private: - static PCSTR m_pszFeatPgScaleY; -}; - -class CUICtrlFeatPgScaleYSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgScaleYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgScaleYSpin(); - -private: - static PCSTR m_pszFeatPgScaleY; -}; - -class CUICtrlFeatPgOffsetYEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlFeatPgOffsetYEdit(); - - virtual ~CUICtrlFeatPgOffsetYEdit(); - -private: - static PCSTR m_pszFeatPgOffsetY; -}; - -class CUICtrlFeatPgOffsetYSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlFeatPgOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlFeatPgOffsetYSpin(); - -private: - static PCSTR m_pszFeatPgOffsetY; -}; - -class CUICtrlFeatNUpCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatNUpCombo(); - - virtual ~CUICtrlFeatNUpCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatNUp; -}; - -class CUICtrlFeatNUpOrderCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatNUpOrderCombo(); - - virtual ~CUICtrlFeatNUpOrderCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatNUpOrder; -}; - -class CUICtrlFeatJobBindCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatJobBindCombo(); - - virtual ~CUICtrlFeatJobBindCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatJobBind; -}; - -class CUICtrlFeatDocBindCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatDocBindCombo(); - - virtual ~CUICtrlFeatDocBindCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszFeatDocBind; -}; - -class CUICtrlFeatPhotIntCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatPhotIntCombo(); - - virtual ~CUICtrlFeatPhotIntCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatPhotInt; -}; - -class CUICtrlFeatDocDuplexCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlFeatDocDuplexCombo(); - - virtual ~CUICtrlFeatDocDuplexCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszFeatDocDuplex; -}; - -class CUICtrlFeatBordersCheck : public CUICtrlDefaultCheck -{ -public: - CUICtrlFeatBordersCheck(); - - virtual ~CUICtrlFeatBordersCheck(); - -private: - static PCSTR m_pszFeatBorders; -}; - diff --git a/print/XPSDrvSmpl/src/ui/ftrdmptcnv.h b/print/XPSDrvSmpl/src/ui/ftrdmptcnv.h deleted file mode 100644 index 4ae471ea..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrdmptcnv.h +++ /dev/null @@ -1,631 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ftrdmptcnv.h - -Abstract: - - Defines the interface for a DevMode <-> PrintTicket feature conversion class - and an abstract class that handles the print core helper interface pointer. - ---*/ - -#pragma once - -template -struct GPDStringToOption -{ - PCSTR pszOption; - _T option; -}; - -class IFeatureDMPTConvert -{ -public: - IFeatureDMPTConvert(){} - - virtual ~IFeatureDMPTConvert(){} - - virtual HRESULT STDMETHODCALLTYPE - ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ ULONG cbDevmode, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE - ConvertDevModeToPrintTicket( - _In_ ULONG cbDevmode, - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE - PublishPrintTicketHelperInterface( - _In_ IPrintCoreHelperUni* pHelper - ) = 0; - - - virtual HRESULT STDMETHODCALLTYPE - ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ) = 0; -}; - -template -class CFeatureDMPTConvert : public IFeatureDMPTConvert -{ -public: - CFeatureDMPTConvert(){} - - virtual ~CFeatureDMPTConvert(){} - - /*++ - - Routine Name: - - ConvertPrintTicketToDevMode - - Routine Description: - - - The plug-in is passed an input Print Ticket that is fully populated, - and a devmode. This method controls the calls to update the DevMode - to reflect the settings defined in the PrintTicket. - - The template this class is instantiated using defines the data - type passed between routines. Derived classes define this data - and then act on it as appropriate to the feature. - - Arguments: - - pPrintTicket - pointer to input Print Ticket - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - _In_ ULONG cbDevmode, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode - ) - { - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Initialise the GPD settings from the devmode and merge with - // the PrintTicket settings - // - _T ptData; - - if (SUCCEEDED(hr = GetPTDataSettingsFromDM(pDevmode, cbDevmode, pPrivateDevmode, cbDrvPrivateSize, &ptData)) && - SUCCEEDED(hr = MergePTDataSettingsWithPT(pPrintTicket, &ptData))) - { - // - // Set the combined options in the devmode - // - hr = SetPTDataInDM(ptData, pDevmode, cbDevmode, pPrivateDevmode, cbDrvPrivateSize); - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - ConvertDevModeToPrintTicket - - Routine Description: - - Unidrv will call the routine with an Input PrintTicket that is - populated with public and Unidrv private features. This method - controls the calls to update the PrintTicket to reflect the - settings defined in the devmode. - - The template this class is instantiated using defines the data - type passed between routines. Derived classes define this data - and then act on it as appropriate to the feature. - - Arguments: - - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - pPrintTicket - pointer to input Print Ticket - - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - ConvertDevModeToPrintTicket( - _In_ ULONG cbDevmode, - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDrvPrivateSize, - _In_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) - { - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - // - // Initialise the GPD settings from the devmode - // - _T ptData; - - if (SUCCEEDED(hr = GetPTDataSettingsFromDM(pDevmode, cbDevmode, pPrivateDevmode, cbDrvPrivateSize, &ptData))) - { - // - // Set the options in the PrintTicket - // - hr = SetPTDataInPT(ptData, pPrintTicket); - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - PublishPrintTicketHelperInterface - - Routine Description: - - This routine is stores the print core helper interface for use by - derived feature specific DM<->PT conversion classes. - - Arguments: - - pHelper - Pointer to core helper interface - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - HRESULT STDMETHODCALLTYPE - PublishPrintTicketHelperInterface( - _In_ IPrintCoreHelperUni* pHelper - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHelper, E_POINTER)) && - m_pCoreHelper == NULL) - { - m_pCoreHelper = pHelper; - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - ValidatePrintTicket - - Routine Description: - - Default validate implementation - just returns S_NO_CONFLICT. If the - derived feature specific class needs to validate the PrintTicket it - should provide its own implementation and handle the PrintTicket - appropriately. - - Arguments: - - pPrintTicket - Pointer to input Print Ticket. - - Return Value: - - HRESULT - S_NO_CONFLICT - On success - E_* - On error - - --*/ - virtual HRESULT STDMETHODCALLTYPE - ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ) - { - HRESULT hr = S_NO_CONFLICT; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - hr = S_NO_CONFLICT; - } - - ERR_ON_HR(hr); - return hr; - } - -protected: - /*++ - - Routine Name: - - GetPTDataSettingsFromDM - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of retrieving the data type defined by that class from - the DevMode. - - Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to data structure defined by a template argument to be updated. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ _T* pDataSettings - ) = 0; - - /*++ - - Routine Name: - - MergePTDataSettingsWithPT - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of merging the data type defined by that class from - the PrintTicket settings. - - Arguments: - - pPrintTicket - Pointer to the PrintTicket to merge the data structure with. - pDataSettings - Pointer to data structure defined by a template argument to be updated. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ _T* pDrvSettings - ) = 0; - - /*++ - - Routine Name: - - SetPTDataInDM - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of setting the data type defined by that class in the - DevMode. - - Arguments: - - dataSettings - const reference to the data structure defined by a template argument to be update from. - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - SetPTDataInDM( - _In_ CONST _T& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) = 0; - - /*++ - - Routine Name: - - SetPTDataInPT - - Routine Description: - - This pure virtual function ensures the concrete feature converter class - implements a means of setting the data type defined by that class in the - PrintTicket. - - Arguments: - - dataSettings - const reference to the data structure defined by a template argument to be update from. - pPrintTicket - Pointer to the PrintTicket to update the data structure with. - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - virtual HRESULT - SetPTDataInPT( - _In_ CONST _T& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) = 0; - - /*++ - - Routine Name: - - GetOptionFromGPDString - - Routine Description: - - This template function takes as a template parameter the type of the - data to be retrieved from the DevMode. A table is passed through that - provides the look-up between the GPD string and the data type to be - returned. The routine then iterates through the options for the feature - specified matching against look-up and returning the corresponding value. - - Arguments: - - pDevmode - pointer to input DevMode. - cbDevmode - count of bytes in the input devmode. - pszFeature - string defining the feature name to match against. - pOptTable - pointer to the look-up table matching the GPD option strings to the option value. - cOptEntries - the number of entries in the look-up table - result - reference to the result value to be updated (type defined by the template argument) - - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - template - HRESULT - GetOptionFromGPDString( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_z_ PCSTR pszFeature, - _In_ CONST GPDStringToOption<_U>* pOptTable, - _In_ CONST UINT cOptEntries, - _Out_ _U& result - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pszFeature, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOptTable, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE)) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - BOOL bFound = FALSE; - - if (cOptEntries > 0) - { - PCSTR pszOption = NULL; - - if (SUCCEEDED(hr = m_pCoreHelper->GetOption(pDevmode, cbDevmode, pszFeature, &pszOption))) - { - CStringXDA cstrOption(pszOption); - for (UINT index = 0; index < cOptEntries && !bFound; index++) - { - if (cstrOption == pOptTable->pszOption) - { - result = pOptTable->option; - bFound = TRUE; - } - else - { - pOptTable++; - } - } - } - } - - if (!bFound) - { - hr = E_ELEMENT_NOT_FOUND; - } - } - - ERR_ON_HR(hr); - return hr; - } - - /*++ - - Routine Name: - - SetGPDStringFromOption - - Routine Description: - - This template function takes as a template parameter the type of the - data to be set in the DevMode. A table is passed through that provides - the look-up between the GPD string and the data type to be set. The routine - then iterates through the options for the feature specified matching against - the look-up and setting the corresponding value in the DevMode. - - Arguments: - - pDevmode - pointer to input DevMode. - cbDevmode - count of bytes in the input devmode. - pszFeature - string defining the feature name to match against. - pOptTable - pointer to the look-up table matching the GPD option strings to the option value. - cOptEntries - the number of entries in the look-up table - result - const reference to the result value to update from (type defined by the template argument) - - Return Value: - - HRESULT - S_OK - On success - E_* - On error - - --*/ - template - HRESULT - SetGPDStringFromOption( - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_z_ PCSTR pszFeature, - _In_ CONST GPDStringToOption<_U>* pOptTable, - _In_ CONST UINT cOptEntries, - _In_ CONST _U& option - ) - { - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pszFeature, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOptTable, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE)) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - if (cOptEntries > 0) - { - for (UINT index = 0; index < cOptEntries; index++) - { - if (option == pOptTable->option) - { - PRINT_FEATURE_OPTION featureOption[1] = { - pszFeature, - pOptTable->pszOption - }; - - DWORD dwResult = 0; - DWORD cPairsWritten = 0; - - hr = m_pCoreHelper->SetOptions(pDevmode, cbDevmode, TRUE, featureOption, 1, &cPairsWritten, &dwResult); - - break; - } - else - { - pOptTable++; - } - } - } - } - - ERR_ON_HR(hr); - return hr; - } - - -protected: - CComPtr m_pCoreHelper; -}; - diff --git a/print/XPSDrvSmpl/src/ui/ftrppg.cpp b/print/XPSDrvSmpl/src/ui/ftrppg.cpp deleted file mode 100644 index 5cb4ea8f..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrppg.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ftrppg.cpp - -Abstract: - - Implementation of the feature property page. This class is - responsible for initialising and registering the features - property page and its controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "resource.h" -#include "ftrppg.h" -#include "ftrctrls.h" - -/*++ - -Routine Name: - - CFeaturePropPage::CFeaturePropPage - -Routine Description: - - CFeaturePropPage class constructor. - Creates a handler class object for every control on the feature property page. - Each of these handlers is stored in a collection. - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CFeaturePropPage::CFeaturePropPage() -{ - HRESULT hr = S_OK; - - try - { - CUIControl* pControl = new(std::nothrow) CUICtrlFeatPgScaleCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_PGSCALE, pControl); - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatScaleOffsetCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_SCALEOFF, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleXEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGSCALEX, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleXSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGSCALEX, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetXEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGOFFX, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetXSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGOFFX, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleYEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGSCALEY, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgScaleYSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGSCALEY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetYEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_PGOFFY, pControl))) - { - pControl = new(std::nothrow) CUICtrlFeatPgOffsetYSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_PGOFFY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatNUpCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_NUP, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatNUpOrderCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_NUP_ORDER, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatPhotIntCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_PHOTO_INTENT, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatDocDuplexCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_DOCDUPLEX, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatBordersCheck(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_CHECK_BORDERLESS, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatJobBindCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_JOBBIND, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlFeatDocBindCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_DOCBIND, pControl); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - if (FAILED(hr)) - { - DestroyUIComponents(); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CFeaturePropPage::~CFeaturePropPage - -Routine Description: - - CFeaturePropPage class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CFeaturePropPage::~CFeaturePropPage() -{ -} - -/*++ - -Routine Name: - - CFeaturePropPage::InitDlgBox - -Routine Description: - - Provides the base class with the data required to intialise the dialog box. - -Arguments: - - ppszTemplate - Pointer to dialog box template to be intialised. - ppszTitle - Pointer to dialog box title to be intialised. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CFeaturePropPage::InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppszTemplate, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(ppszTitle, E_POINTER))) - { - *ppszTemplate = MAKEINTRESOURCE(IDD_FEATURES); - *ppszTitle = MAKEINTRESOURCE(IDS_FEATURE); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/ftrppg.h b/print/XPSDrvSmpl/src/ui/ftrppg.h deleted file mode 100644 index 73384fa5..00000000 --- a/print/XPSDrvSmpl/src/ui/ftrppg.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - ftrppg.h - -Abstract: - - Definition of the feature property page. This class is - responsible for initialising and registering the features - property page and its controls. - ---*/ - -#pragma once - -#include "precomp.h" -#include "docppg.h" - -class CFeaturePropPage : public CDocPropPage -{ -public: - CFeaturePropPage(); - - virtual ~CFeaturePropPage(); - - HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/nupptcnv.cpp b/print/XPSDrvSmpl/src/ui/nupptcnv.cpp deleted file mode 100644 index 017d87ca..00000000 --- a/print/XPSDrvSmpl/src/ui/nupptcnv.cpp +++ /dev/null @@ -1,477 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupptcnv.cpp - -Abstract: - - JobNUpAllDocumentsContiguously and DocumentNUp devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "nupptcnv.h" -#include "nupchndlr.h" - -using XDPrintSchema::NUp::NUpData; -using XDPrintSchema::NUp::ENUpFeature; -using XDPrintSchema::NUp::ENUpFeatureMin; -using XDPrintSchema::NUp::JobNUpAllDocumentsContiguously; -using XDPrintSchema::NUp::DocumentNUp; -using XDPrintSchema::NUp::ENUpFeatureMax; - -using XDPrintSchema::NUp::PresentationDirection::ENUpDirectionOption; -using XDPrintSchema::NUp::PresentationDirection::LeftTop; -using XDPrintSchema::NUp::PresentationDirection::LeftBottom; -using XDPrintSchema::NUp::PresentationDirection::RightTop; -using XDPrintSchema::NUp::PresentationDirection::RightBottom; -using XDPrintSchema::NUp::PresentationDirection::BottomRight; -using XDPrintSchema::NUp::PresentationDirection::BottomLeft; -using XDPrintSchema::NUp::PresentationDirection::TopRight; -using XDPrintSchema::NUp::PresentationDirection::TopLeft; - -PCSTR g_pszNUpFeature[ENUpFeatureMax] = { - "JobNUpAllDocumentsContiguously", - "DocumentNUp" -}; -static GPDStringToOption g_pagesPerSheetOption[] = { - {"1", 1}, - {"2", 2}, - {"4", 4}, - {"6", 6}, - {"8", 8}, - {"9", 9}, - {"16", 16}, -}; -UINT g_cPagesPerSheetOption = sizeof(g_pagesPerSheetOption)/sizeof(GPDStringToOption); - -PCSTR g_pszPresDirFeature[ENUpFeatureMax] = { - "JobNUpContiguouslyPresentationOrder", - "DocumentNUpPresentationOrder", -}; -static GPDStringToOption g_presDirTypeOption[] = { - {"RightBottom", RightBottom}, - {"BottomRight", BottomRight}, - {"LeftBottom", LeftBottom}, - {"BottomLeft", BottomLeft}, - {"RightTop", RightTop}, - {"TopRight", TopRight}, - {"LeftTop", LeftTop}, - {"TopLeft", TopLeft}, -}; -UINT g_cPresDirOption = sizeof(g_presDirTypeOption)/sizeof(GPDStringToOption); - - -/*++ - -Routine Name: - - CNUpDMPTConv::CNUpDMPTConv - -Routine Description: - - CNUpDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpDMPTConv::CNUpDMPTConv() -{ -} - -/*++ - -Routine Name: - - CNUpDMPTConv::~CNUpDMPTConv - -Routine Description: - - CNUpDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CNUpDMPTConv::~CNUpDMPTConv() -{ -} - -/*++ - -Routine Name: - - CNUpDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the NUp data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to NUp data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ NUpSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings for both Job and Document NUp - // - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax && SUCCEEDED(hr); - nUpFeature = static_cast(nUpFeature + 1)) - { - pDataSettings->settings[nUpFeature].nUpFeature = nUpFeature; - if (SUCCEEDED(hr = GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszNUpFeature[nUpFeature], - g_pagesPerSheetOption, - g_cPagesPerSheetOption, - pDataSettings->settings[nUpFeature].cNUp))) - { - hr = GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszPresDirFeature[nUpFeature], - g_presDirTypeOption, - g_cPresDirOption, - pDataSettings->settings[nUpFeature].nUpPresentDir); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the NUp data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the NUp data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ NUpSettings* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the NUp settings from the PrintTicket and set the options in - // the appropriate Job or Document equivalent in the NUpSettings structure - // - NUpData nUpData; - CNUpPTHandler nUpPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = nUpPTHndlr.GetData(&nUpData))) - { - // - // Only update settings relevant to the feature - // - if (nUpData.nUpFeature < ENUpFeatureMax && - nUpData.nUpFeature >= ENUpFeatureMin) - { - pDataSettings->settings[nUpData.nUpFeature] = nUpData; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // NUp setting not in the PT - make sure neither Job or - // Document NUp are set in the outgoing data structure - // - pDataSettings->settings[JobNUpAllDocumentsContiguously].cNUp = 1; - pDataSettings->settings[DocumentNUp].cNUp = 1; - - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the NUp options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to NUp data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::SetPTDataInDM( - _In_ CONST NUpSettings& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - for (ENUpFeature nUpFeature = ENUpFeatureMin; - nUpFeature < ENUpFeatureMax && SUCCEEDED(hr); - nUpFeature = static_cast(nUpFeature + 1)) - { - if (SUCCEEDED(hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszNUpFeature[nUpFeature], - g_pagesPerSheetOption, - g_cPagesPerSheetOption, - dataSettings.settings[nUpFeature].cNUp))) - { - hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszPresDirFeature[nUpFeature], - g_presDirTypeOption, - g_cPresDirOption, - dataSettings.settings[nUpFeature].nUpPresentDir); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from NUp data structure. - -Arguments: - - dataSettings - Reference to NUp data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CNUpDMPTConv::SetPTDataInPT( - _In_ CONST NUpSettings& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CNUpPTHandler nUpPTHndlr(pPrintTicket); - NUpData nUpData; - - // - // Preferentially set Job over Document - // - if (dataSettings.settings[JobNUpAllDocumentsContiguously].cNUp > 1) - { - nUpData.nUpFeature = JobNUpAllDocumentsContiguously; - nUpData.cNUp = dataSettings.settings[JobNUpAllDocumentsContiguously].cNUp; - nUpData.nUpPresentDir = dataSettings.settings[JobNUpAllDocumentsContiguously].nUpPresentDir; - } - else - { - nUpData.nUpFeature = DocumentNUp; - nUpData.cNUp = dataSettings.settings[DocumentNUp].cNUp; - nUpData.nUpPresentDir = dataSettings.settings[DocumentNUp].nUpPresentDir; - } - - // - // If the option is enabled set, otherwise delete it from the PT - // - if (nUpData.cNUp > 1) - { - hr = nUpPTHndlr.SetData(&nUpData); - } - else - { - hr = nUpPTHndlr.Delete(); - } - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CNUpDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CNUpDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CNUpPCHandler nuppcHandler(pPrintCapabilities); - nuppcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/nupptcnv.h b/print/XPSDrvSmpl/src/ui/nupptcnv.h deleted file mode 100644 index e77798c8..00000000 --- a/print/XPSDrvSmpl/src/ui/nupptcnv.h +++ /dev/null @@ -1,86 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - nupptcnv.h - -Abstract: - - JobNUpAllDocumentsContiguously and DocumentNUp devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "nupthndlr.h" -#include "nupdata.h" - -// -// The PT handling code defines a single NUpData structure that covers -// both JobNUpAllDocumentsContiguously and DocumentNUp to avoid conflicts. The GPD however -// controls both so we re-use the NUpData structure to handle both in -// the DevMode by using a NUpData for each Job and Document feature -// -struct NUpSettings -{ - XDPrintSchema::NUp::NUpData settings[XDPrintSchema::NUp::ENUpFeatureMax]; -}; - -class CNUpDMPTConv : public CFeatureDMPTConvert -{ -public: - CNUpDMPTConv(); - - virtual ~CNUpDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ NUpSettings* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ NUpSettings* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST NUpSettings& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST NUpSettings& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp b/print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp deleted file mode 100644 index 73b717d0..00000000 --- a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.cpp +++ /dev/null @@ -1,468 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscdmptcnv.cpp - -Abstract: - - PageScaling devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "pgscdmptcnv.h" - -using XDPrintSchema::PageScaling::PageScalingData; -using XDPrintSchema::PageScaling::EScaleOption; -using XDPrintSchema::PageScaling::None; -using XDPrintSchema::PageScaling::Custom; -using XDPrintSchema::PageScaling::CustomSquare; -using XDPrintSchema::PageScaling::FitBleedToImageable; -using XDPrintSchema::PageScaling::FitContentToImageable; -using XDPrintSchema::PageScaling::FitMediaToImageable; -using XDPrintSchema::PageScaling::FitMediaToMedia; - -using XDPrintSchema::PageScaling::OffsetAlignment::EScaleOffsetOption; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::BottomRight; -using XDPrintSchema::PageScaling::OffsetAlignment::Center; -using XDPrintSchema::PageScaling::OffsetAlignment::LeftCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::RightCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopCenter; -using XDPrintSchema::PageScaling::OffsetAlignment::TopLeft; -using XDPrintSchema::PageScaling::OffsetAlignment::TopRight; - -// -// Lookup table between GPD page scaling option string and schema enumerated type -// -PCSTR g_pszPageScalingTypeFeature = "PageScaling"; -static GPDStringToOption g_pageScalingTypeOption[] = { - {"None", None}, - {"Custom", Custom}, - {"CustomSquare", CustomSquare}, - {"FitApplicationBleedSizeToPageImageableSize", FitBleedToImageable}, - {"FitApplicationContentSizeToPageImageableSize", FitContentToImageable}, - {"FitApplicationMediaSizeToPageImageableSize", FitMediaToImageable}, - {"FitApplicationMediaSizeToPageMediaSize", FitMediaToMedia}, -}; -UINT g_cPageScalingTypeOption = sizeof(g_pageScalingTypeOption)/sizeof(GPDStringToOption); - -// -// Lookup table between GPD scaling offset alignment option string and schema enumerated type -// -PCSTR g_pszScaleOffsetTypeFeature = "ScaleOffsetAlignment"; -static GPDStringToOption g_scaleOffsetTypeOption[] = { - {"BottomCenter", BottomCenter}, - {"BottomLeft", BottomLeft}, - {"BottomRight", BottomRight}, - {"Center", Center}, - {"LeftCenter", LeftCenter}, - {"RightCenter", RightCenter}, - {"TopCenter", TopCenter}, - {"TopLeft", TopLeft}, - {"TopRight", TopRight}, -}; -UINT g_cScaleOffsetTypeOption = sizeof(g_scaleOffsetTypeOption)/sizeof(GPDStringToOption); - - - -/*++ - -Routine Name: - - CPageScalingDMPTConv::CPageScalingDMPTConv - -Routine Description: - - CPageScalingDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingDMPTConv::CPageScalingDMPTConv() -{ -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::~CPageScalingDMPTConv - -Routine Description: - - CPageScalingDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CPageScalingDMPTConv::~CPageScalingDMPTConv() -{ -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the page scaling data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to page scaling data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ PageScalingData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast(pPrivateDevmode)); - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszPageScalingTypeFeature, - g_pageScalingTypeOption, - g_cPageScalingTypeOption, - pDataSettings->pgscOption)) && - SUCCEEDED(hr = GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszScaleOffsetTypeFeature, - g_scaleOffsetTypeOption, - g_cScaleOffsetTypeOption, - pDataSettings->offsetOption)) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszPSScaleWidth, &pDataSettings->scaleWidth, sizeof(pDataSettings->scaleWidth))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszPSScaleHeight, &pDataSettings->scaleHeight, sizeof(pDataSettings->scaleHeight))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszOffsetWidth, &pDataSettings->offWidth, sizeof(pDataSettings->offWidth))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszOffsetHeight, &pDataSettings->offHeight, sizeof(pDataSettings->offHeight)))) - { - // - // Convert length measurements from 100ths of an inch to microns - // - pDataSettings->scaleWidth = pDataSettings->scaleWidth; - pDataSettings->scaleHeight = pDataSettings->scaleHeight; - pDataSettings->offWidth = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->offWidth); - pDataSettings->offHeight = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->offHeight); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the page scaling data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the page scaling data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ PageScalingData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the page scaling settings from the PrintTicket and set the options in - // the input Watermark data structure - // - PageScalingData pgScData; - CPageScalingPTHandler pgScPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = pgScPTHndlr.GetData(&pgScData))) - { - *pDataSettings = pgScData; - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // PageScaling setting not in the PT - this is not an error. Just - // leave set the type as None and reset the HRESULT to S_OK - // - pDataSettings->pgscOption = None; - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the page scaling options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to page scaling data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::SetPTDataInDM( - _In_ CONST PageScalingData& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Convert lengths from microns to 100ths of an inch before writing to the DevMode - // - if (SUCCEEDED(hr)) - { - INT scaleWidth = dataSettings.scaleWidth; - INT scaleHeight = dataSettings.scaleHeight; - INT offWidth = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.offWidth); - INT offHeight = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.offHeight); - - // - // Set the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast(pPrivateDevmode)); - - if (SUCCEEDED(hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszPageScalingTypeFeature, - g_pageScalingTypeOption, - g_cPageScalingTypeOption, - dataSettings.pgscOption)) && - SUCCEEDED(hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszScaleOffsetTypeFeature, - g_scaleOffsetTypeOption, - g_cScaleOffsetTypeOption, - dataSettings.offsetOption)) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszPSScaleWidth, &scaleWidth, sizeof(scaleWidth))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszPSScaleHeight, &scaleHeight, sizeof(scaleHeight))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszOffsetWidth, &offWidth, sizeof(offWidth)))) - { - hr = uiProperties.SetItem(g_pszOffsetHeight, &offHeight, sizeof(offHeight)); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from page scaling data structure. - -Arguments: - - drvSettings - Reference to page scaling data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CPageScalingDMPTConv::SetPTDataInPT( - _In_ CONST PageScalingData& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CPageScalingPTHandler pgScPTHndlr(pPrintTicket); - hr = pgScPTHndlr.SetData(&dataSettings); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CPageScalingDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CPageScalingDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CPageScalingPCHandler pagescalingpcHandler(pPrintCapabilities); - pagescalingpcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.h b/print/XPSDrvSmpl/src/ui/pgscdmptcnv.h deleted file mode 100644 index 3f8b188a..00000000 --- a/print/XPSDrvSmpl/src/ui/pgscdmptcnv.h +++ /dev/null @@ -1,76 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - pgscdmptcnv.h - -Abstract: - - PageScaling devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "pgscpthndlr.h" -#include "pgscpchndlr.h" -#include "uiproperties.h" - -class CPageScalingDMPTConv : public CFeatureDMPTConvert -{ -public: - CPageScalingDMPTConv(); - - ~CPageScalingDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ XDPrintSchema::PageScaling::PageScalingData* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ XDPrintSchema::PageScaling::PageScalingData* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST XDPrintSchema::PageScaling::PageScalingData& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/precomp.h b/print/XPSDrvSmpl/src/ui/precomp.h deleted file mode 100644 index b9847ea0..00000000 --- a/print/XPSDrvSmpl/src/ui/precomp.h +++ /dev/null @@ -1,103 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - precomp.h - -Abstract: - - Precompiled header for UI plugin module. - ---*/ - -#pragma once - -// -// Annotate this as a usermode driver for static analysis -// -#include -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// -// Standard Annotation Language include -// -#include - -// -// Prefast warning suppression macros -// -#include - -// -// Windows includes -// -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif // WIN32_LEAN_AND_MEAN -#include -#include -#include -#include - -// -// COM includes -// -#include -#include - -// -// ATL Includes -// -#include - -#pragma warning (push) -#pragma warning (disable:4458) -// -// GDIPlus includes -// -#include -#pragma warning (pop) - -// -// MSXML includes -// -#include - -// -// Standard library includes -// -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -// -// Commonly used namespaces -// -using namespace std; -using namespace Gdiplus; - -// -// StrSafe.h needs to be included last to disallow bad string functions. -// -#include - -#define E_ELEMENT_NOT_FOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) - - diff --git a/print/XPSDrvSmpl/src/ui/precompsrc.cpp b/print/XPSDrvSmpl/src/ui/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XPSDrvSmpl/src/ui/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/ui/resource.h b/print/XPSDrvSmpl/src/ui/resource.h deleted file mode 100644 index 448397a5..00000000 --- a/print/XPSDrvSmpl/src/ui/resource.h +++ /dev/null @@ -1,232 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - resource.h - -Abstract: - - Resource specific defines. - ---*/ - -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by xdsmpldlg.rc -// -#define IDD_COL_MANAGE 100 -#define IDD_WATERMARK 101 -#define IDD_FEATURES 102 -#define IDS_LAYOUT 126 -#define IDS_PAPQUAL 127 -#define IDS_COLMAN 128 -#define IDS_WMARK 129 -#define IDS_FEATURE 130 -#define IDC_COMBO_COL_MANAGE 1001 -#define IDC_LIST_COLPROF 1002 -#define IDC_TEXT_COLPROF 1003 -#define IDC_COMBO_WMTYPE 1004 -#define IDC_TXT_WMTYPE 1005 -#define IDC_GRP_WM 1006 -#define IDC_COMBO_WMLAYERING 1007 -#define IDC_GRP_COLPROF 1008 -#define IDC_TXT_WMLAYERING 1009 -#define IDC_GRP_PGSCALE 1010 -#define IDC_GRP_DOCNUP 1011 -#define IDC_EDIT_WMTEXT 1012 -#define IDC_TXT_WMTEXT 1013 -#define IDC_COMBO_PGSCALE 1014 -#define IDC_TXT_PGSCALE 1015 -#define IDC_EDIT_PGSCALEX 1018 -#define IDC_EDIT_PGOFFX 1019 -#define IDC_EDIT_PGSCALEY 1022 -#define IDC_GRP_WM_MIMIC 1023 -#define IDC_EDIT_PGOFFY 1024 -#define IDC_SPIN_PGSCALEX 1025 -#define IDC_SPIN_PGOFFX 1026 -#define IDC_SPIN_PGSCALEY 1027 -#define IDC_SPIN_PGOFFY 1028 -#define IDC_COMBO_NUP 1029 -#define IDC_TXT_NUP 1030 -#define IDC_COMBO_NUP_ORDER 1031 -#define IDC_TXT_NUP_ORDER 1032 -#define IDC_COMBO_JOBBIND 1033 -#define IDC_TXT_JOBBIND 1034 -#define IDC_COMBO_DOCBIND 1035 -#define IDC_TXT_DOCBIND 1036 -#define IDC_COMBO_PHOTO_INTENT 1037 -#define IDC_TXT_PHOTO_INTENT 1038 -#define IDC_CHECK_BORDERLESS 1039 -#define IDC_TXT_PGOFFY 1040 -#define IDC_TXT_PGOFFX 1041 -#define IDC_TXT_PGSCALEY 1042 -#define IDC_TXT_PGSCALEX 1043 -#define IDC_CHECK_DEVFONTSUB 1044 -#define IDC_GRP_DOCDUP 1045 -#define IDC_CHECK_DOCDUPLEX 1046 -#define IDC_COMBO_DOCDUPLEX 1047 -#define IDC_TXT_DOCDUPLEX 1048 -#define IDC_TXT_COL_MANAGE 1049 -#define IDC_EDIT_WMTRANSPARENCY 1050 -#define IDC_SPIN_WMTRANSPARENCY 1051 -#define IDC_EDIT_WMANGLE 1052 -#define IDC_SPIN_WMANGLE 1053 -#define IDC_EDIT_WMOFFX 1054 -#define IDC_SPIN_WMOFFX 1055 -#define IDC_EDIT_WMOFFY 1056 -#define IDC_SPIN_WMOFFY 1057 -#define IDC_TXT_WMTRANSPARENCY 1058 -#define IDC_TXT_WMANGLE 1059 -#define IDC_TXT_WMOFFX 1060 -#define IDC_TXT_WMOFFY 1061 -#define IDC_EDIT_WMWIDTH 1062 -#define IDC_SPIN_WMWIDTH 1063 -#define IDC_EDIT_WMHEIGHT 1064 -#define IDC_SPIN_WMHEIGHT 1065 -#define IDC_TXT_WMWIDTH 1066 -#define IDC_TXT_WMHEIGHT 1067 -#define IDC_EDIT_WMSIZE 1068 -#define IDC_SPIN_WMSIZE 1069 -#define IDC_TXT_WMSIZE 1070 -#define IDC_BUTTON_WMCOLOR 1071 -#define IDC_COMBO_COL_INTENT 1073 -#define IDC_TXT_COL_INTENT 1074 -#define IDC_COMBO_SCALEOFF 1075 -#define IDC_TXT_SCALEOFF 1076 - -// -// String resource IDs used in GPD -// -#define IDS_GPD_1PPS 2000 -#define IDS_GPD_2PPS 2001 -#define IDS_GPD_4PPS 2002 -#define IDS_GPD_6PPS 2003 -#define IDS_GPD_8PPS 2004 -#define IDS_GPD_9PPS 2005 -#define IDS_GPD_16PPS 2006 -#define IDS_GPD_RES1200 2007 -#define IDS_GPD_RES600 2008 -#define IDS_GPD_AUTOMATIC 2009 -#define IDS_GPD_BORDERED 2010 -#define IDS_GPD_BORDERLESS 2011 -#define IDS_GPD_BTOT 2012 -#define IDS_GPD_BTOTLTOR 2013 -#define IDS_GPD_BTOTRTOL 2014 -#define IDS_GPD_CMYK 2015 -#define IDS_GPD_COLOR 2016 -#define IDS_GPD_CONFIDENTIAL 2017 -#define IDS_GPD_CUSTSQUARE 2018 -#define IDS_GPD_CUSTOM 2019 -#define IDS_GPD_SRCCOLPROF 2020 -#define IDS_GPD_DEVICE 2021 -#define IDS_GPD_DOCBIND 2022 -#define IDS_GPD_PAGECOLMAN 2023 -#define IDS_GPD_PAGEPHOTINTENT 2024 -#define IDS_GPD_DOCDUPLEX 2025 -#define IDS_GPD_DOCNUP 2026 -#define IDS_GPD_DOCNUPPRESENTORDER 2027 -#define IDS_GPD_DRAFT 2028 -#define IDS_GPD_DRIVER 2029 -#define IDS_GPD_DUPLEX 2030 -#define IDS_GPD_FAX 2031 -#define IDS_GPD_FITBLEED 2032 -#define IDS_GPD_FITCONTENT 2033 -#define IDS_GPD_FITPAGE 2034 -#define IDS_GPD_GLOSSY 2035 -#define IDS_GPD_GRAYSCALE 2036 -#define IDS_GPD_HIGH 2037 -#define IDS_GPD_HORIZONTAL 2038 -#define IDS_GPD_JOBBINDING 2039 -#define IDS_GPD_JOBNUPPRESENTORDER 2040 -#define IDS_GPD_JOBNUP 2041 -#define IDS_GPD_JOBPAGEORDER 2042 -#define IDS_GPD_LANDSCAPE 2043 -#define IDS_GPD_LTOR 2044 -#define IDS_GPD_LTORBTOT 2045 -#define IDS_GPD_LTORTTOB 2046 -#define IDS_GPD_MEDIATYPE 2047 -#define IDS_GPD_MONO 2048 -#define IDS_GPD_NONE 2049 -#define IDS_GPD_NORMAL 2050 -#define IDS_GPD_OFF 2051 -#define IDS_GPD_ON 2052 -#define IDS_GPD_ORIENATION 2053 -#define IDS_GPD_OVERLAYED 2054 -#define IDS_GPD_PAGEBORDER 2055 -#define IDS_GPD_PAGEQUALITY 2056 -#define IDS_GPD_PAGESCALING 2057 -#define IDS_GPD_PAPERSOURCE 2058 -#define IDS_GPD_PHOTOGRAPHIC 2059 -#define IDS_GPD_PORTRAIT 2060 -#define IDS_GPD_RASTERIMAGE 2061 -#define IDS_GPD_RESOLUTION 2062 -#define IDS_GPD_REVERSELANDSCAPE 2063 -#define IDS_GPD_REVERSE 2064 -#define IDS_GPD_RTOL 2065 -#define IDS_GPD_RTOLBTOT 2066 -#define IDS_GPD_RTOLTTOB 2067 -#define IDS_GPD_SCALEPAGETOPAGE 2068 -#define IDS_GPD_SCRGB 2069 -#define IDS_GPD_STANDARD 2070 -#define IDS_GPD_TEXT 2071 -#define IDS_GPD_TTOB 2072 -#define IDS_GPD_TTOBLTOR 2073 -#define IDS_GPD_TTOBRTOL 2074 -#define IDS_GPD_TRANSPARENCY 2075 -#define IDS_GPD_TRANSPARENT 2076 -#define IDS_GPD_UNDERLAYED 2077 -#define IDS_GPD_UPPER 2078 -#define IDS_GPD_VECTORIMAGE 2079 -#define IDS_GPD_VERTICAL 2080 -#define IDS_GPD_WATERMARKLAYERING 2081 -#define IDS_GPD_WATERMARKTEXT 2082 -#define IDS_GPD_WATERMARKTYPE 2083 -#define IDS_GPD_WATERMARKBITMAP 2084 -#define IDS_GPD_WATERMARKGRAPHIC 2087 -#define IDS_GPD_BEST 2090 -#define IDS_GPD_PAGEICMINTENT 2091 -#define IDS_GPD_ABSCOLINTENT 2092 -#define IDS_GPD_RELCOLINTENT 2093 -#define IDS_GPD_PHOTOINTENT 2094 -#define IDS_GPD_BIZINTENT 2095 -#define IDS_GPD_SYSTEM 2096 -#define IDS_GPD_WATERMARKTEXTCOLOR 2097 -#define IDS_GPD_RED 2098 -#define IDS_GPD_GREEN 2099 -#define IDS_GPD_BLUE 2100 -#define IDS_GPD_MAGENTA 2101 -#define IDS_GPD_CYAN 2102 -#define IDS_GPD_YELLOW 2103 -#define IDS_GPD_BLACK 2104 -#define IDS_GPD_SCALE_ALIGN 2105 -#define IDS_GPD_SCALE_ALIGN_BC 2106 -#define IDS_GPD_SCALE_ALIGN_BL 2107 -#define IDS_GPD_SCALE_ALIGN_BR 2108 -#define IDS_GPD_SCALE_ALIGN_CC 2109 -#define IDS_GPD_SCALE_ALIGN_LC 2110 -#define IDS_GPD_SCALE_ALIGN_CR 2111 -#define IDS_GPD_SCALE_ALIGN_CT 2112 -#define IDS_GPD_SCALE_ALIGN_TL 2113 -#define IDS_GPD_SCALE_ALIGN_TR 2114 - -// -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1077 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif - diff --git a/print/XPSDrvSmpl/src/ui/uictrl.cpp b/print/XPSDrvSmpl/src/ui/uictrl.cpp deleted file mode 100644 index a424a3a4..00000000 --- a/print/XPSDrvSmpl/src/ui/uictrl.cpp +++ /dev/null @@ -1,2117 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - uictrl.cpp - -Abstract: - - Implementation of the abstract UI control class and the base default - UI controls for check boxe, list, combo, edit and spin controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "uictrl.h" - -/*++ - -Routine Name: - - CUIControl::CUIControl - -Routine Description: - - CUIControl class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUIControl::CUIControl() : - m_pDriverUIHelp(NULL), - m_pOemCUIPParam(NULL), - m_pUIProperties(NULL) -{ -} - -/*++ - -Routine Name: - - CUIControl::~CUIControl - -Routine Description: - - CUIControl class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUIControl::~CUIControl() -{ -} - -/*++ - -Routine Name: - - CUIControl::SetOemCUIPParam - -Routine Description: - - Store a pointer to a OEMCUIPPARAM structure as a member in the class. - -Arguments: - - pOemCUIPParam - Pointer to a OEMCUIPPARAM structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIControl::SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER))) - { - m_pOemCUIPParam = pOemCUIPParam; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIControl::SetUIProperties - -Routine Description: - - Store a pointer to an CUIProperties interface as a member in the class. - -Arguments: - - pUIProperties - Pointer to an instance of the CUIProperties interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIControl::SetUIProperties( - _In_ CUIProperties* pUIProperties - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIProperties, E_POINTER))) - { - m_pUIProperties = pUIProperties; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIControl::SetPrintOemDriverUI - -Routine Description: - - Store a pointer to an IPrintOemDriverUI interface as a member in the class. - -Arguments: - - pOEMDriverUI - Pointer to an instance of the IPrintOemDriverUI interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIControl::SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOEMDriverUI, E_POINTER))) - { - m_pDriverUIHelp = const_cast(pOEMDriverUI); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Message handling stubs -// -/*++ - -Routine Name: - - CUIControl::OnInit - -Routine Description: - - This is a default implementation that returns S_OK. - Called from the property page handler on a WM_INITDIALOG message. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - S_OK - ---*/ -HRESULT -CUIControl::OnInit( - _In_ CONST HWND - ) -{ - // - // A sub class is required to implement this method if it requires intialisation. The - // implementation is optional however so we return S_OK by default. - // - return S_OK; -} - -/*++ - -Routine Name: - - CUIControl::OnCommand - -Routine Description: - - This is a place holder method with no implementation. - Called from the property page handler on a WM_COMMAND message. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CUIControl::OnCommand( - _In_ CONST HWND , - _In_ INT - ) -{ - // - // A sub class is required to implement this method if it can recieve command messages. The - // implementation is optional however so we return S_OK by default. - // - return S_OK; -} - -/*++ - -Routine Name: - - CUIControl::OnNotify - -Routine Description: - - This is a place holder method with no implementation. - Called from the property page handler on a WM_NOTIFY message. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CUIControl::OnNotify( - _In_ CONST HWND, - _In_ CONST NMHDR* - ) -{ - // - // A sub class is required to implement this method if it can recieve notify messages. The - // implementation is optional however so we return S_OK by default. - // - return S_OK; -} - -// -// Check box control -// -/*++ - -Routine Name: - - CUICtrlDefaultCheck::CUICtrlDefaultCheck - -Routine Description: - - CUICtrlDefaultCheck class constructor - -Arguments: - - gpdString - Property name of the data associated with this control. - iCheckResID - Resource id for the checkbox control. - -Return Value: - - None - ---*/ -CUICtrlDefaultCheck::CUICtrlDefaultCheck( - _In_ PCSTR gpdString, - _In_ CONST INT iCheckResID - ) : - m_szGPDString(gpdString), - m_iCheckResID(iCheckResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::~CUICtrlDefaultCheck - -Routine Description: - - CUICtrlDefaultCheck class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultCheck::~CUICtrlDefaultCheck() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the Unidrv GPD settings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCheck::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - POPTITEM pOptItem = NULL; - - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - - // - // Convert from a selection to a checkbox state - // and initialise the controls state. - // - - LONG lSel = pOptItem->Sel; - - UINT uChecked = (lSel == 0) ? BST_UNCHECKED : BST_CHECKED; - - if (CheckDlgButton(hDlg, m_iCheckResID, uChecked) > 0) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any button click (BN_CLICKED) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCheck::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case BN_CLICKED: - { - hr = OnBnClicked(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::OnBnClicked - -Routine Description: - - This rountine handles the event of a button press. The state of the check box control is read which - can be either checked and unchecked, the result is communicated through the Unidrv helper functions - informing the Unidrv core that a change has occured. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCheck::OnBnClicked( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pOemCUIPParam->poemuiobj != NULL, "NULL pointer to OEMCUIPPARAM->poemuiobj structure.\n"); - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam->poemuiobj, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING))) - { - // - // Retrieve the controls current selection - // and convert from checkbox state to a selection - // - UINT uChecked = IsDlgButtonChecked(hDlg, m_iCheckResID); - - LONG lSel = (uChecked == BST_UNCHECKED) ? 0 : 1; - - // - // Check against the optitem - // - POPTITEM pOptItem = NULL; - - if (SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - if (pOptItem->Sel != lSel) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - - pOptItem->Sel = lSel; - pOptItem->Flags |= OPTIF_CHANGED; - - if (SUCCEEDED(hr = m_pDriverUIHelp->DrvUpdateUISetting(m_pOemCUIPParam->poemuiobj, pOptItem, 0, OEMCUIP_DOCPROP))) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - } - else - { - PropSheet_UnChanged(GetParent(hDlg), hDlg); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCheck::EnableDependentCtrls - -Routine Description: - - This is a default implementation simply returns S_OK - -Arguments: - - None referenced. - -Return Value: - - HRESULT - S_OK - Success - ---*/ -HRESULT -CUICtrlDefaultCheck::EnableDependentCtrls( - _In_ CONST HWND, - _In_ CONST LONG - ) -{ - return S_OK; -} - - -// -// List box control -// -/*++ - -Routine Name: - - CUICtrlDefaultList::CUICtrlDefaultList - -Routine Description: - - CUICtrlDefaultList class construtor - -Arguments: - - gpdString - Property name of the data associated with this control. - iListResID - Resource id for the List Box control. - -Return Value: - - None - ---*/ -CUICtrlDefaultList::CUICtrlDefaultList( - _In_ PCSTR gpdString, - _In_ CONST INT iListResID - ) : - m_szGPDString(gpdString), - m_iListResID(iListResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::~CUICtrlDefaultList - -Routine Description: - - CUICtrlDefaultList class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultList::~CUICtrlDefaultList() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::AddString - -Routine Description: - - Loads a string from the specified resource and adds it to the end of the list box. - -Arguments: - - hDlg - handle to the parent window - hStringResDLL - handle of the resource DLL that contains the string table. - idString - identifer of the string resource to be added - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ) -{ - HRESULT hr = S_OK; - - TCHAR szItem[MAX_UISTRING_LEN]; - if (LoadString(hStringResDLL, idString, szItem, countof(szItem)) > 0) - { - LRESULT lResult = SendDlgItemMessage(hDlg, m_iListResID, LB_ADDSTRING, 0, reinterpret_cast(szItem)); - - if (lResult == LB_ERRSPACE || - lResult == LB_ERR) - { - hr = E_FAIL; - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the Unidrv GPD settings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - POPTITEM pOptItem = NULL; - - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - LONG lSel = pOptItem->Sel; - if (SendDlgItemMessage(hDlg, m_iListResID, LB_SETCURSEL, lSel, 0) != LB_ERR) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any list box selection change (LBN_SELCHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case LBN_SELCHANGE: - { - hr = OnSelChange(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::OnSelChange - -Routine Description: - - This rountine handles the event of a change of selection in the list box. The selection of the - list box control is read and the result is communicated through the Unidrv helper functions - informing the Unidrv core that a change has occured. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultList::OnSelChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pOemCUIPParam->poemuiobj != NULL, "NULL pointer to OEMCUIPPARAM->poemuiobj structure.\n"); - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam->poemuiobj, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING))) - { - // - // Retrieve the controls current selection - // - LONG lSel = static_cast(SendDlgItemMessage(hDlg, m_iListResID, LB_GETCURSEL, 0, 0)); - - if (lSel != LB_ERR) - { - // - // Check against the optitem - // - POPTITEM pOptItem = NULL; - - if (SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - if (pOptItem->Sel != lSel) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - - pOptItem->Sel = lSel; - pOptItem->Flags |= OPTIF_CHANGED; - - if (SUCCEEDED(hr = m_pDriverUIHelp->DrvUpdateUISetting(m_pOemCUIPParam->poemuiobj, pOptItem, 0, OEMCUIP_DOCPROP))) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - } - else - { - PropSheet_UnChanged(GetParent(hDlg), hDlg); - } - } - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultList::EnableDependentCtrls - -Routine Description: - - This is a default implementation that returns S_OK. - Called when a selection is changed in the list box to show/enable any dependent controls. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - S_OK - Success - ---*/ -HRESULT -CUICtrlDefaultList::EnableDependentCtrls( - _In_ CONST HWND, - _In_ CONST LONG - ) -{ - return S_OK; -} - -// -// Combo box control -// -/*++ - -Routine Name: - - CUICtrlDefaultCombo::CUICtrlDefaultCombo - -Routine Description: - - CUICtrlDefaultCombo class constructor. - -Arguments: - - gpdString - Property name of the data associated with this control. - iComboResID - Resource id for the Combo Box control. - -Return Value: - - None - ---*/ -CUICtrlDefaultCombo::CUICtrlDefaultCombo( - _In_ PCSTR gpdString, - _In_ CONST INT iComboResID - ) : - m_szGPDString(gpdString), - m_iComboResID(iComboResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::~CUICtrlDefaultCombo - -Routine Description: - - CUICtrlDefaultCombo class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultCombo::~CUICtrlDefaultCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the Unidrv GPD settings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - POPTITEM pOptItem = NULL; - - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - LONG lSel = pOptItem->Sel; - - LRESULT lResult = SendDlgItemMessage(hDlg, m_iComboResID, CB_SETCURSEL, lSel, 0); - - if (lResult != CB_ERR && - lResult != CB_ERRSPACE) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - else - { - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any Combo Box selection change (CBN_SELCHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case CBN_SELCHANGE: - { - hr = OnSelChange(hDlg); - } - break; - - default: - { - hr = E_NOTIMPL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::OnSelChange - -Routine Description: - - This rountine handles the event of a change of selection in the combo box. The selection of the - combo box control is read and the result is communicated through the Unidrv helper functions - informing the Unidrv core that a change has occured. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::OnSelChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - ASSERTMSG(m_pOemCUIPParam->poemuiobj != NULL, "NULL pointer to OEMCUIPPARAM->poemuiobj structure.\n"); - ASSERTMSG(m_pDriverUIHelp != NULL, "NULL pointer to driver UI help interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOemCUIPParam->poemuiobj, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pDriverUIHelp, E_PENDING))) - { - // - // Retrieve the controls current selection - // - - LONG lSel = static_cast(SendDlgItemMessage(hDlg, m_iComboResID, CB_GETCURSEL, 0, 0)); - - if (lSel == CB_ERR) - { - hr = E_FAIL; - } - - POPTITEM pOptItem = NULL; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = m_pUIProperties->GetOptItem(m_pOemCUIPParam, m_szGPDString, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - if (pOptItem->Sel != lSel) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - - pOptItem->Sel = lSel; - pOptItem->Flags |= OPTIF_CHANGED; - - if (SUCCEEDED(hr = m_pDriverUIHelp->DrvUpdateUISetting(m_pOemCUIPParam->poemuiobj, pOptItem, 0, OEMCUIP_DOCPROP))) - { - hr = EnableDependentCtrls(hDlg, lSel); - } - } - else - { - PropSheet_UnChanged(GetParent(hDlg), hDlg); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::EnableDependentCtrls - -Routine Description: - - This is a default implementation that returns S_OK. - Called when a selection is changed in the combo box to show/enable any dependent controls. - -Arguments: - - None referenced - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::EnableDependentCtrls( - _In_ CONST HWND, - _In_ CONST LONG - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CUICtrlDefaultCombo::AddString - -Routine Description: - - Loads a string from the specified resource and adds it to the end of the Combo Box. - -Arguments: - - hDlg - handle to the parent window - hStringResDLL - handle of the resource DLL that contains the string table. - idString - identifer of the string resource to be added - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultCombo::AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ) -{ - HRESULT hr = S_OK; - - TCHAR szItem[MAX_UISTRING_LEN]; - if (LoadString(hStringResDLL, idString, szItem, countof(szItem)) > 0) - { - LRESULT lResult = SendDlgItemMessage(hDlg, m_iComboResID, CB_ADDSTRING, 0, reinterpret_cast(szItem)); - - if (lResult == CB_ERRSPACE || - lResult == CB_ERR) - { - hr = E_FAIL; - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// EditNum control -// -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::CUICtrlDefaultEditNum - -Routine Description: - - CUICtrlDefaultEditNum class constructor - -Arguments: - - gpdString - Property name of the data associated with this control. - iEditResID - Resource id for the Combo Box control. - iPropMin - Minimum integer value that is valid. - iPropMax - Maximum integer value that is valid. - iSpinResID - Resource id for the associated Up/Down spinner control. - -Return Value: - - None - ---*/ -CUICtrlDefaultEditNum::CUICtrlDefaultEditNum( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT iPropMin, - _In_ CONST INT iPropMax, - _In_ CONST INT iSpinResID - ) : - m_szPropString(propString), - m_iEditResID(iEditResID), - m_iPropMin(iPropMin), - m_iPropMax(iPropMax), - m_iSpinResID(iSpinResID) - -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::~CUICtrlDefaultEditNum - -Routine Description: - - CUICtrlDefaultEditNum class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultEditNum::~CUICtrlDefaultEditNum() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING))) - { - INT iPos = 0; - TCHAR szItem[MAX_UISTRING_LEN]; - - if (SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast(&iPos), sizeof(iPos))) && - SUCCEEDED(hr = StringCchPrintf(szItem, MAX_UISTRING_LEN, TEXT("%d"), iPos))) - { - if (SetDlgItemText(hDlg, m_iEditResID, reinterpret_cast(szItem)) == 0) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any Edit Text change (EN_CHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case EN_CHANGE: - { - hr = OnEnChange(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::CheckInRange - -Routine Description: - - Ensures that a value is within range of the controls min/max extents. - -Arguments: - - pValue - pointer to the integer value to check. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::CheckInRange( - _In_ PINT pValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (*pValue > m_iPropMax) - { - *pValue = m_iPropMax; - } - - if (*pValue < m_iPropMin) - { - *pValue = m_iPropMin; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnEnChange - -Routine Description: - - This rountine handles the event of a change in the text box. The text in the control is read then - validated and the result is stored in the OEM private devmode. In addition the buddy spinner - control is updated to reflect the change in value. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditNum::OnEnChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - BOOL bTranslated; - - INT iPos = static_cast(GetDlgItemInt(hDlg, m_iEditResID, &bTranslated, TRUE)); - - if (bTranslated) - { - INT iOrgPos = 0; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast(&iOrgPos), sizeof(iOrgPos))) && - SUCCEEDED(hr = CheckInRange(&iPos)) && - iOrgPos != iPos) - { - SendDlgItemMessage(hDlg, m_iSpinResID, UDM_SETPOS32, 0, static_cast(iPos)); - - if (SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropString, reinterpret_cast(&iPos), sizeof(iPos)))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - } - } - else - { - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Edit control -// -/*++ - -Routine Name: - - CUICtrlDefaultSpin::CUICtrlDefaultSpin - -Routine Description: - - CUICtrlDefaultSpin class constructor. - - Requires a Text Box buddy control class. - Settings for this Spin control are taken from the buddy class. - -Arguments: - - pEdit - Pointer to the buddy Text Box control. - -Return Value: - - None - ---*/ -CUICtrlDefaultSpin::CUICtrlDefaultSpin( - _In_ CUICtrlDefaultEditNum * pEdit - ): - m_szPropString(0), - m_iSpinResID(0), - m_iPropMin(0), - m_iPropMax(0), - m_iEditResID(0) -{ - if (pEdit !=NULL) - { - m_szPropString = pEdit->m_szPropString; - m_iSpinResID = pEdit->m_iSpinResID; - m_iPropMin = pEdit->m_iPropMin; - m_iPropMax = pEdit->m_iPropMax; - m_iEditResID = pEdit->m_iEditResID; - } -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::~CUICtrlDefaultSpin - -Routine Description: - - CUICtrlDefaultSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultSpin::~CUICtrlDefaultSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - INT iPos = 0; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast(&iPos), sizeof(iPos)))) - { - SendDlgItemMessage(hDlg, m_iSpinResID, UDM_SETRANGE32, m_iPropMin, m_iPropMax); - SendDlgItemMessage(hDlg, m_iSpinResID, UDM_SETPOS32, 0, iPos); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::OnNotify - -Routine Description: - - Called from the property page handler when a WM_NOTIFY message is recieved. - Filters out any Up/Down position (UDN_DELTAPOS) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - pNmhdr - pointer to the notification message - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::OnNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNmhdr - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pNmhdr, E_POINTER))) - { - switch (pNmhdr->code) - { - case UDN_DELTAPOS: - { - hr = OnDeltaPos(hDlg, reinterpret_cast(pNmhdr)); - } - break; - - default: - hr = E_NOTIMPL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::CheckInRange - -Routine Description: - - Ensures that a value is within range of the controls min/max extents. - -Arguments: - - pValue - Pointer to the integer value to check. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::CheckInRange( - _In_ PINT pValue - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pValue, E_POINTER))) - { - if (*pValue > m_iPropMax) - { - *pValue = m_iPropMax; - } - - if (*pValue < m_iPropMin) - { - *pValue = m_iPropMin; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultSpin::OnDeltaPos - -Routine Description: - - This rountine handles the event of a change in value of the Up/Down control. The new value - of the control is validated and stored in the OEM private devmode. In addition the buddy text - box control is updated to reflect the change. - -Arguments: - - hDlg - handle to the parent window - pNmud - this structure contains information specific to up-down control messages - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultSpin::OnDeltaPos( - _In_ CONST HWND hDlg, - _In_ CONST NMUPDOWN* pNmud - ) -{ - HRESULT hr = S_OK; - INT iOrgPos = 0; - INT iPos = 0; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(pNmud, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast(&iOrgPos), sizeof(iOrgPos)))) - { - iPos = iOrgPos + pNmud->iDelta; - TCHAR szItem[MAX_UISTRING_LEN]; - - if (SUCCEEDED(hr = CheckInRange(&iPos)) && - iOrgPos != iPos && - SUCCEEDED(hr = StringCchPrintf(szItem, MAX_UISTRING_LEN, TEXT("%d"), iPos))) - { - if (SetDlgItemText(hDlg, m_iEditResID, reinterpret_cast(szItem)) > 0) - { - if (SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropString, reinterpret_cast(&iPos), sizeof(iPos)))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - } - else - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -// -// EditText control -// -/*++ - -Routine Name: - - CUICtrlDefaultEditText::CUICtrlDefaultEditText - -Routine Description: - - CUICtrlDefaultEditText class constructor - -Arguments: - - gpdString - Property name of the data associated with this control. - iEditResID - Resource id for the Combo Box control. - cbMaxLength - Maximum number of characters allowed. - -Return Value: - - None - ---*/ -CUICtrlDefaultEditText::CUICtrlDefaultEditText( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT cbMaxLength - ) : - m_szPropString(propString), - m_iEditResID(iEditResID), - m_cbMaxLength(cbMaxLength) - -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditText::~CUICtrlDefaultEditText - -Routine Description: - - CUICtrlDefaultEditText class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultEditText::~CUICtrlDefaultEditText() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditText::OnActivate - -Routine Description: - - Called when the parent property page becomes active. - This method initialises the state of the control to reflect the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditText::OnActivate( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING))) - { - SIZE_T cbBuffer = sizeof(TCHAR) * m_cbMaxLength; - LPTSTR lpBuffer = new(std::nothrow) TCHAR[m_cbMaxLength]; - - if (SUCCEEDED(hr = CHECK_POINTER(lpBuffer, E_OUTOFMEMORY))) - { - if (SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast(lpBuffer), cbBuffer)) && - SUCCEEDED(hr = CHECK_POINTER(lpBuffer, E_FAIL))) - { - if (SetDlgItemText(hDlg, m_iEditResID, reinterpret_cast(lpBuffer)) == 0) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - } - - delete[] lpBuffer; - lpBuffer = NULL; - } - } - - if (SUCCEEDED(hr)) - { - SendDlgItemMessage(hDlg, m_iEditResID, EM_LIMITTEXT, m_cbMaxLength - 1, 0L); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultEditText::OnCommand - -Routine Description: - - Called from the property page handler when a WM_COMMAND message is recieved. - Filters out any Edit Text change (EN_CHANGE) messages intended for this control. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - Command not implemented - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditText::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case EN_CHANGE: - { - hr = OnEnChange(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - - } - - ERR_ON_HR(hr); - return hr; -} - - -/*++ - -Routine Name: - - CUICtrlDefaultEditNum::OnEnChange - -Routine Description: - - This rountine handles the event of a change in the text box. - The text in the control is read and the result is stored in the OEM private devmode. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultEditText::OnEnChange( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - SIZE_T cbBuffer = sizeof(TCHAR) * m_cbMaxLength; - LPTSTR lpBuffer = new(std::nothrow) TCHAR[m_cbMaxLength]; - - if (SUCCEEDED(hr = CHECK_POINTER(lpBuffer, E_OUTOFMEMORY))) - { - if (GetDlgItemText(hDlg, m_iEditResID, lpBuffer, m_cbMaxLength) == 0) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - else - { - LPTSTR lpOrgBuffer = new(std::nothrow) TCHAR[m_cbMaxLength]; - - if (SUCCEEDED(hr = CHECK_POINTER(lpOrgBuffer, E_OUTOFMEMORY))) - { - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropString, reinterpret_cast(lpOrgBuffer), cbBuffer)) && - SUCCEEDED(hr = CHECK_POINTER(lpOrgBuffer, E_FAIL)) && - wcsncmp(lpBuffer, lpOrgBuffer, m_cbMaxLength) != 0 && - SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropString, reinterpret_cast(lpBuffer), cbBuffer))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - - delete[] lpOrgBuffer; - lpOrgBuffer = NULL; - } - } - - delete[] lpBuffer; - lpBuffer = NULL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::CUICtrlDefaultBtn - -Routine Description: - - CUICtrlDefaultBtn class constructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultBtn::CUICtrlDefaultBtn( - _In_ PCSTR propertyString, - _In_ INT iBtnResID - ) : - m_szPropertyString(propertyString), - m_iBtnResID(iBtnResID) -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::CUICtrlDefaultBtn - -Routine Description: - - CUICtrlDefaultBtn class constructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlDefaultBtn::~CUICtrlDefaultBtn() -{ -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::CUICtrlDefaultBtn - -Routine Description: - - Default button OnActivate handler. - -Arguments: - - None - -Return Value: - - S_OK - ---*/ -HRESULT -CUICtrlDefaultBtn::OnActivate( - _In_ CONST HWND - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CUICtrlDefaultBtn::OnCommand - -Routine Description: - - Default button OnCommand handler. - -Arguments: - - hDlg - handle to the parent window - iCommand - specifies the notification code - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlDefaultBtn::OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ) -{ - HRESULT hr = S_OK; - - switch (iCommand) - { - case BN_CLICKED: - { - hr = OnBnClicked(hDlg); - } - break; - - default: - hr = E_NOTIMPL; - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/uictrl.h b/print/XPSDrvSmpl/src/ui/uictrl.h deleted file mode 100644 index 5292e78b..00000000 --- a/print/XPSDrvSmpl/src/ui/uictrl.h +++ /dev/null @@ -1,405 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - uictrl.h - -Abstract: - - Definition of the UI control interface called by the containing property page, - the abstract UI control class and the base default UI controls for check boxe, - list, combo, edit and spin controls. - ---*/ - -#pragma once - -#include "UIProperties.h" - -class CUIControl -{ -public: - CUIControl(); - - virtual ~CUIControl(); - - virtual HRESULT - SetPrintOemDriverUI( - _In_ CONST IPrintOemDriverUI* pOEMDriverUI - ); - - virtual HRESULT - SetOemCUIPParam( - _In_ CONST POEMCUIPPARAM pOemCUIPParam - ); - - virtual HRESULT - SetUIProperties( - _In_ CUIProperties* pUIProperties - ); - - // - // Message handling stubs - // - virtual HRESULT - OnActivate( - _In_ CONST HWND hDlg - ) = 0; - - virtual HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - - virtual HRESULT - OnNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNmhdr - ); - -protected: - CComPtr m_pDriverUIHelp; - - POEMCUIPPARAM m_pOemCUIPParam; - - CUIProperties * m_pUIProperties; -}; - -class CUICtrlDefaultCheck : public CUIControl -{ -public: - CUICtrlDefaultCheck( - _In_ PCSTR gpdString, - _In_ INT iCheckResID - ); - - virtual ~CUICtrlDefaultCheck(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - virtual HRESULT - OnBnClicked( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - - CUICtrlDefaultCheck& operator = (CONST CUICtrlDefaultCheck&); - -private: - PCSTR m_szGPDString; - - CONST INT m_iCheckResID; -}; - -class CUICtrlDefaultList : public CUIControl -{ -public: - CUICtrlDefaultList( - _In_ PCSTR gpdString, - _In_ INT iListResID - ); - - virtual ~CUICtrlDefaultList(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -protected: - HRESULT - AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ); - -private: - virtual HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - - virtual HRESULT - OnSelChange( - _In_ CONST HWND hDlg - ); - - CUICtrlDefaultList& operator = (CONST CUICtrlDefaultList&); - -private: - PCSTR m_szGPDString; - - CONST INT m_iListResID; -}; - -class CUICtrlDefaultCombo : public CUIControl -{ -public: - CUICtrlDefaultCombo( - _In_ PCSTR gpdString, - _In_ INT iComboResID - ); - - virtual ~CUICtrlDefaultCombo(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - - virtual HRESULT - OnSelChange( - _In_ CONST HWND hDlg - ); - -protected: - HRESULT - AddString( - _In_ CONST HWND hDlg, - _In_ CONST HINSTANCE hStringResDLL, - _In_ CONST INT idString - ); - -private: - virtual HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - - CUICtrlDefaultCombo& operator = (CONST CUICtrlDefaultCombo&); - -private: - PCSTR m_szGPDString; - - CONST INT m_iComboResID; -}; - -class CUICtrlDefaultSpin; - -class CUICtrlDefaultEditNum : public CUIControl -{ -public: - CUICtrlDefaultEditNum( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT iPropMin, - _In_ CONST INT iPropMax, - _In_ CONST INT iSpinResID - ); - - virtual ~CUICtrlDefaultEditNum(); - - friend class CUICtrlDefaultSpin; - - HRESULT - virtual OnActivate( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - CUICtrlDefaultEditNum() : - m_iEditResID(0), - m_iPropMin(0), - m_iPropMax(0), - m_iSpinResID(0) - {} - - virtual HRESULT - CheckInRange( - _In_ PINT pValue - ); - - virtual HRESULT - OnEnChange( - _In_ CONST HWND hDlg - ); - - CUICtrlDefaultEditNum& operator = (CONST CUICtrlDefaultEditNum&); - - -private: - PCSTR m_szPropString; - - CONST INT m_iPropMin; - - CONST INT m_iPropMax; - - CONST INT m_iEditResID; - - CONST INT m_iSpinResID; -}; - -class CUICtrlDefaultSpin : public CUIControl -{ - -public: - CUICtrlDefaultSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlDefaultSpin(); - - virtual HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnNotify( - _In_ CONST HWND hDlg, - _In_ CONST NMHDR* pNmhdr - ); - - -private: - virtual HRESULT - CheckInRange( - _In_ PINT pValue - ); - - virtual HRESULT - OnDeltaPos( - _In_ CONST HWND hDlg, - _In_ CONST NMUPDOWN* pNmud - ); - - CUICtrlDefaultSpin& operator = (CONST CUICtrlDefaultSpin&); - -private: - PCSTR m_szPropString; - - INT m_iPropMin; - - INT m_iPropMax; - - INT m_iSpinResID; - - INT m_iEditResID; -}; - -class CUICtrlDefaultEditText : public CUIControl -{ -public: - CUICtrlDefaultEditText( - _In_ PCSTR propString, - _In_ CONST INT iEditResID, - _In_ CONST INT cbMaxLength - ); - - virtual ~CUICtrlDefaultEditText(); - - HRESULT - virtual OnActivate( - _In_ CONST HWND hDlg - ); - - virtual HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - virtual HRESULT - OnEnChange( - _In_ CONST HWND hDlg - ); - - CUICtrlDefaultEditText& operator = (CONST CUICtrlDefaultEditText&); - - -private: - PCSTR m_szPropString; - - CONST INT m_cbMaxLength; - - CONST INT m_iEditResID; -}; - -class CUICtrlDefaultBtn : public CUIControl -{ -public: - CUICtrlDefaultBtn( - _In_ PCSTR propertyString, - _In_ INT iCheckResID - ); - - virtual ~CUICtrlDefaultBtn(); - - HRESULT - OnActivate( - _In_ CONST HWND hDlg - ); - - HRESULT - OnCommand( - _In_ CONST HWND hDlg, - _In_ INT iCommand - ); - -private: - virtual HRESULT - OnBnClicked( - _In_ CONST HWND hDlg - ) = 0; - - CUICtrlDefaultBtn& operator = (CONST CUICtrlDefaultCheck&); - -protected: - PCSTR m_szPropertyString; - -private: - CONST INT m_iBtnResID; -}; - diff --git a/print/XPSDrvSmpl/src/ui/uiproperties.cpp b/print/XPSDrvSmpl/src/ui/uiproperties.cpp deleted file mode 100644 index c6ceb4e7..00000000 --- a/print/XPSDrvSmpl/src/ui/uiproperties.cpp +++ /dev/null @@ -1,783 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - uiproperties.cpp - -Abstract: - - This class encapsulates all handling of GPD and OEM private devmode settings - used in the XPSDrv feature sample UI. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "xdexcept.h" -#include "uiproperties.h" -#include "privatedefs.h" - -PCSTR g_pszPSScaleWidth = "PageScalingScaleWidth"; -PCSTR g_pszPSScaleHeight = "PageScalingScaleHeight"; -PCSTR g_pszOffsetWidth = "PageScalingOffsetWidth"; -PCSTR g_pszOffsetHeight = "PageScalingOffsetHeight"; -PCSTR g_pszWMTransparency = "PageWatermarkTransparency"; -PCSTR g_pszWMAngle = "PageWatermarkTextAngle"; -PCSTR g_pszWMOffsetWidth = "PageWatermarkOriginWidth"; -PCSTR g_pszWMOffsetHeight = "PageWatermarkOriginHeight"; -PCSTR g_pszWMSizeWidth = "PageWatermarkSizeWidth"; -PCSTR g_pszWMSizeHeight = "PageWatermarkSizeHeight"; -PCSTR g_pszWMFontSize = "PageWatermarkTextFontSize"; -PCSTR g_pszWMFontColor = "PageWatermarkTextColor"; -PCSTR g_pszWMText = "PageWatermarkTextText"; - -/*++ - -Routine Name: - - CUIProperties::CUIProperties - -Routine Description: - - CUIProperties default class constructor. - -Arguments: - - None. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CUIProperties::CUIProperties(): - m_pOEMDev(NULL) -{ - HRESULT hr = InitialiseMap(); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CUIProperties::CUIProperties - -Routine Description: - - CUIProperties class constructor. - -Arguments: - - pOEMDM - Pointer to an OEMDEV structure. - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CUIProperties::CUIProperties( - POEMDEV pOEMDM): - m_pOEMDev(pOEMDM) -{ - HRESULT hr = InitialiseMap(); - - if (FAILED(hr)) - { - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CUIProperties::~CUIProperties - -Routine Description: - - CUIProperties class destructor. - -Arguments: - - None - -Return Value: - - None - ---*/ -CUIProperties::~CUIProperties() -{ -} - -/*++ - -Routine Name: - - CUIProperties::InitialiseMap - -Routine Description: - - Creates a map of GPD names and private OEM devmode properties that will be used by the driver. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::InitialiseMap( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - // - // Initialise the OEM devmode entries - // - m_PropertyMap[g_pszPSScaleWidth] = UIPropertyPair(sizeof(DWORD), offsetof(OEMDEV, dwPgScaleX)); - m_PropertyMap[g_pszPSScaleHeight] = UIPropertyPair(sizeof(DWORD), offsetof(OEMDEV, dwPgScaleY)); - m_PropertyMap[g_pszOffsetWidth] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iPgOffsetX)); - m_PropertyMap[g_pszOffsetHeight] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iPgOffsetY)); - m_PropertyMap[g_pszWMTransparency] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMTransparency)); - m_PropertyMap[g_pszWMAngle] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMAngle)); - m_PropertyMap[g_pszWMFontSize] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMFontSize)); - m_PropertyMap[g_pszWMFontColor] = UIPropertyPair(sizeof(DWORD), offsetof(OEMDEV, dwColText)); - m_PropertyMap[g_pszWMOffsetWidth] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMOffsetX)); - m_PropertyMap[g_pszWMOffsetHeight] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMOffsetY)); - m_PropertyMap[g_pszWMSizeWidth] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMWidth)); - m_PropertyMap[g_pszWMSizeHeight] = UIPropertyPair(sizeof(INT), offsetof(OEMDEV, iWMHeight)); - m_PropertyMap[g_pszWMText] = UIPropertyPair(sizeof(TCHAR) * MAX_WATERMARK_TEXT, offsetof(OEMDEV, strWMText)); - - // - // Initialise the GPD OptItem entries. - // NOTE: These options will be removed from the standard Unidrv UI Treeview. - // - m_OptItemList.push_back("JobBindAllDocuments"); - m_OptItemList.push_back("DocumentBinding"); - m_OptItemList.push_back("PageColorManagement"); - m_OptItemList.push_back("PageSourceColorProfile"); - m_OptItemList.push_back("PageICMRenderingIntent"); - m_OptItemList.push_back("PageScaling"); - m_OptItemList.push_back("ScaleOffsetAlignment"); - m_OptItemList.push_back("PageWatermarkType"); - m_OptItemList.push_back("PageWatermarkLayering"); - m_OptItemList.push_back("JobNUpAllDocumentsContiguously"); - m_OptItemList.push_back("JobNUpContiguouslyPresentationOrder"); - m_OptItemList.push_back("DocumentNUp"); - m_OptItemList.push_back("DocumentNUpPresentationOrder"); - m_OptItemList.push_back("PageBorderless"); - m_OptItemList.push_back("PagePhotoPrintingIntent"); - m_OptItemList.push_back("DocumentDuplex"); - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::SetItem - -Routine Description: - - This method is used to set properties in the private OEM devmode. - -Arguments: - - pFeatureName - Pointer to the property name. - pUIProperty - Pointer to the property value. - cbSize - Size of the buffer pointed to by pUIProperty. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::SetItem( - _In_ PCSTR pFeatureName, - _In_reads_bytes_(cbSize) CONST UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - try - { - UIPropertyMap::const_iterator iterItem = m_PropertyMap.find(pFeatureName); - - if (iterItem != m_PropertyMap.end()) - { - if (iterItem->second.first >= cbSize) - { - memcpy(reinterpret_cast(m_pOEMDev) + iterItem->second.second, pUIProperty, cbSize); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::GetItem - - -Routine Description: - - This method is used to get properties in the private OEM devmode. - -Arguments: - - pFeatureName - Pointer to the property name. - pUIProperty - Pointer to the property value. - cbSize - Size of the buffer pointed to by pUIProperty. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::GetItem( - _In_ PCSTR pFeatureName, - _Out_writes_bytes_(cbSize) UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - try - { - UIPropertyMap::const_iterator iterItem = m_PropertyMap.find(pFeatureName); - - if (iterItem != m_PropertyMap.end()) - { - if (iterItem->second.first == cbSize) - { - memcpy(pUIProperty, reinterpret_cast(m_pOEMDev) + iterItem->second.second, cbSize); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - } - else - { - hr = E_INVALIDARG; - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::SetHeader - -Routine Description: - - Initialises the Unidrv private header portion of the OEM devmode. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::SetHeader() -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - // - //OEM_DMEXTRAHEADER Members - // - m_pOEMDev->dmOEMExtra.dwSize = sizeof(OEMDEV); - m_pOEMDev->dmOEMExtra.dwSignature = OEM_SIGNATURE; - m_pOEMDev->dmOEMExtra.dwVersion = OEM_VERSION; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::SetDefaults - -Routine Description: - - Initialises the OEM devmode with default values. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::SetDefaults() -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - if (SUCCEEDED(hr = SetHeader())) - { - // - //Private members - // - - // - // Page Scaling - // - m_pOEMDev->dwPgScaleX = pgscParamDefIntegers[ePageScalingScaleWidth].default_value; - m_pOEMDev->dwPgScaleY = pgscParamDefIntegers[ePageScalingScaleHeight].default_value; - m_pOEMDev->iPgOffsetX = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].default_value); - m_pOEMDev->iPgOffsetY = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].default_value); - - // - // Page Watermark - // - m_pOEMDev->iWMTransparency = wmParamDefIntegers[ePageWatermarkTransparency].default_value; - m_pOEMDev->iWMAngle = wmParamDefIntegers[ePageWatermarkAngle].default_value; - m_pOEMDev->iWMOffsetX = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].default_value); - m_pOEMDev->iWMOffsetY = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].default_value); - - m_pOEMDev->iWMFontSize = wmParamDefIntegers[ePageWatermarkTextFontSize].default_value; - m_pOEMDev->dwColText = wmParamDefIntegers[ePageWatermarkTextColor].default_value; - - try - { - CStringXD cstrWMText(wmParamDefStrings[ePageWatermarkTextText].default_value); - hr = StringCchCopyN(m_pOEMDev->strWMText, MAX_WATERMARK_TEXT, cstrWMText.GetBuffer(), cstrWMText.GetLength()); - } - catch (CXDException& e) - { - hr = e; - } - - m_pOEMDev->iWMWidth = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].default_value); - m_pOEMDev->iWMHeight = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].default_value); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::Convert - -Routine Description: - - This method is used to convert the OEM private devmode portion of this IUIProperty interface - given another interface as input. - -Arguments: - - pUIProperties - Pointer to the source IUIProperty interface to be converted. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::Convert( - _In_ CUIProperties * pUIProperties - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pUIProperties, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pUIProperties->m_pOEMDev, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - // - // Check OEM Signature, if it doesn't match ours, - // then just assume DMIn is bad and use defaults. - // - if (m_pOEMDev->dmOEMExtra.dwSignature == pUIProperties->m_pOEMDev->dmOEMExtra.dwSignature) - { - if (SUCCEEDED(hr = SetDefaults())) - { - // Copy the old structure in to the new using which ever size is the smaller. - // Devmode maybe from newer Devmode (not likely since there is only one), or - // Devmode maybe a newer Devmode, in which case it maybe larger, - // but the first part of the structure should be the same. - - // DESIGN ASSUMPTION: the private DEVMODE structure only gets added to; - // the fields that are in the DEVMODE never change only new fields get added to the end. - - DWORD dwSize = __min(m_pOEMDev->dmOEMExtra.dwSize, pUIProperties->m_pOEMDev->dmOEMExtra.dwSize); - memcpy(m_pOEMDev, pUIProperties->m_pOEMDev, dwSize); - - // Re-fill in the size and version fields to indicated - // that the DEVMODE is the current private DEVMODE version. - hr = SetHeader(); - } - } - else - { - hr = SetDefaults(); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::Validate - -Routine Description: - - This method is used to ensure that the OEM private devmode is validated. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::Validate() -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(m_pOEMDev, E_PENDING))) - { - // - // ASSUMPTION: pOEMDevmode is large enough to contain OEMDEV structure. - // Make sure that dmOEMExtra indicates the current OEMDEV structure. - // - if (SUCCEEDED(hr = SetHeader())) - { - // - // Page Scaling Members - // - if (m_pOEMDev->dwPgScaleX < static_cast(pgscParamDefIntegers[ePageScalingScaleWidth].min_length) || - m_pOEMDev->dwPgScaleX > static_cast(pgscParamDefIntegers[ePageScalingScaleWidth].max_length)) - { - m_pOEMDev->dwPgScaleX = static_cast(pgscParamDefIntegers[ePageScalingScaleWidth].default_value); - } - - if (m_pOEMDev->dwPgScaleY < static_cast(pgscParamDefIntegers[ePageScalingScaleHeight].min_length) || - m_pOEMDev->dwPgScaleY > static_cast(pgscParamDefIntegers[ePageScalingScaleHeight].max_length)) - { - m_pOEMDev->dwPgScaleY = static_cast(pgscParamDefIntegers[ePageScalingScaleHeight].default_value); - } - - if (m_pOEMDev->iPgOffsetX < MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].min_length) || - m_pOEMDev->iPgOffsetX > MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].max_length)) - { - m_pOEMDev->iPgOffsetX = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetWidth].default_value); - } - - if (m_pOEMDev->iPgOffsetY < MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].min_length) || - m_pOEMDev->iPgOffsetY > MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].max_length)) - { - m_pOEMDev->iPgOffsetY = MICRON_TO_HUNDREDTH_OFINCH(pgscParamDefIntegers[ePageScalingOffsetHeight].default_value); - } - - // - // Watermark Members - // - if (m_pOEMDev->iWMTransparency < wmParamDefIntegers[ePageWatermarkTransparency].min_length || - m_pOEMDev->iWMTransparency > wmParamDefIntegers[ePageWatermarkTransparency].max_length) - { - m_pOEMDev->iWMTransparency = wmParamDefIntegers[ePageWatermarkTransparency].default_value; - } - - if (m_pOEMDev->iWMAngle < wmParamDefIntegers[ePageWatermarkAngle].min_length || - m_pOEMDev->iWMAngle > wmParamDefIntegers[ePageWatermarkAngle].max_length) - { - m_pOEMDev->iWMAngle = wmParamDefIntegers[ePageWatermarkAngle].default_value; - } - - if (m_pOEMDev->iWMOffsetX < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].min_length) || - m_pOEMDev->iWMOffsetX > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].max_length)) - { - m_pOEMDev->iWMOffsetX = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].default_value); - } - - if (m_pOEMDev->iWMOffsetY < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].min_length) || - m_pOEMDev->iWMOffsetY > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].max_length)) - { - m_pOEMDev->iWMOffsetY = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].default_value); - } - - if (m_pOEMDev->iWMFontSize < wmParamDefIntegers[ePageWatermarkTextFontSize].min_length || - m_pOEMDev->iWMFontSize > wmParamDefIntegers[ePageWatermarkTextFontSize].max_length) - { - m_pOEMDev->iWMFontSize = wmParamDefIntegers[ePageWatermarkTextFontSize].default_value; - } - - if (m_pOEMDev->dwColText < static_cast(wmParamDefIntegers[ePageWatermarkTextColor].min_length) || - m_pOEMDev->dwColText > static_cast(wmParamDefIntegers[ePageWatermarkTextColor].max_length)) - { - m_pOEMDev->dwColText = wmParamDefIntegers[ePageWatermarkTextColor].default_value; - } - - if (m_pOEMDev->iWMWidth < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].min_length) || - m_pOEMDev->iWMWidth > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].max_length)) - { - m_pOEMDev->iWMWidth = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].default_value); - } - - if (m_pOEMDev->iWMHeight < MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].min_length) || - m_pOEMDev->iWMHeight > MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].max_length)) - { - m_pOEMDev->iWMHeight = MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].default_value); - } - - // - // Valid text is a NULL terminated string of length < MAX_WATERMARK_TEXT - // - size_t cch = 0; - if (FAILED(StringCchLength(m_pOEMDev->strWMText, MAX_WATERMARK_TEXT, &cch))) - { - try - { - CStringXD cstrWMText(wmParamDefStrings[ePageWatermarkTextText].default_value); - hr = StringCchCopyN(m_pOEMDev->strWMText, MAX_WATERMARK_TEXT, cstrWMText.GetBuffer(), cstrWMText.GetLength()); - } - catch (CXDException& e) - { - hr = e; - } - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::GetOptItem - -Routine Description: - - This method is used to get properties in the GPD. - -Arguments: - - pOemCUIPParam - Pointer to the POEMCUIPPARAM function. - pFeatureName - Pointer to a GPD property name. - ppOptItem - Address of a pointer that will be filled out with an OPTITEM structure. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::GetOptItem( - _In_ POEMCUIPPARAM pOemCUIPParam, - _In_ PCSTR pFeatureName, - _Outptr_result_maybenull_ POPTITEM* ppOptItem - ) -{ - HRESULT hr = S_OK; - POPTITEM pOIResult = NULL; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam->pDrvOptItems, E_PENDING)) && - SUCCEEDED(hr = CHECK_POINTER(pFeatureName, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppOptItem, E_POINTER))) - { - *ppOptItem = NULL; - - for (DWORD indexOptItem = 0; indexOptItem < pOemCUIPParam->cDrvOptItems; indexOptItem++) - { - pOIResult = &(pOemCUIPParam->pDrvOptItems[indexOptItem]); - - if (pOIResult->UserData != NULL) - { - PUSERDATA pUserData = reinterpret_cast(pOIResult->UserData); - if (SUCCEEDED(hr = CHECK_POINTER(pUserData->pKeyWordName, E_FAIL))) - { - if (strncmp(pUserData->pKeyWordName, pFeatureName, strlen(pFeatureName)) == 0) - { - hr = S_OK; - *ppOptItem = pOIResult; - break; - } - else - { - hr = E_ELEMENT_NOT_FOUND; - } - } - } - else - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUIProperties::HideOptItems - -Routine Description: - - Ensures that all GPD settings managed by the UI Plug-in are removed from the main Unidrv driver UI. - -Arguments: - - pOemCUIPParam - Pointer to the POEMCUIPPARAM function. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUIProperties::HideOptItems( - _In_ POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam->pDrvOptItems, E_PENDING))) - { - POPTITEM pOptItem = NULL; - - try - { - UIOptItemList::const_iterator iterOptItem = m_OptItemList.begin(); - - for (; iterOptItem != m_OptItemList.end() && SUCCEEDED(hr); iterOptItem++) - { - if (SUCCEEDED(hr = GetOptItem(pOemCUIPParam, *iterOptItem, &pOptItem)) && - SUCCEEDED(hr = CHECK_POINTER(pOptItem, E_FAIL))) - { - pOptItem->Flags |= OPTIF_HIDE; - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - - diff --git a/print/XPSDrvSmpl/src/ui/uiproperties.h b/print/XPSDrvSmpl/src/ui/uiproperties.h deleted file mode 100644 index 7fe0ab85..00000000 --- a/print/XPSDrvSmpl/src/ui/uiproperties.h +++ /dev/null @@ -1,111 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - uiproperties.h - -Abstract: - - This class encapsulates all handling of GPD and OEM private devmode settings - used in the XPSDrv feature sample UI. - ---*/ - -#pragma once - -#include "devmode.h" - -extern PCSTR g_pszPSScaleWidth; -extern PCSTR g_pszPSScaleHeight; -extern PCSTR g_pszOffsetWidth; -extern PCSTR g_pszOffsetHeight; -extern PCSTR g_pszWMTransparency; -extern PCSTR g_pszWMAngle; -extern PCSTR g_pszWMOffsetWidth; -extern PCSTR g_pszWMOffsetHeight; -extern PCSTR g_pszWMSizeWidth; -extern PCSTR g_pszWMSizeHeight; -extern PCSTR g_pszWMFontSize; -extern PCSTR g_pszWMFontColor; -extern PCSTR g_pszWMText; - -// -// Forward declaration -// -class CUIProperties; - -typedef VOID UIProperty; - -typedef pair UIPropertyPair; -typedef map UIPropertyMap; - -typedef vector UIOptItemList; - -class CUIProperties -{ -public: - CUIProperties(); - - CUIProperties(POEMDEV pOEMDev); - - virtual ~CUIProperties(); - - HRESULT - GetItem( - _In_ PCSTR pFeatureName, - _Out_writes_bytes_(cbSize) UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ); - - HRESULT - SetItem( - _In_ PCSTR pFeatureName, - _In_reads_bytes_(cbSize) CONST UIProperty* pUIProperty, - _In_ SIZE_T cbSize - ); - - HRESULT - SetDefaults(); - - HRESULT - Validate(); - - HRESULT - Convert( - _In_ CUIProperties* pUIProperties - ); - - HRESULT - GetOptItem( - _In_ POEMCUIPPARAM pOemCUIPParam, - _In_ PCSTR pFeatureName, - _Outptr_result_maybenull_ POPTITEM* ppOptItem - ); - - HRESULT - HideOptItems( - _In_ POEMCUIPPARAM pOemCUIPParam - ); - -private: - HRESULT SetHeader(); - - HRESULT InitialiseMap(); - -private: - POEMDEV m_pOEMDev; - - UIPropertyMap m_PropertyMap; - - UIOptItemList m_OptItemList; -}; - diff --git a/print/XPSDrvSmpl/src/ui/wmctrls.cpp b/print/XPSDrvSmpl/src/ui/wmctrls.cpp deleted file mode 100644 index 66647cc3..00000000 --- a/print/XPSDrvSmpl/src/ui/wmctrls.cpp +++ /dev/null @@ -1,1381 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmctrls.cpp - -Abstract: - - Implementation of the watermark specific UI controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "resource.h" -#include "wmctrls.h" -#include "privatedefs.h" - -PCSTR CUICtrlWMTypeCombo::m_pszWMType = "PageWatermarkType"; - -PCSTR CUICtrlWMLayeringCombo::m_pszWMLayering = "PageWatermarkLayering"; -PCSTR CUICtrlWMTransparencyEdit::m_pszWMTransparency = "PageWatermarkTransparency"; -PCSTR CUICtrlWMTransparencySpin::m_pszWMTransparency = "PageWatermarkTransparency"; -PCSTR CUICtrlWMAngleEdit::m_pszWMAngle = "PageWatermarkTextAngle"; -PCSTR CUICtrlWMAngleSpin::m_pszWMAngle = "PageWatermarkTextAngle"; -PCSTR CUICtrlWMOffsetXEdit::m_pszWMOffsetX = "PageWatermarkOriginWidth"; -PCSTR CUICtrlWMOffsetXSpin::m_pszWMOffsetX = "PageWatermarkOriginWidth"; -PCSTR CUICtrlWMOffsetYEdit::m_pszWMOffsetY = "PageWatermarkOriginHeight"; -PCSTR CUICtrlWMOffsetYSpin::m_pszWMOffsetY = "PageWatermarkOriginHeight"; - -PCSTR CUICtrlWMWidthEdit::m_pszWMWidth = "PageWatermarkSizeWidth"; -PCSTR CUICtrlWMWidthSpin::m_pszWMWidth = "PageWatermarkSizeWidth"; -PCSTR CUICtrlWMHeightEdit::m_pszWMHeight = "PageWatermarkSizeHeight"; -PCSTR CUICtrlWMHeightSpin::m_pszWMHeight = "PageWatermarkSizeHeight"; - -PCSTR CUICtrlWMTextEdit::m_pszWMText = "PageWatermarkTextText"; - -PCSTR CUICtrlWMFontSizeEdit::m_pszWMFontSize = "PageWatermarkTextFontSize"; -PCSTR CUICtrlWMFontSizeSpin::m_pszWMFontSize = "PageWatermarkTextFontSize"; - -PCSTR CUICtrlColorBtn::m_pszWMFontColor = "PageWatermarkTextColor"; - -#define WMTYPE_NONE_SEL 0 -#define WMTYPE_TEXT_SEL 1 -#define WMTYPE_RAST_SEL 2 -#define WMTYPE_VECT_SEL 3 - -// -// Watermark type combo box control -// -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::CUICtrlWMTypeCombo - -Routine Description: - - CUICtrlWMTypeCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTypeCombo::CUICtrlWMTypeCombo() : - CUICtrlDefaultCombo(m_pszWMType, IDC_COMBO_WMTYPE) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::~CUICtrlWMTypeCombo - -Routine Description: - - CUICtrlWMTypeCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTypeCombo::~CUICtrlWMTypeCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlWMTypeCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_NONE)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_TEXT)) && - SUCCEEDED(hr = AddString(hDlg, g_hInstance, IDS_GPD_RASTERIMAGE))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_VECTORIMAGE); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CUICtrlWMTypeCombo::EnableDependentCtrls - -Routine Description: - - This method is used to enable or disable other controls in the UI based on the - current combo box selection. - -Arguments: - - hDlg - handle to the parent window - lSel - current combo box selection - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlWMTypeCombo::EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ) -{ - HRESULT hr = S_OK; - HWND hWnd = NULL; - - BOOL bWatermarkEnabled = (lSel != WMTYPE_NONE_SEL); - BOOL bRasterType = (lSel == WMTYPE_RAST_SEL); - BOOL bVectorType = (lSel == WMTYPE_VECT_SEL); - BOOL bTextType = (lSel == WMTYPE_TEXT_SEL); - - // - // Common Watermark Properties - // - // Here we are enabling/disabling common watermark controls based off the current - // watermark option. - // - // If a watermark is selected we enable the layering, transparentcy offset and angle controls - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_COMBO_WMLAYERING), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMLAYERING), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMTRANSPARENCY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMTRANSPARENCY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMTRANSPARENCY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMANGLE), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMANGLE), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMANGLE), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMOFFX), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMOFFY), E_HANDLE))) - { - EnableWindow(hWnd, bWatermarkEnabled); - } - - // - // Vector / Bitmap Watermark Properties - // - // Here we are enabling/disabling vector/bitmap watermark controls based off the current - // watermark option. - // - // If a vector or bitmap watermark is selected we enable the width and height controls - // - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMWIDTH), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMWIDTH), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMWIDTH), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMHEIGHT), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMHEIGHT), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMHEIGHT), E_HANDLE))) - { - EnableWindow(hWnd, (bRasterType || bVectorType)); - ShowWindow(hWnd, (bRasterType || bVectorType) ? SW_SHOW : SW_HIDE); - } - - // - // Text Watermark Properties - // - // Here we are enabling/disabling text watermark controls based off the current - // watermark option. - // - // If a text watermark is selected we enable the text and font controls - // - if (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMTEXT), E_HANDLE))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMTEXT), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_EDIT_WMSIZE), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_SPIN_WMSIZE), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_TXT_WMSIZE), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (SUCCEEDED(hr) && - (SUCCEEDED(hr = CHECK_HANDLE(hWnd = GetDlgItem(hDlg, IDC_BUTTON_WMCOLOR), E_HANDLE)))) - { - EnableWindow(hWnd, bTextType); - ShowWindow(hWnd, bTextType ? SW_SHOW : SW_HIDE); - } - - if (FAILED(hr)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Watermark Layering combo box control -// -/*++ - -Routine Name: - - CUICtrlWMLayeringCombo::CUICtrlWMLayeringCombo - -Routine Description: - - CUICtrlWMLayeringCombo class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMLayeringCombo::CUICtrlWMLayeringCombo() : - CUICtrlDefaultCombo(m_pszWMLayering, IDC_COMBO_WMLAYERING) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMLayeringCombo::~CUICtrlWMLayeringCombo - -Routine Description: - - CUICtrlWMLayeringCombo class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMLayeringCombo::~CUICtrlWMLayeringCombo() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMLayeringCombo::OnInit - -Routine Description: - - This is responsible for initialising the control and is called when - the WM_INITDIALOG message is recieved. This method populates the combo - box with the appropriate option strings. - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlWMLayeringCombo::OnInit( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - // - // Populate the combo box - // - if (SUCCEEDED (hr = AddString(hDlg, g_hInstance, IDS_GPD_OVERLAYED))) - { - hr = AddString(hDlg, g_hInstance, IDS_GPD_UNDERLAYED); - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Watermark text combo box control -// -/*++ - -Routine Name: - - CUICtrlWMTextEdit::CUICtrlWMTextEdit - -Routine Description: - - CUICtrlWMTextEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTextEdit::CUICtrlWMTextEdit() : - CUICtrlDefaultEditText(m_pszWMText, - IDC_EDIT_WMTEXT, - MAX_WATERMARK_TEXT) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTextEdit::~CUICtrlWMTextEdit - -Routine Description: - - CUICtrlWMTextEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTextEdit::~CUICtrlWMTextEdit() -{ -} - -// -// Page Watermark Transparency -// - -/*++ - -Routine Name: - - CUICtrlWMTransparencyEdit::CUICtrlWMTransparencyEdit - -Routine Description: - - CUICtrlWMTransparencyEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencyEdit::CUICtrlWMTransparencyEdit() : - CUICtrlDefaultEditNum(m_pszWMTransparency, - IDC_EDIT_WMTRANSPARENCY, - wmParamDefIntegers[ePageWatermarkTransparency].min_length, - wmParamDefIntegers[ePageWatermarkTransparency].max_length, - IDC_SPIN_WMTRANSPARENCY) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTransparencyEdit::~CUICtrlWMTransparencyEdit - -Routine Description: - - CUICtrlWMTransparencyEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencyEdit::~CUICtrlWMTransparencyEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTransparencySpin::CUICtrlWMTransparencySpin - -Routine Description: - - CUICtrlWMTransparencySpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencySpin::CUICtrlWMTransparencySpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMTransparencySpin::~CUICtrlWMTransparencySpin - -Routine Description: - - CUICtrlWMTransparencySpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMTransparencySpin::~CUICtrlWMTransparencySpin() -{ -} - -// -// Page Watermark Angle -// - -/*++ - -Routine Name: - - CUICtrlWMAngleEdit::CUICtrlWMAngleEdit - -Routine Description: - - CUICtrlWMAngleEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleEdit::CUICtrlWMAngleEdit() : - CUICtrlDefaultEditNum(m_pszWMAngle, - IDC_EDIT_WMANGLE, - wmParamDefIntegers[ePageWatermarkAngle].min_length, - wmParamDefIntegers[ePageWatermarkAngle].max_length, - IDC_SPIN_WMANGLE) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMAngleEdit::~CUICtrlWMAngleEdit - -Routine Description: - - CUICtrlWMAngleEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleEdit::~CUICtrlWMAngleEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMAngleSpin::CUICtrlWMAngleSpin - -Routine Description: - - CUICtrlWMAngleSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleSpin::CUICtrlWMAngleSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMAngleSpin::~CUICtrlWMAngleSpin - -Routine Description: - - CUICtrlWMAngleSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMAngleSpin::~CUICtrlWMAngleSpin() -{ -} - -// -// Page Watermark Offset X -// - -/*++ - -Routine Name: - - CUICtrlWMOffsetXEdit::CUICtrlWMOffsetXEdit - -Routine Description: - - CUICtrlWMOffsetXEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXEdit::CUICtrlWMOffsetXEdit() : - CUICtrlDefaultEditNum(m_pszWMOffsetX, - IDC_EDIT_WMOFFX, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginWidth].max_length), - IDC_SPIN_WMOFFX) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetXEdit::~CUICtrlWMOffsetXEdit - -Routine Description: - - CUICtrlWMOffsetXEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXEdit::~CUICtrlWMOffsetXEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetXSpin::CUICtrlWMOffsetXSpin - -Routine Description: - - CUICtrlWMOffsetXSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXSpin::CUICtrlWMOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetXSpin::~CUICtrlWMOffsetXSpin - -Routine Description: - - CUICtrlWMOffsetXSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetXSpin::~CUICtrlWMOffsetXSpin() -{ -} - -// -// Page Watermark Offset Y -// - -/*++ - -Routine Name: - - CUICtrlWMOffsetYEdit::CUICtrlWMOffsetYEdit - -Routine Description: - - CUICtrlWMOffsetYEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYEdit::CUICtrlWMOffsetYEdit() : - CUICtrlDefaultEditNum(m_pszWMOffsetY, - IDC_EDIT_WMOFFY, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkOriginHeight].max_length), - IDC_SPIN_WMOFFY) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetYEdit::~CUICtrlWMOffsetYEdit - -Routine Description: - - CUICtrlWMOffsetYEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYEdit::~CUICtrlWMOffsetYEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetYSpin::CUICtrlWMOffsetYSpin - -Routine Description: - - CUICtrlWMOffsetYSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYSpin::CUICtrlWMOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMOffsetYSpin::~CUICtrlWMOffsetYSpin - -Routine Description: - - CUICtrlWMOffsetYSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMOffsetYSpin::~CUICtrlWMOffsetYSpin() -{ -} - -// -// Page Watermark Width -// - -/*++ - -Routine Name: - - CUICtrlWMWidthEdit::CUICtrlWMWidthEdit - -Routine Description: - - CUICtrlWMWidthEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthEdit::CUICtrlWMWidthEdit() : - CUICtrlDefaultEditNum(m_pszWMWidth, - IDC_EDIT_WMWIDTH, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeWidth].max_length), - IDC_SPIN_WMWIDTH) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMWidthEdit::~CUICtrlWMWidthEdit - -Routine Description: - - CUICtrlWMWidthEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthEdit::~CUICtrlWMWidthEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMWidthSpin::CUICtrlWMWidthSpin - -Routine Description: - - CUICtrlWMWidthSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthSpin::CUICtrlWMWidthSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMWidthSpin::~CUICtrlWMWidthSpin - -Routine Description: - - CUICtrlWMWidthSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMWidthSpin::~CUICtrlWMWidthSpin() -{ -} - -// -// Page Watermark Height -// - -/*++ - -Routine Name: - - CUICtrlWMHeightEdit::CUICtrlWMHeightEdit - -Routine Description: - - CUICtrlWMHeightEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightEdit::CUICtrlWMHeightEdit() : - CUICtrlDefaultEditNum(m_pszWMHeight, - IDC_EDIT_WMHEIGHT, - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].min_length), - MICRON_TO_HUNDREDTH_OFINCH(wmParamDefIntegers[ePageWatermarkSizeHeight].max_length), - IDC_SPIN_WMHEIGHT) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightEdit::~CUICtrlWMHeightEdit - -Routine Description: - - CUICtrlWMHeightEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightEdit::~CUICtrlWMHeightEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightSpin::CUICtrlWMHeightSpin - -Routine Description: - - CUICtrlWMHeightSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightSpin::CUICtrlWMHeightSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightSpin::~CUICtrlWMHeightSpin - -Routine Description: - - CUICtrlWMHeightSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMHeightSpin::~CUICtrlWMHeightSpin() -{ -} - -// -// Page Watermark Font Size -// - -/*++ - -Routine Name: - - CUICtrlWMFontSizeEdit::CUICtrlWMFontSizeEdit - -Routine Description: - - CUICtrlWMFontSizeEdit class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeEdit::CUICtrlWMFontSizeEdit() : - CUICtrlDefaultEditNum(m_pszWMFontSize, - IDC_EDIT_WMSIZE, - wmParamDefIntegers[ePageWatermarkTextFontSize].min_length, - wmParamDefIntegers[ePageWatermarkTextFontSize].max_length, - IDC_SPIN_WMSIZE) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMFontSizeEdit::~CUICtrlWMFontSizeEdit - -Routine Description: - - CUICtrlWMFontSizeEdit class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeEdit::~CUICtrlWMFontSizeEdit() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMHeightSpin::CUICtrlWMHeightSpin - -Routine Description: - - CUICtrlWMHeightSpin class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeSpin::CUICtrlWMFontSizeSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ) : - CUICtrlDefaultSpin(pEdit) -{ -} - -/*++ - -Routine Name: - - CUICtrlWMFontSizeSpin::~CUICtrlWMFontSizeSpin - -Routine Description: - - CUICtrlWMFontSizeSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlWMFontSizeSpin::~CUICtrlWMFontSizeSpin() -{ -} - -/*++ - -Routine Name: - - CUICtrlWMFontSizeSpin::~CUICtrlWMFontSizeSpin - -Routine Description: - - CUICtrlWMFontSizeSpin class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColorBtn::CUICtrlColorBtn() : - CUICtrlDefaultBtn(m_pszWMFontColor, IDC_BUTTON_WMCOLOR) -{ -} - -/*++ - -Routine Name: - - CUICtrlColorBtn::~CUICtrlColorBtn - -Routine Description: - - CUICtrlColorBtn class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CUICtrlColorBtn::~CUICtrlColorBtn() -{ -} - -/*++ - -Routine Name: - - CUICtrlColorBtn::OnBnClicked - -Routine Description: - - Color button clicked handler - -Arguments: - - hDlg - handle to the parent window - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CUICtrlColorBtn::OnBnClicked( - _In_ CONST HWND hDlg - ) -{ - HRESULT hr = S_OK; - - ASSERTMSG(m_pUIProperties != NULL, "NULL pointer to UI properties interface.\n"); - - DWORD colorText = 0; - if (SUCCEEDED(hr = CHECK_HANDLE(hDlg, E_HANDLE)) && - SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_PENDING)) && - SUCCEEDED(hr = m_pUIProperties->GetItem(m_szPropertyString, reinterpret_cast(&colorText), sizeof(colorText)))) - { - PBYTE pChannels = reinterpret_cast(&colorText); - - COLORREF colorsCust[16] = {0}; - COLORREF rgbIn = RGB(pChannels[2], pChannels[1], pChannels[0]); - - colorsCust[0] = rgbIn; - - CHOOSECOLOR chooseColor = { - sizeof(CHOOSECOLOR), - hDlg, - NULL, - colorText, - colorsCust, - CC_RGBINIT | CC_SOLIDCOLOR, - NULL, - NULL, - NULL - }; - - if (ChooseColor(&chooseColor) && - chooseColor.rgbResult != rgbIn) - { - pChannels[2] = GetRValue(chooseColor.rgbResult); - pChannels[1] = GetGValue(chooseColor.rgbResult); - pChannels[0] = GetBValue(chooseColor.rgbResult); - - if (SUCCEEDED(hr = m_pUIProperties->SetItem(m_szPropertyString, reinterpret_cast(&colorText), sizeof(colorText)))) - { - PropSheet_Changed(GetParent(hDlg), hDlg); - } - } - } - - ERR_ON_HR(hr); - return hr; -} - - diff --git a/print/XPSDrvSmpl/src/ui/wmctrls.h b/print/XPSDrvSmpl/src/ui/wmctrls.h deleted file mode 100644 index ed5e7d98..00000000 --- a/print/XPSDrvSmpl/src/ui/wmctrls.h +++ /dev/null @@ -1,259 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmctrls.h - -Abstract: - - Definition of the watermark specific UI controls. - ---*/ - -#pragma once - -#include "uictrl.h" - -class CUICtrlWMTypeCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlWMTypeCombo(); - - virtual ~CUICtrlWMTypeCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - HRESULT - EnableDependentCtrls( - _In_ CONST HWND hDlg, - _In_ CONST LONG lSel - ); - -private: - static PCSTR m_pszWMType; -}; - -class CUICtrlWMLayeringCombo : public CUICtrlDefaultCombo -{ -public: - CUICtrlWMLayeringCombo(); - - virtual ~CUICtrlWMLayeringCombo(); - - HRESULT - OnInit( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszWMLayering; -}; - -class CUICtrlWMTextEdit : public CUICtrlDefaultEditText -{ -public: - CUICtrlWMTextEdit(); - - virtual ~CUICtrlWMTextEdit(); - -private: - static PCSTR m_pszWMText; -}; - -class CUICtrlWMTransparencyEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMTransparencyEdit(); - - virtual ~CUICtrlWMTransparencyEdit(); - -private: - static PCSTR m_pszWMTransparency; -}; - -class CUICtrlWMTransparencySpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMTransparencySpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMTransparencySpin(); - -private: - static PCSTR m_pszWMTransparency; -}; - -class CUICtrlWMAngleEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMAngleEdit(); - - virtual ~CUICtrlWMAngleEdit(); - -private: - static PCSTR m_pszWMAngle; -}; - -class CUICtrlWMAngleSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMAngleSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMAngleSpin(); - -private: - static PCSTR m_pszWMAngle; -}; - -class CUICtrlWMOffsetXEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMOffsetXEdit(); - - virtual ~CUICtrlWMOffsetXEdit(); - -private: - static PCSTR m_pszWMOffsetX; -}; - -class CUICtrlWMOffsetXSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMOffsetXSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMOffsetXSpin(); - -private: - static PCSTR m_pszWMOffsetX; -}; - -class CUICtrlWMOffsetYEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMOffsetYEdit(); - - virtual ~CUICtrlWMOffsetYEdit(); - -private: - static PCSTR m_pszWMOffsetY; -}; - -class CUICtrlWMOffsetYSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMOffsetYSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMOffsetYSpin(); - -private: - static PCSTR m_pszWMOffsetY; -}; - -class CUICtrlWMWidthEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMWidthEdit(); - - virtual ~CUICtrlWMWidthEdit(); - -private: - static PCSTR m_pszWMWidth; -}; - -class CUICtrlWMWidthSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMWidthSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMWidthSpin(); - -private: - static PCSTR m_pszWMWidth; -}; - -class CUICtrlWMHeightEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMHeightEdit(); - - virtual ~CUICtrlWMHeightEdit(); - -private: - static PCSTR m_pszWMHeight; -}; - -class CUICtrlWMHeightSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMHeightSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMHeightSpin(); - -private: - static PCSTR m_pszWMHeight; -}; - -class CUICtrlWMFontSizeEdit : public CUICtrlDefaultEditNum -{ -public: - CUICtrlWMFontSizeEdit(); - - virtual ~CUICtrlWMFontSizeEdit(); - -private: - static PCSTR m_pszWMFontSize; -}; - -class CUICtrlWMFontSizeSpin : public CUICtrlDefaultSpin -{ -public: - CUICtrlWMFontSizeSpin( - _In_ CUICtrlDefaultEditNum* pEdit - ); - - virtual ~CUICtrlWMFontSizeSpin(); - -private: - static PCSTR m_pszWMFontSize; -}; - -class CUICtrlColorBtn : public CUICtrlDefaultBtn -{ -public: - CUICtrlColorBtn(); - - ~CUICtrlColorBtn(); - - HRESULT - OnBnClicked( - _In_ CONST HWND hDlg - ); - -private: - static PCSTR m_pszWMFontColor; -}; - diff --git a/print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp b/print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp deleted file mode 100644 index 22cfde42..00000000 --- a/print/XPSDrvSmpl/src/ui/wmdmptcnv.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmdmptcnv.cpp - -Abstract: - - PageWatermark devmode <-> PrintTicket conversion class implementation. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdstring.h" -#include "wmdmptcnv.h" -#include "wmpchndlr.h" - -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::EWatermarkOption; -using XDPrintSchema::PageWatermark::NoWatermark; -using XDPrintSchema::PageWatermark::TextWatermark; -using XDPrintSchema::PageWatermark::BitmapWatermark; -using XDPrintSchema::PageWatermark::VectorWatermark; -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::WatermarkData; -using XDPrintSchema::PageWatermark::WatermarkData; - -using XDPrintSchema::PageWatermark::Layering::ELayeringOption; -using XDPrintSchema::PageWatermark::Layering::Overlay; -using XDPrintSchema::PageWatermark::Layering::Underlay; - -// -// Look-up data converting GPD PageWatermarkType feature options to -// watermark type enumeration -// -PCSTR g_pszWatermarkTypeFeature = "PageWatermarkType"; -static GPDStringToOption g_watermarkTypeOption[] = { - {"None", NoWatermark}, - {"Text", TextWatermark}, - {"Raster", BitmapWatermark}, - {"Vector", VectorWatermark}, -}; -UINT g_cWatermarkTypeOption = sizeof(g_watermarkTypeOption)/sizeof(GPDStringToOption); - -// -// Look-up data converting GPD PageWatermarkLayering feature options to -// watermark layering enumeration -// -PCSTR g_pszLayeringFeature = "PageWatermarkLayering"; -static GPDStringToOption g_watermarkLayeringOption[] = { - {"Overlay", Overlay}, - {"Underlay", Underlay}, -}; -UINT g_cLayeringOption = sizeof(g_watermarkLayeringOption)/sizeof(GPDStringToOption); - -/*++ - -Routine Name: - - CWatermarkDMPTConv::CWatermarkDMPTConv - -Routine Description: - - CWatermarkDMPTConv class constructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkDMPTConv::CWatermarkDMPTConv() -{ -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::~CWatermarkDMPTConv - -Routine Description: - - CWatermarkDMPTConv class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkDMPTConv::~CWatermarkDMPTConv() -{ -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::GetPTDataSettingsFromDM - -Routine Description: - - Populates the watermark data structure from the Devmode passed in. - -Arguments: - - pDevmode - pointer to input devmode buffer. - cbDevmode - size in bytes of full input devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - pDataSettings - Pointer to watermark data structure to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ WatermarkData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Retrieve the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast(pPrivateDevmode)); - - DWORD dwTextColor = 0; - if (SUCCEEDED(hr) && - SUCCEEDED(hr = GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszWatermarkTypeFeature, - g_watermarkTypeOption, - g_cWatermarkTypeOption, - pDataSettings->type)) && - SUCCEEDED(hr = GetOptionFromGPDString(pDevmode, - cbDevmode, - g_pszLayeringFeature, - g_watermarkLayeringOption, - g_cLayeringOption, - pDataSettings->layering)) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMOffsetWidth, &pDataSettings->widthOrigin, sizeof(pDataSettings->widthOrigin))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMOffsetHeight, &pDataSettings->heightOrigin, sizeof(pDataSettings->heightOrigin))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMSizeWidth, &pDataSettings->widthExtent, sizeof(pDataSettings->widthExtent))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMSizeHeight, &pDataSettings->heightExtent, sizeof(pDataSettings->heightExtent))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMTransparency, &pDataSettings->transparency, sizeof(pDataSettings->transparency))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMAngle, &pDataSettings->angle, sizeof(pDataSettings->angle))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMFontSize, &pDataSettings->txtData.fontSize, sizeof(pDataSettings->txtData.fontSize))) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMFontColor, &dwTextColor, sizeof(dwTextColor)))) - { - // - // Convert the color to the txtData BSTR - // - try - { - CStringXDW cstrColor; - cstrColor.Format(L"#%08X", dwTextColor); - pDataSettings->txtData.bstrFontColor.Empty(); - pDataSettings->txtData.bstrFontColor.Attach(cstrColor.AllocSysString()); - } - catch (CXDException& e) - { - hr = e; - } - - TCHAR text[MAX_WATERMARK_TEXT + 1] = {0}; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = uiProperties.GetItem(g_pszWMText, text, MAX_WATERMARK_TEXT * sizeof(TCHAR)))) - { - pDataSettings->txtData.bstrText = text; - - // - // Convert measurements from 100ths of an inch to microns - // - pDataSettings->widthOrigin = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->widthOrigin); - pDataSettings->heightOrigin = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->heightOrigin); - pDataSettings->widthExtent = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->widthExtent); - pDataSettings->heightExtent = HUNDREDTH_OFINCH_TO_MICRON(pDataSettings->heightExtent); - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::MergePTDataSettingsWithPT - -Routine Description: - - This method updates the watermark data structure from a PrintTicket description. - -Arguments: - - pPrintTicket - Pointer to the input PrintTicket. - pDataSettings - Pointer to the watermark data structure - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ WatermarkData* pDataSettings - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pDataSettings, E_POINTER))) - { - try - { - // - // Get the watermark settings from the PrintTicket and set the options in - // the input Watermark data structure - // - WatermarkData wmData; - CWMPTHandler wmPTHndlr(pPrintTicket); - - if (SUCCEEDED(hr = wmPTHndlr.GetData(&wmData))) - { - // - // Only update settings relevant to the feature so that we do not unset - // other watermark settings in the devmode - // - pDataSettings->type = NoWatermark; - switch (wmData.type) - { - case TextWatermark: - { - pDataSettings->type = TextWatermark; - pDataSettings->widthOrigin = wmData.widthOrigin; - pDataSettings->heightOrigin = wmData.heightOrigin; - pDataSettings->transparency = wmData.transparency; - pDataSettings->angle = wmData.angle; - pDataSettings->layering = wmData.layering; - pDataSettings->txtData.bstrFontColor = wmData.txtData.bstrFontColor; - pDataSettings->txtData.fontSize = wmData.txtData.fontSize; - pDataSettings->txtData.bstrText = wmData.txtData.bstrText; - } - break; - - case BitmapWatermark: - { - pDataSettings->type = BitmapWatermark; - pDataSettings->widthOrigin = wmData.widthOrigin; - pDataSettings->heightOrigin = wmData.heightOrigin; - pDataSettings->widthExtent = wmData.widthExtent; - pDataSettings->heightExtent = wmData.heightExtent; - pDataSettings->transparency = wmData.transparency; - pDataSettings->angle = wmData.angle; - pDataSettings->layering = wmData.layering; - } - break; - - case VectorWatermark: - { - pDataSettings->type = VectorWatermark; - pDataSettings->widthOrigin = wmData.widthOrigin; - pDataSettings->heightOrigin = wmData.heightOrigin; - pDataSettings->widthExtent = wmData.widthExtent; - pDataSettings->heightExtent = wmData.heightExtent; - pDataSettings->transparency = wmData.transparency; - pDataSettings->angle = wmData.angle; - pDataSettings->layering = wmData.layering; - } - break; - - case NoWatermark: - break; - - default: - { - WARNING("Unrecognized watermark feature - setting to default\n"); - } - break; - } - } - else if (hr == E_ELEMENT_NOT_FOUND) - { - // - // Watermark setting not in the PT - this is not an error. Just - // leave the type as NoWatermark and reset the HRESULT to S_OK - // - hr = S_OK; - } - } - catch (CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::SetPTDataInDM - -Routine Description: - - This method updates the watermark options in the devmode from the UI Settings. - -Arguments: - - dataSettings - Reference to watermark data settings to be updated. - pDevmode - pointer to devmode to be updated. - cbDevmode - size in bytes of full devmode. - pPrivateDevmode - pointer to input private devmode buffer. - cbDrvPrivateSize - size in bytes of private devmode. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::SetPTDataInDM( - _In_ CONST WatermarkData& dataSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - // - // Convert from microns to 100ths of an inch before writing to the DevMode - // - if (SUCCEEDED(hr)) - { - INT widthOrigin = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.widthOrigin); - INT heightOrigin = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.heightOrigin); - INT widthExtent = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.widthExtent); - INT heightExtent = MICRON_TO_HUNDREDTH_OFINCH(dataSettings.heightExtent); - - // - // Set the GPD and devmode controlled settings - // - CUIProperties uiProperties(static_cast(pPrivateDevmode)); - if (SUCCEEDED(hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszWatermarkTypeFeature, - g_watermarkTypeOption, - g_cWatermarkTypeOption, - dataSettings.type)) && - SUCCEEDED(hr = SetGPDStringFromOption(pDevmode, - cbDevmode, - g_pszLayeringFeature, - g_watermarkLayeringOption, - g_cLayeringOption, - dataSettings.layering)) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMOffsetWidth, &widthOrigin, sizeof(widthOrigin))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMOffsetHeight, &heightOrigin, sizeof(heightOrigin))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMSizeWidth, &widthExtent, sizeof(widthExtent))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMSizeHeight, &heightExtent, sizeof(heightExtent))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMTransparency, &dataSettings.transparency, sizeof(dataSettings.transparency))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMAngle, &dataSettings.angle, sizeof(dataSettings.angle))) && - SUCCEEDED(hr = uiProperties.SetItem(g_pszWMFontSize, &dataSettings.txtData.fontSize, sizeof(dataSettings.txtData.fontSize)))) - { - try - { - // - // Convert the font color to a channel array - // - BYTE fontColor[4] = {0}; - CStringXDW cstrFontColor(dataSettings.txtData.bstrFontColor); - cstrFontColor.Trim(); - if (cstrFontColor.Find(L"#") == 0) - { - cstrFontColor.Delete(0); - cstrFontColor.Trim(); - } - - cstrFontColor.Truncate(8); - INT cChannel = 3; - while (cstrFontColor.GetLength() > 0 && - cChannel < sizeof(DWORD) && - cChannel >= 0) - { - // - // Add the data a channel at a time so we dont overflow wcstol - // -#pragma prefast(suppress:__WARNING_MUST_USE, "All possible two-digit hex numbers are valid.") - fontColor[cChannel] = static_cast(wcstol(cstrFontColor.Left(2), NULL, 16)); - - // - // Delete the channel from the color ref string - // - cstrFontColor.Delete(0, 2); - - // - // Traverse array in reverse to correct for endianness - // - cChannel--; - } - - hr = uiProperties.SetItem(g_pszWMFontColor, fontColor, sizeof(DWORD)); - - // - // Set the text string - // - if (SUCCEEDED(hr)) - { - CStringXD text(dataSettings.txtData.bstrText); - text.Truncate(MAX_WATERMARK_TEXT); - - hr = uiProperties.SetItem(g_pszWMText, text.GetBuffer(), (text.GetLength() + 1) * sizeof(TCHAR)); - } - } - catch (CXDException& e) - { - hr = e; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::SetPTDataInPT - -Routine Description: - - This method updates the watemark PrintTicket description from watermark data structure. - -Arguments: - - drvSettings - Reference to watermark data structure to update from. - pPrintTicket - Pointer to the PrintTicket to be updated. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkDMPTConv::SetPTDataInPT( - _In_ CONST WatermarkData& dataSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - try - { - CWMPTHandler wmPTHndlr(pPrintTicket); - hr = wmPTHndlr.SetData(&dataSettings); - } - catch (CXDException& e) - { - hr = e; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CWatermarkDMPTConv::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CWatermarkDMPTConv::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - CWMPCHandler watermarkpcHandler(pPrintCapabilities); - watermarkpcHandler.SetCapabilities(); - } - catch(CXDException& e) - { - hr = e; - } - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/wmdmptcnv.h b/print/XPSDrvSmpl/src/ui/wmdmptcnv.h deleted file mode 100644 index 37b8a8ae..00000000 --- a/print/XPSDrvSmpl/src/ui/wmdmptcnv.h +++ /dev/null @@ -1,75 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmdmptcnv.h - -Abstract: - - PageWatermark devmode <-> PrintTicket conversion class definition. - The class defines a common data representation between the DevMode (GPD) and PrintTicket - representations and implements the conversion and validation methods required - by CFeatureDMPTConvert. - ---*/ - -#pragma once - -#include "ftrdmptcnv.h" -#include "wmpthndlr.h" -#include "uiproperties.h" - -class CWatermarkDMPTConv : public CFeatureDMPTConvert -{ -public: - CWatermarkDMPTConv(); - - ~CWatermarkDMPTConv(); - -private: - HRESULT - GetPTDataSettingsFromDM( - _In_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _In_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize, - _Out_ XDPrintSchema::PageWatermark::WatermarkData* pDataSettings - ); - - HRESULT - MergePTDataSettingsWithPT( - _In_ IXMLDOMDocument2* pPrintTicket, - _Inout_ XDPrintSchema::PageWatermark::WatermarkData* pDrvSettings - ); - - HRESULT - SetPTDataInDM( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData& drvSettings, - _Inout_ PDEVMODE pDevmode, - _In_ ULONG cbDevmode, - _Inout_ PVOID pPrivateDevmode, - _In_ ULONG cbDrvPrivateSize - ); - - HRESULT - SetPTDataInPT( - _In_ CONST XDPrintSchema::PageWatermark::WatermarkData& drvSettings, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2*, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/wmppg.cpp b/print/XPSDrvSmpl/src/ui/wmppg.cpp deleted file mode 100644 index 64faee63..00000000 --- a/print/XPSDrvSmpl/src/ui/wmppg.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmppg.cpp - -Abstract: - - Implementation of the watermark property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "resource.h" -#include "wmppg.h" -#include "wmctrls.h" - -/*++ - -Routine Name: - - CWatermarkPropPage::CWatermarkPropPage - -Routine Description: - - CWatermarkPropPage class constructor. - Creates a handler class object for every control on the watermark property page. - Each of these handlers is stored in a collection. - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CWatermarkPropPage::CWatermarkPropPage() -{ - HRESULT hr = S_OK; - - try - { - CUIControl* pControl = new(std::nothrow) CUICtrlWMTypeCombo(); - - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_WMTYPE, pControl); - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMLayeringCombo(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_COMBO_WMLAYERING, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMTextEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_EDIT_WMTEXT, pControl); - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMTransparencyEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMTRANSPARENCY, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMTransparencySpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMTRANSPARENCY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMAngleEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMANGLE, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMAngleSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMANGLE, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMOffsetXEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMOFFX, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMOffsetXSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMOFFX, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMOffsetYEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMOFFY, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMOffsetYSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMOFFY, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMWidthEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMWIDTH, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMWidthSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMWIDTH, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMHeightEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMHEIGHT, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMHeightSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMHEIGHT, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlWMFontSizeEdit(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY)) && - SUCCEEDED(hr = AddUIControl(IDC_EDIT_WMSIZE, pControl))) - { - pControl = new(std::nothrow) CUICtrlWMFontSizeSpin(reinterpret_cast(pControl)); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_SPIN_WMSIZE, pControl); - } - } - } - - if (SUCCEEDED(hr)) - { - pControl = new(std::nothrow) CUICtrlColorBtn(); - if (SUCCEEDED(hr = CHECK_POINTER(pControl, E_OUTOFMEMORY))) - { - hr = AddUIControl(IDC_BUTTON_WMCOLOR, pControl); - } - } - } - catch (CXDException& e) - { - hr = e; - } - - if (FAILED(hr)) - { - DestroyUIComponents(); - throw CXDException(hr); - } -} - -/*++ - -Routine Name: - - CWatermarkPropPage::~CWatermarkPropPage - -Routine Description: - - CWatermarkPropPage class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CWatermarkPropPage::~CWatermarkPropPage() -{ -} - -/*++ - -Routine Name: - - CWatermarkPropPage::InitDlgBox - -Routine Description: - - Provides the base class with the data required to intialise the dialog box. - -Arguments: - - ppszTemplate - Pointer to dialog box template to be intialised. - ppszTitle - Pointer to dialog box title to be intialised. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CWatermarkPropPage::InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(ppszTemplate, E_POINTER)) || - SUCCEEDED(hr = CHECK_POINTER(ppszTitle, E_POINTER))) - { - *ppszTemplate = MAKEINTRESOURCE(IDD_WATERMARK); - *ppszTitle = MAKEINTRESOURCE(IDS_WMARK); - } - - ERR_ON_HR(hr); - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/wmppg.h b/print/XPSDrvSmpl/src/ui/wmppg.h deleted file mode 100644 index e28d5ea5..00000000 --- a/print/XPSDrvSmpl/src/ui/wmppg.h +++ /dev/null @@ -1,42 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - wmppg.h - -Abstract: - - Definiiion of the watermark property page. This class is - responsible for initialising and registering the color management - property page and its controls. - ---*/ - -#pragma once - -#include "precomp.h" -#include "docppg.h" - -class CWatermarkPropPage : public CDocPropPage -{ -public: - CWatermarkPropPage(); - - virtual ~CWatermarkPropPage(); - - HRESULT - InitDlgBox( - _Out_ LPCTSTR* ppszTemplate, - _Out_ LPCTSTR* ppszTitle - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplcf.cpp b/print/XPSDrvSmpl/src/ui/xdsmplcf.cpp deleted file mode 100644 index abbdb3e4..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplcf.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplcf.cpp - -Abstract: - - XPSDrv feature sample class factory implementation. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "xdsmplcf.h" -#include "xdsmplui.h" -#include "xdsmplptprov.h" - -/*++ - -Routine Name: - - CXDSmplUICF::CreateInstance - -Routine Description: - - Creates an object of the specified CLSID and retrieves an interface pointer to this object. - The supported class objects are currently IPrintOemUI and IPrintOemPrintTicketProvider. - -Arguments: - - pUnkOuter - This must be NULL, as aggregare object creation is not supported. - riid - The IID of the requested interface. - ppvObject - A pointer to the interface pointer identified by riid. - If the object does not support this interface, ppvObj is set to NULL. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUICF::CreateInstance( - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _Outptr_ PVOID* ppvObject - ) -{ - HRESULT hr = S_OK; - - if (ppvObject == NULL) - { - hr = E_POINTER; - goto Exit; - } - *ppvObject = NULL; - - if (pUnkOuter == NULL) - { - // - // Create UI component - // - CXDSmplUI* pXDSmplUI = NULL; - - try - { - pXDSmplUI = new(std::nothrow) CXDSmplUI; - hr = CHECK_POINTER(pXDSmplUI, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - // - // Get the requested interface - // - hr = pXDSmplUI->QueryInterface(riid, ppvObject) ; - - // - // Release the IUnknown pointer. If QueryInterface failed - // the Release() call will clean up - // - pXDSmplUI->Release(); - - // - // If QueryInterface failed this could be a request for the - // PTProvider Interface - // - if (FAILED(hr)) - { - CXDSmplPTProvider* pXDSmplPT = NULL; - - try - { - pXDSmplPT = new(std::nothrow) CXDSmplPTProvider; - hr = CHECK_POINTER(pXDSmplPT, E_OUTOFMEMORY); - } - catch (CXDException& e) - { - _Analysis_assume_((*ppvObject) == NULL); - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - - if (SUCCEEDED(hr)) - { - hr = pXDSmplPT->QueryInterface(riid, ppvObject) ; - - // - // Release the IUnknown pointer. - // (If QueryInterface failed, component will delete itself.) - // - pXDSmplPT->Release(); - } - } - } - } - else - { - // - // Cannot aggregate - // - hr = CLASS_E_NOAGGREGATION; - } - -Exit: - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUICF::LockServer - -Routine Description: - - Increments and decrements the UI Plug-in Module lock count. - -Arguments: - - bLock - If TRUE, the lock count is incremented; otherwise, the lock count is decremented. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUICF::LockServer( - BOOL bLock - ) -{ - if (bLock) - { - InterlockedIncrement(&g_cServerLocks); - } - else - { - InterlockedDecrement(&g_cServerLocks); - } - - return S_OK; -} - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplcf.h b/print/XPSDrvSmpl/src/ui/xdsmplcf.h deleted file mode 100644 index ae1a78c8..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplcf.h +++ /dev/null @@ -1,56 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplcf.cpp - -Abstract: - - XPSDrv feature sample class factory definition. - ---*/ - -#pragma once - -#include "cunknown.h" - -class CXDSmplUICF : public CUnknown -{ -public: - // - // Constructor and Destruction - // - CXDSmplUICF() : - CUnknown(IID_IClassFactory) - { - } - - virtual ~CXDSmplUICF() - { - } - - // - // IClassFactory methods - // - virtual HRESULT STDMETHODCALLTYPE - CreateInstance( - _In_opt_ LPUNKNOWN pUnkOuter, - _In_ REFIID riid, - _Outptr_ PVOID* ppvObject - ); - - virtual HRESULT STDMETHODCALLTYPE - LockServer( - BOOL bLock - ); -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmpldlg.rc b/print/XPSDrvSmpl/src/ui/xdsmpldlg.rc deleted file mode 100644 index bfbdee3f..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmpldlg.rc +++ /dev/null @@ -1,326 +0,0 @@ -// -// Copyright (c) 2005 Microsoft Corporation -// -// All rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// File Name: -// -// xdsmpldlg.rc -// -// Abstract: -// -// XPSDrv sample driver UI plug-in resource file. -// -// - -#include "winres.h" -#include "resource.h" -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPSDrv Sample UI Plug-In" -#define VER_INTERNALNAME_STR "PrintFeatureFilters" - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// - -#include "common.ver" - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_COL_MANAGE DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - LISTBOX IDC_LIST_COLPROF,21,63,252,82,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Select color profile",IDC_TEXT_COLPROF,22,51,89,8 - GROUPBOX "",IDC_GRP_COLPROF,4,4,288,192 - COMBOBOX IDC_COMBO_COL_MANAGE,137,28,135,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Select Color Management Method",IDC_TXT_COL_MANAGE,24,31,108,8 - LTEXT "Select ICM Rendering Intent",IDC_TXT_COL_INTENT,24,164,92,8 - COMBOBOX IDC_COMBO_COL_INTENT,137,162,135,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -END - -IDD_WATERMARK DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - COMBOBOX IDC_COMBO_WMTYPE,14,32,107,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Watermark Type",IDC_TXT_WMTYPE,14,21,65,8 - COMBOBOX IDC_COMBO_WMLAYERING,14,66,75,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Layering",IDC_TXT_WMLAYERING,14,55,65,8 - GROUPBOX "Settings",IDC_GRP_WM,4,4,284,192 - EDITTEXT IDC_EDIT_WMTEXT,14,131,107,14, ES_AUTOHSCROLL - LTEXT "Text",IDC_TXT_WMTEXT,14,120,65,8 - EDITTEXT IDC_EDIT_WMTRANSPARENCY,236,65,33,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMTRANSPARENCY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,260,65,11,14 - EDITTEXT IDC_EDIT_WMANGLE,133,66,33,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMANGLE,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,157,66,11,14 - EDITTEXT IDC_EDIT_WMOFFX,70,96,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMOFFX,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,109,96,11,14 - EDITTEXT IDC_EDIT_WMOFFY,190,96,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMOFFY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,229,96,11,14 - LTEXT "Transparency",IDC_TXT_WMTRANSPARENCY,186,68,45,8 - LTEXT "Angle",IDC_TXT_WMANGLE,104,68,23,8 - LTEXT "Offset X .01""",IDC_TXT_WMOFFX,17,99,43,8 - LTEXT "Offset Y .01""",IDC_TXT_WMOFFY,140,98,43,8 - EDITTEXT IDC_EDIT_WMWIDTH,70,125,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMWIDTH,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,108,125,11,14 - EDITTEXT IDC_EDIT_WMHEIGHT,190,125,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMHEIGHT,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,229,125,11,14 - LTEXT "Width .01""",IDC_TXT_WMWIDTH,17,128,51,8 - LTEXT "Height .01""",IDC_TXT_WMHEIGHT,140,127,37,8 - EDITTEXT IDC_EDIT_WMSIZE,129,163,33,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_WMSIZE,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,158,163,11,14 - LTEXT "Size",IDC_TXT_WMSIZE,104,166,18,8 - PUSHBUTTON "Color",IDC_BUTTON_WMCOLOR,27,163,50,14 -END - -IDD_FEATURES DIALOGEX 0, 0, 296, 200 -STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - GROUPBOX "Page Scaling",IDC_GRP_PGSCALE,4,2,285,56 - GROUPBOX "Document Multi-Up",IDC_GRP_DOCNUP,4,61,285,45 - COMBOBOX IDC_COMBO_PGSCALE,11,28,88,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Scaling Option",IDC_TXT_PGSCALE,11,18,46,8 - COMBOBOX IDC_COMBO_SCALEOFF,144,28,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Scale Offset Alignment",IDC_TXT_SCALEOFF,144,17,88,8 - EDITTEXT IDC_EDIT_PGSCALEX,138,14,40,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGSCALEX,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,168,14,10,14 - EDITTEXT IDC_EDIT_PGOFFX,234,14,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGOFFX,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,273,14,10,14 - EDITTEXT IDC_EDIT_PGSCALEY,138,38,40,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGSCALEY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,168,38,10,14 - EDITTEXT IDC_EDIT_PGOFFY,234,38,50,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_SPIN_PGOFFY,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,273,38,10,14 - LTEXT "Scale X",IDC_TXT_PGSCALEX,108,18,25,8 - LTEXT "Scale Y",IDC_TXT_PGSCALEY,108,40,25,8 - LTEXT "Offset X .01""",IDC_TXT_PGOFFX,187,17,42,8 - LTEXT "Offset Y .01""",IDC_TXT_PGOFFY,187,40,42,8 - COMBOBOX IDC_COMBO_NUP,11,81,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO_NUP_ORDER,155,81,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Number Up",IDC_TXT_NUP,11,70,36,8 - LTEXT "Presentation Order",IDC_TXT_NUP_ORDER,155,70,88,8 - COMBOBOX IDC_COMBO_PHOTO_INTENT,93,176,83,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Page Photo Printing Intent",IDC_TXT_PHOTO_INTENT,93,165,86,8 - CONTROL "Enable Borderless Pages",IDC_CHECK_BORDERLESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,177,94,10 - COMBOBOX IDC_COMBO_DOCDUPLEX,11,176,68,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Duplex Option",IDC_TXT_DOCDUPLEX,11,165,46,8 - GROUPBOX "Other",IDC_STATIC,4,157,285,38 - LTEXT "Job Binding (all documents)",IDC_TXT_JOBBIND,11,118,100,8 - COMBOBOX IDC_COMBO_JOBBIND,11,129,115,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Binding Option",IDC_STATIC,4,109,285,45 - LTEXT "Document Binding",IDC_TXT_DOCBIND,155,118,100,8 - COMBOBOX IDC_COMBO_DOCBIND,155,129,114,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP -END - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_COLMAN "Color Management" - IDS_WMARK "Watermarks" - IDS_FEATURE "Features" -END - -STRINGTABLE -BEGIN - IDS_GPD_1PPS "1 Page per Sheet" - IDS_GPD_2PPS "2 Page per Sheet" - IDS_GPD_4PPS "4 Page per Sheet" - IDS_GPD_6PPS "6 Page per Sheet" - IDS_GPD_8PPS "8 Page per Sheet" - IDS_GPD_9PPS "9 Page per Sheet" - IDS_GPD_16PPS "16 Page per Sheet" - IDS_GPD_RES1200 "1200 x 1200 dpi" - IDS_GPD_RES600 "600 x 600 dpi" - IDS_GPD_AUTOMATIC "Automatic" - IDS_GPD_BORDERED "Bordered" - IDS_GPD_BORDERLESS "Borderless" - IDS_GPD_BTOT "Bottom to Top" - IDS_GPD_BTOTLTOR "Bottom to Top, Left to Right" - IDS_GPD_BTOTRTOL "Bottom to Top, Right to Left" - IDS_GPD_CMYK "CMYK" -END - -STRINGTABLE -BEGIN - IDS_GPD_COLOR "Color" - IDS_GPD_CONFIDENTIAL "Confidential" - IDS_GPD_CUSTSQUARE "Custom Square" - IDS_GPD_CUSTOM "Custom" - IDS_GPD_SRCCOLPROF "Source Color Profile" - IDS_GPD_DEVICE "Device" - IDS_GPD_DOCBIND "Document Binding" - IDS_GPD_PAGECOLMAN "Page Color Management" - IDS_GPD_PAGEPHOTINTENT "Page Photo Printing Intent" - IDS_GPD_DOCDUPLEX "Document Duplex" - IDS_GPD_DOCNUP "Document NUp" - IDS_GPD_DOCNUPPRESENTORDER "Document NUp Presentation Order" - IDS_GPD_DRAFT "Draft" - IDS_GPD_DRIVER "Driver" - IDS_GPD_DUPLEX "Duplex" - IDS_GPD_FAX "Fax" -END - -STRINGTABLE -BEGIN - IDS_GPD_FITBLEED "Fit Bleed Size" - IDS_GPD_FITCONTENT "Fit Content Size" - IDS_GPD_FITPAGE "Fit Page Size" - IDS_GPD_GLOSSY "Glossy" - IDS_GPD_GRAYSCALE "Grayscale" - IDS_GPD_HIGH "High" - IDS_GPD_HORIZONTAL "Horizontal" - IDS_GPD_JOBBINDING "Job Binding (all documents)" - IDS_GPD_JOBNUPPRESENTORDER "Job NUp Presentation Order" - IDS_GPD_JOBNUP "Job NUp (contigously)" - IDS_GPD_JOBPAGEORDER "Job Page Order" - IDS_GPD_LANDSCAPE "Landscape" - IDS_GPD_LTOR "Left to Right" - IDS_GPD_LTORBTOT "Left to Right, Bottom to Top" - IDS_GPD_LTORTTOB "Left to Right, Top to Bottom" - IDS_GPD_MEDIATYPE "Media Type" -END - -STRINGTABLE -BEGIN - IDS_GPD_MONO "Mono" - IDS_GPD_NONE "None" - IDS_GPD_NORMAL "Normal" - IDS_GPD_OFF "Off" - IDS_GPD_ON "On" - IDS_GPD_ORIENATION "Orientation" - IDS_GPD_OVERLAYED "Overlaid" - IDS_GPD_PAGEBORDER "Page Border" - IDS_GPD_PAGEQUALITY "Page Output Quality" - IDS_GPD_PAGESCALING "Page Scaling" - IDS_GPD_PAPERSOURCE "Paper Source" - IDS_GPD_PHOTOGRAPHIC "Photographic" - IDS_GPD_PORTRAIT "Portrait" - IDS_GPD_RASTERIMAGE "Raster Image" - IDS_GPD_RESOLUTION "Resolution" - IDS_GPD_REVERSELANDSCAPE "Reverse Landscape" -END - -STRINGTABLE -BEGIN - IDS_GPD_REVERSE "Reverse" - IDS_GPD_RTOL "Right to Left" - IDS_GPD_RTOLBTOT "Right to Left, Bottom to Top" - IDS_GPD_RTOLTTOB "Right to Left, Top to Bottom" - IDS_GPD_SCALEPAGETOPAGE "Scale Page to Page" - IDS_GPD_SCRGB "scRGB" - IDS_GPD_STANDARD "Standard" - IDS_GPD_TEXT "Text" - IDS_GPD_TTOB "Top to Bottom" - IDS_GPD_TTOBLTOR "Top to Bottom, Left to Right" - IDS_GPD_TTOBRTOL "Top to Bottom, Right to Left" - IDS_GPD_TRANSPARENCY "Transparency" - IDS_GPD_TRANSPARENT "Transparent" - IDS_GPD_UNDERLAYED "Underlayed" - IDS_GPD_UPPER "Upper" - IDS_GPD_VECTORIMAGE "Vector Image" -END - -STRINGTABLE -BEGIN - IDS_GPD_VERTICAL "Vertical" - IDS_GPD_WATERMARKLAYERING "Watermark Layering" - IDS_GPD_WATERMARKTEXT "Watermark Text" - IDS_GPD_WATERMARKTYPE "Watermark Type" - IDS_GPD_BEST "Best" - IDS_GPD_PAGEICMINTENT "Page ICM Rendering Intent" - IDS_GPD_ABSCOLINTENT "Absolute Colorimetric" - IDS_GPD_RELCOLINTENT "Relative Colorimetric" - IDS_GPD_PHOTOINTENT "Photographs" - IDS_GPD_BIZINTENT "Business Graphics" - IDS_GPD_SYSTEM "System" - IDS_GPD_WATERMARKTEXTCOLOR "Watermark Text Color" - IDS_GPD_RED "Red" - IDS_GPD_GREEN "Green" - IDS_GPD_BLUE "Blue" - IDS_GPD_MAGENTA "Magenta" - IDS_GPD_CYAN "Cyan" - IDS_GPD_YELLOW "Yellow" - IDS_GPD_BLACK "Black" -END - -STRINGTABLE -BEGIN - IDS_GPD_SCALE_ALIGN "Scale Offset Alignment" - IDS_GPD_SCALE_ALIGN_BC "Bottom Centre" - IDS_GPD_SCALE_ALIGN_BL "Bottom Left" - IDS_GPD_SCALE_ALIGN_BR "Bottom Right" - IDS_GPD_SCALE_ALIGN_CC "Centre" - IDS_GPD_SCALE_ALIGN_LC "Centre Left" - IDS_GPD_SCALE_ALIGN_CR "Centre Right" - IDS_GPD_SCALE_ALIGN_CT "Centre Top" - IDS_GPD_SCALE_ALIGN_TL "Top Left" - IDS_GPD_SCALE_ALIGN_TR "Top Right" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp b/print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp deleted file mode 100644 index 5e0f521f..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplptprov.cpp +++ /dev/null @@ -1,891 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplptprov.cpp - -Abstract: - - Implementation of the PrintTicket provider plugin. This is responsible for - handling PrintTicket features that are too complex for the GPD->PrintTicket - automapping facility. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "xdsmplptprov.h" -#include "wmdmptcnv.h" -#include "pgscdmptcnv.h" -#include "bkdmptcnv.h" -#include "nupptcnv.h" -#include "coldmptcnv.h" -#include "pthndlr.h" -#include "pchndlr.h" - -static LPCWSTR PRIVATE_URI = L"http://schemas.microsoft.com/windows/2003/08/printing/XPSDrv_Feature_Sample"; - - -/*++ - -Routine Name: - - CXDSmplPTProvider::CXDSmplPTProvider - -Routine Description: - - CXDSmplPTProvider class constructor - -Arguments: - - None - -Return Value: - - None - Throws CXDException(HRESULT) on an error - ---*/ -CXDSmplPTProvider::CXDSmplPTProvider() : - CUnknown(IID_IPrintOemPrintTicketProvider), - m_hPrinterCached(NULL), - m_pCoreHelper(NULL), - m_bstrPrivateNS(PRIVATE_URI) -{ - HRESULT hr = S_OK; - IFeatureDMPTConvert* pHandler = NULL; - -// -// This Prefast warning indicates that memory could be leaked -// in the event of an exception. We suppress this false positive because we -// know that the local try/catch block will clean up a single -// IFeatureDMPTConvert, and the destructor will clean up any that are -// successfully added to the vector. -// -#pragma prefast(push) -#pragma prefast(disable:__WARNING_ALIASED_MEMORY_LEAK_EXCEPTION) - try - { - // - // Populate the feature DM<->PT conversion vector - // - pHandler = new(std::nothrow) CWatermarkDMPTConv(); - - hr = AddConverter(pHandler); - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CPageScalingDMPTConv(); - - hr = AddConverter(pHandler); - } - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CBookletDMPTConv(); - - hr = AddConverter(pHandler); - } - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CNUpDMPTConv(); - - hr = AddConverter(pHandler); - } - - if (SUCCEEDED(hr)) - { - pHandler = new(std::nothrow) CColorProfileDMPTConv(); - - hr = AddConverter(pHandler); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - - hr = E_FAIL; - } - - if (FAILED(hr)) - { - // - // If we successfully created a handler but failed to push it onto - // the handler vector we need to free the allocated handler - // - if (pHandler != NULL) - { - delete pHandler; - pHandler = NULL; - } - - // - // Delete any DM<->PT converters that were successfully instantiated - // - DeleteConverters(); - - throw CXDException(hr); - } -#pragma prefast(pop) -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::~CXDSmplPTProvider - -Routine Description: - - CXDSmplPTProvider class destructor - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplPTProvider::~CXDSmplPTProvider() -{ - // - // Clean up all DM<->PT converters - // - DeleteConverters(); -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::GetSupportedVersions - -Routine Description: - - The routine returns major versions of Printschema schema supported by the plug-in Provider. - -Arguments: - - hPrinter - Printer Handle - ppVersions - OUT pointer to array of version numbers to be filled in by the plug-in - cVersions - OUT pointer to count of Number of versions supported by plug-in - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::GetSupportedVersions( - _In_ HANDLE, - _Outptr_result_buffer_(*pcVersions) INT* ppVersions[], - _Out_ INT* pcVersions - ) -{ - HRESULT hr = S_OK; - - // - // Check if input parameters are valid - // - if (SUCCEEDED(hr = CHECK_POINTER(ppVersions, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcVersions, E_POINTER))) - { - *pcVersions = 0; - - // - // The Plug-in Provider need to allocate memory for the input version array and - // then fill it with version information - // - *ppVersions = static_cast(CoTaskMemAlloc(sizeof(INT))); - - if (*ppVersions != NULL) - { - // - // version number 1 is the only version supported currently - // - *pcVersions = 1; - (*ppVersions)[0] = PRINTSCHEMA_VERSION_NUMBER; - } - else - { - hr = E_OUTOFMEMORY; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::BindPrinter - -Routine Description: - - Bind Printer is the part of the Unidrv's activity to bind to a device. It allows the plug-in to cache - certain information that can be used later on such as the private namespaces used by the plug-in. - -Arguments: - - hPrinter - Printer Handle supplied by Unidrv - version - version of Printschema - pOptions - Flags passed out to set configurable options supported by caller - cNamespaces - Count of private namespaces of plug-in - ppNamespaces - OUT pointer to the array of Namespace URIs filled in by plug-in - -Return Value: - - HRESULT - S_OK - On success - E_VERSION_NOT_SUPPORTED - if printer version specified is not supported by plug-in - E_* - On any other failure - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::BindPrinter( - _In_ HANDLE hPrinter, - INT version, - _Out_ POEMPTOPTS pOptions, - _Out_ INT* pcNamespaces, - _Outptr_result_buffer_maybenull_(*pcNamespaces) BSTR** ppNamespaces - ) -{ - HRESULT hr = S_OK; - - // - // Printer Handle should be provided by Unidrv in this call, which is cached by plug-in provider and - // is later on used while making calls to Plug-in Helper Interface methods. - // - if (SUCCEEDED(hr = CHECK_POINTER(pOptions, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pcNamespaces, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(ppNamespaces, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(hPrinter, E_HANDLE))) - { - *ppNamespaces = NULL; - *pcNamespaces = 0; - - // - // Agree on the Printschema version with Unidrv Version 1 is the only - // version currently supported - // - if (PRINTSCHEMA_VERSION_NUMBER == version) - { - // - // Cache the printer handle for further use - // - m_hPrinterCached = hPrinter; - - // - // Flags to set configurable options, OEMPT_DEFAULT defined in prcomoem.h - // - *pOptions = OEMPT_NOSNAPSHOT; - - // - // Publish the private namespace - // - *pcNamespaces = 1; - *ppNamespaces = static_cast(CoTaskMemAlloc(sizeof(BSTR))); - - if (SUCCEEDED(hr = CHECK_POINTER(*ppNamespaces, E_OUTOFMEMORY))) - { - hr = m_bstrPrivateNS.CopyTo(*ppNamespaces); - } - } - else - { - hr = E_VERSION_NOT_SUPPORTED; - } - } - - ERR_ON_HR_EXC(hr, E_VERSION_NOT_SUPPORTED); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::PublishPrintTicketHelperInterface - -Routine Description: - - For a number of operations, the plug-in needs to use the Helper Interface utilities provided by - Unidrv. Unidrv uses this method to publish the PrintTicket Helper Interface, IPrintCoreHelper. - Plug-in should return SUCCESS after successfully incrementing the reference count of the interface. - -Arguments: - - pHelper - IPrintCoreHelper interface pointer - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::PublishPrintTicketHelperInterface( - _In_ IUnknown *pHelper - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pHelper, E_POINTER))) - { - // - // Need to store pointer to Driver Helper functions, if we already haven't. - // - if (m_pCoreHelper == NULL) - { - hr = pHelper->QueryInterface(IID_IPrintCoreHelperUni, reinterpret_cast(&m_pCoreHelper)); - } - - // - // It's possible that this routine will publish other interfaces in the future. - // If the object published did not support the desired interface, this routine - // should still succeed. - // - // If the helper interface is needed, but for some reason was not published - // (this would be an error on the OS's part), you should detect this and fail - // during the call-back where you intended to use the helper interface. - // - if (E_NOINTERFACE == hr) - { - hr = S_OK; - } - else - { - try - { - // - // Iterate over all PrintTicket feature converters publishing the helper interface - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->PublishPrintTicketHelperInterface(m_pCoreHelper); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::QueryDeviceDefaultNamespace - -Routine Description: - - This method provides the plug-in with the opportunity to specify the name of the - Private namespace URI that Unidrv should be using to handle any features defined - in the GPD that Unidrv does not recognize. The plug-in may specify a set of - namespaces as a result of the call to BindPrinter method, and Unidrv needs to know - which of them is to be used as default namespace so that, for all the features that - Unidrv does not recognize, it will put them under this namespace in the PrintTicket. - - Note: It is Unidrv's responsibility to add the private namespace URI that plug-in - has specified through this call in the root node of the DOM document, and also define - a prefix for it so that plug-in should use the prefix defined by Unidrv when it wishes - to add any new node to the PrintTicket under its private namespace. Plug-in should - not define its own prefix for this default private namespace URI. - -Arguments: - - pbstrNamespaceUri - OUT Pointer to namespace URI to be filled in and returned by plug-in - -Return Value: - - HRESULT - S_OK - On success - E_NOTIMPL - The plugin does not require a private namespace - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::QueryDeviceDefaultNamespace( - _Out_ BSTR* pbstrNamespaceUri - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pbstrNamespaceUri, E_POINTER))) - { - hr = m_bstrPrivateNS.CopyTo(pbstrNamespaceUri); - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ConvertPrintTicketToDevMode - -Routine Description: - - Unidrv will call this routine before it performs its part of PT->DM - conversion. The plug-in is passed with an input PrintTicket that is - fully populated, and Devmode which has default settings in it. - - This routine merely passes the call on to the individual feature handlers. - -Arguments: - - pPrintTicket - pointer to input PrintTicket - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - try - { - if (SUCCEEDED(hr)) - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the conversion - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->ConvertPrintTicketToDevMode(pPrintTicket, cbDevmode, pDevmode, cbDrvPrivateSize, pPrivateDevmode); - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ConvertDevModeToPrintTicket - -Routine Description: - - Unidrv will call the routine with an Input PrintTicket that is populated - with public and Unidrv private features. For those features in the GPD that - Unidrv does not understand, it puts them in the PT under the private namespace - (either specified by the plug-in through QueryDeviceDefaultNamespace or created - by itself). It is the plug-in's responsibility to read the corresponding features - from the input PT and put them in public printschema namespace, so that any higher - level application making use of a PrintTicket can read and interpret these settings. - - This routine merely passes the call on to the individual feature handlers. - - -Arguments: - - cbDevmode - size in bytes of input full devmode - pDevmode - pointer to input full devmode buffer - cbDrvPrivateSize - buffer size in bytes of plug-in private devmode - pPrivateDevmode - pointer to plug-in private devmode buffer - pPrintTicket - pointer to input PrintTicket - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ConvertDevModeToPrintTicket( - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrivateDevmode, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pPrintTicket, E_POINTER))) - { - if (cbDevmode < sizeof(DEVMODE) || - cbDrvPrivateSize == 0) - { - hr = E_INVALIDARG; - } - } - - try - { - if (SUCCEEDED(hr)) - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the conversion - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->ConvertDevModeToPrintTicket(cbDevmode, pDevmode, cbDrvPrivateSize, pPrivateDevmode, pPrintTicket); - } - - // - // Delete all the private features generated by the Unidrv parser from the GPD. - // These are not required in the PrintTicket as they are only used to control - // features in the public PrintSchema and have no meaning outside the config - // module. - // - if (SUCCEEDED(hr)) - { - CPTHandler ptHandler(pPrintTicket); - hr = ptHandler.DeletePrivateFeatures(m_bstrPrivateNS); - } - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::CompletePrintCapabilities - -Routine Description: - - Unidrv calls this routine with an input Device Capabilities Document - that is partially populated with Device capabilities information - filled in by Unidrv for features that it understands. The plug-in - needs to read any private features in the input PrintTicket, delete - them and add them back under Printschema namespace so that higher - level applications can understand them and make use of them. - - The XPSDrv sample driver does not define any private device capabilities - so this method merely returns S_OK - -Arguments: - - pPrintTicket - pointer to input PrintTicket - pCapabilities - pointer to Device Capabilities Document. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pPrintCapabilities - ) -{ - HRESULT hr = S_OK; - - // - // Validate parameters - // - if (SUCCEEDED(hr = CHECK_POINTER(pPrintCapabilities, E_POINTER))) - { - try - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the conversion - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - hr = (*iterConverters)->CompletePrintCapabilities(pPrintTicket, pPrintCapabilities); - } - - // - // Delete all the private features generated by the Unidrv parser from the GPD. - // These are not required in the PrintCapabilities as they are only used to control - // features in the public PrintSchema and have no meaning outside the config - // module. - // - if (SUCCEEDED(hr)) - { - CPCHandler pcHandler(pPrintCapabilities); - hr = pcHandler.DeletePrivateFeatures(m_bstrPrivateNS); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ExpandIntentOptions - -Routine Description: - - As part of its Merge and Validate Procedure, the Unidrv/Postscript driver - will call this routine to give the plug-in a chance to expand options - which represent intent into their individual settings in other features - in the PrintTicket. This has two important effects: the client sees the - results of the intent expansion, and unidrv resolves constraints against - the individual features which are affected by the intent. - - The XPSDrv sample driver plug-in does not support any intent features, therefore - simply returns S_OK. - -Arguments: - - pPrintTicket - Pointer to input PrintTicket. - -Return Value: - - HRESULT - S_OK - Always - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ExpandIntentOptions( - _Inout_ IXMLDOMDocument2 * - ) -{ - return S_OK; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::ValidatePrintTicket - -Routine Description: - - The plug-in might need to delete any feature under private namespace - from input PT that are also in the public namespace because of Merge - and Validate. - - The Validate method should also perform any conflict resolution if - necessary looking at the settings made in public and unidrv private - part of PrintTicket, to make sure that the resultant PrintTicket is a - valid one, and has all constraints resolved. - - This routine merely passes the validate call on to the feature handlers - -Arguments: - - pPrintTicket - Pointer to input PrintTicket. - -Return Value: - - HRESULT - S_NO_CONFLICT/S_CONFLICT_RESOLVED - On success - E_* - On error - ---*/ -HRESULT STDMETHODCALLTYPE -CXDSmplPTProvider::ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ) -{ - HRESULT hr = S_NO_CONFLICT; - - // - // Validate parameters - // - if (pPrintTicket != NULL) - { - try - { - // - // Iterate over all PrintTicket feature converters letting them - // provide the validation - // - DMPTConvCollection::iterator iterConverters = m_vectFtrDMPTConverters.begin(); - - for (; iterConverters != m_vectFtrDMPTConverters.end() && SUCCEEDED(hr); iterConverters++) - { - HRESULT hrConverter = (*iterConverters)->ValidatePrintTicket(pPrintTicket); - - if (FAILED(hrConverter) || - hrConverter == static_cast(S_CONFLICT_RESOLVED)) - { - hr = hrConverter; - } - } - } - catch (...) - { - hr = E_FAIL; - } - } - else - { - hr = E_POINTER; - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplPTProvider::DeleteConverters - -Routine Description: - - This routine cleans up the vector of DM <-> PT converters. - -Arguments: - - NONE - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplPTProvider::DeleteConverters( - VOID - ) -{ - HRESULT hr = S_OK; - - try - { - while (!m_vectFtrDMPTConverters.empty()) - { - if (m_vectFtrDMPTConverters.back() != NULL) - { - delete m_vectFtrDMPTConverters.back(); - m_vectFtrDMPTConverters.back() = NULL; - } - - m_vectFtrDMPTConverters.pop_back(); - } - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - ERR_ON_HR(hr); - return hr; -} - -// -// Use __drv_aliasesMem annotation to avoid PREfast warning 28197: Possibly leaking memory, -// -HRESULT -// Prefast warning 28194: The function was declared as aliasing the value in variable and exited without doing so. -// We suppress this false positive because STL vector does not have annotation, and we know the pointer has been saved -// to STL vector, which is released in DeleteConverters(). -#pragma warning(suppress: 28194) -CXDSmplPTProvider::AddConverter( - _In_opt_ __drv_aliasesMem IFeatureDMPTConvert *pHandler - ) -{ - HRESULT hr = CHECK_POINTER(pHandler, E_OUTOFMEMORY); - - if (SUCCEEDED(hr)) - { - m_vectFtrDMPTConverters.push_back(pHandler); - } - - return hr; -} diff --git a/print/XPSDrvSmpl/src/ui/xdsmplptprov.h b/print/XPSDrvSmpl/src/ui/xdsmplptprov.h deleted file mode 100644 index 3286944f..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplptprov.h +++ /dev/null @@ -1,124 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplptprov.h - -Abstract: - - Definition of the PrintTicket provider plugin. This is responsible for - handling PrintTicket features that are too complex for the GPD->PrintTicket - automapping facility. - ---*/ - -#pragma once - -#include "cunknown.h" -#include "schema.h" -#include "ftrdmptcnv.h" - -typedef vector DMPTConvCollection; - -class CXDSmplPTProvider : public CUnknown -{ -public: - CXDSmplPTProvider(); - - virtual ~CXDSmplPTProvider(); - - // - // IPrintOemPrintTicketProvider methods - // - virtual HRESULT STDMETHODCALLTYPE - GetSupportedVersions( - _In_ HANDLE hPrinter, - _Outptr_result_buffer_(*pcVersions) INT* ppVersions[], - _Out_ INT* pcVersions - ); - - virtual HRESULT STDMETHODCALLTYPE - BindPrinter( - _In_ HANDLE hPrinter, - INT version, - _Out_ POEMPTOPTS pOptions, - _Out_ INT* pcNamespaces, - _Outptr_result_buffer_maybenull_(*pcNamespaces) BSTR** ppNamespaces - ); - - virtual HRESULT STDMETHODCALLTYPE - PublishPrintTicketHelperInterface( - _In_ IUnknown* pHelper - ); - - virtual HRESULT STDMETHODCALLTYPE - QueryDeviceDefaultNamespace( - _Out_ BSTR* pbstrNamespaceUri - ); - - virtual HRESULT STDMETHODCALLTYPE - ConvertPrintTicketToDevMode( - _In_ IXMLDOMDocument2* pPrintTicket, - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode - ); - - virtual HRESULT STDMETHODCALLTYPE - ConvertDevModeToPrintTicket( - ULONG cbDevmode, - _Inout_updates_bytes_(cbDevmode) - PDEVMODE pDevmode, - ULONG cbDrvPrivateSize, - _Inout_ PVOID pPrivateDevmode, - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - virtual HRESULT STDMETHODCALLTYPE - CompletePrintCapabilities( - _In_opt_ IXMLDOMDocument2* pPrintTicket, - _Inout_ IXMLDOMDocument2* pCapabilities - ); - - virtual HRESULT STDMETHODCALLTYPE - ExpandIntentOptions( - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - - virtual HRESULT STDMETHODCALLTYPE - ValidatePrintTicket( - _Inout_ IXMLDOMDocument2* pPrintTicket - ); - -private: - HRESULT - DeleteConverters( - VOID - ); - - HRESULT - AddConverter( - _In_opt_ __drv_aliasesMem IFeatureDMPTConvert* pHandler - ); - -private: - HANDLE m_hPrinterCached; - - CComPtr m_pCoreHelper; - - DMPTConvCollection m_vectFtrDMPTConverters; - - CComBSTR m_bstrPrivateNS; -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.cpp b/print/XPSDrvSmpl/src/ui/xdsmplui.cpp deleted file mode 100644 index b41116a6..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.cpp +++ /dev/null @@ -1,1018 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplui.cpp - -Abstract: - - Implementation of the UI plugin. This is responsible for initialising and maintaining - the property pages used in the XPSDrv feature sample UI. - ---*/ - -#include "precomp.h" -#include "debug.h" -#include "globals.h" -#include "xdexcept.h" -#include "xdstring.h" -#include "xdsmplui.h" -#include "colppg.h" -#include "wmppg.h" -#include "ftrppg.h" -#include "UIProperties.h" - -/*++ - -Routine Name: - - CXDSmplUI::CXDSmplUI - -Routine Description: - - CXDSmplUI class constructor. - Creates a handler class object for every property page added in Unidrv UI Plug-in. - Each of these handlers is stored in a collection. - - -Arguments: - - None - -Return Value: - - None - ---*/ -CXDSmplUI::CXDSmplUI() : - CUnknown(IID_IPrintOemUI), - m_pDriverUIHelp(NULL), - m_pOemCUIPParam(NULL), - m_pUIProperties(NULL) -{ -} - -/*++ - -Routine Name: - - CXDSmplUI::~CXDSmplUI - -Routine Description: - - CXDSmplUI class destructor. - -Arguments: - - None - -Return Value: - - None. - ---*/ -CXDSmplUI::~CXDSmplUI() -{ - DestroyPropPages(); -} - -/*++ - -Routine Name: - - CXDSmplUI::PublishDriverInterface - -Routine Description: - - The PublishDriverInterface method allows a user interface plug-in to obtain - the Unidrv driver's IPrintOemDriverUI interface. - -Arguments: - - pIUnknown - Caller-supplied pointer to the IUnknown interface of the driver's - IPrintOemDriverUI COM Interface. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::PublishDriverInterface( - _In_ IUnknown* pIUnknown - ) -{ - HRESULT hr = E_FAIL; - PVOID pInterface = NULL; - - if (m_pDriverUIHelp == NULL && - SUCCEEDED(hr = pIUnknown->QueryInterface(IID_IPrintOemDriverUI, &pInterface))) - { - m_pDriverUIHelp = reinterpret_cast(pInterface); - hr = S_OK; - } - - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::GetInfo - -Routine Description: - - Unidrv will call this routine to obtain identification information. - -Arguments: - - dwMode - Supported modes are OEMGI_GETSIGNATURE and OEMGI_GETVERSION. - pBuffer - Caller-supplied pointer to memory allocated to receive the information specified by dwMode. - cbSize - Caller-supplied size of the buffer pointed to by pBuffer. - pcbNeeded - Caller-supplied pointer to a location to receive the number of bytes written into the buffer pointed to by pBuffer. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::GetInfo( - _In_ DWORD dwMode, - _Out_writes_bytes_(cbSize) PVOID pBuffer, - _In_ DWORD cbSize, - _Out_ PDWORD pcbNeeded - ) -{ - HRESULT hr = S_OK; - - if ((NULL == pcbNeeded) || - ((OEMGI_GETSIGNATURE != dwMode) && - (OEMGI_GETVERSION != dwMode) && - (OEMGI_GETREQUESTEDHELPERINTERFACES != dwMode))) - { - SetLastError(ERROR_INVALID_PARAMETER); - hr = E_INVALIDARG; - } - else - { - *pcbNeeded = sizeof(DWORD); - - if ((cbSize < *pcbNeeded) || - (NULL == pBuffer)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - else - { - switch (dwMode) - { - case OEMGI_GETSIGNATURE: - { - *reinterpret_cast(pBuffer) = OEM_SIGNATURE; - } - break; - - case OEMGI_GETVERSION: - { - *reinterpret_cast(pBuffer) = OEM_VERSION; - } - break; - - default: - { - *pcbNeeded = 0; - hr = E_NOTIMPL; - } - break; - } - } - } - - ERR_ON_HR_EXC(hr, E_NOTIMPL); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DevMode - -Routine Description: - - Performs operation on UI Plugins Private DevMode Members. - Called via IPrintOemUI::DevMode - -Arguments: - - dwMode - Supported modes are OEMDM_SIZE, OEMDM_DEFAULT, OEMDM_CONVERT and OEMDM_MERGE. - pOemDMParam - Caller-supplied pointer to an OEMDMPARAM structure. - Dependent on which dwMode is set. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::DevMode( - _In_ DWORD dwMode, - _In_ POEMDMPARAM pOemDMParam - ) -{ - HRESULT hr = S_OK; - - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam, E_POINTER))) - { - if ((OEMDM_SIZE != dwMode) && - (OEMDM_DEFAULT != dwMode) && - (OEMDM_CONVERT != dwMode)&& - (OEMDM_MERGE != dwMode)) - { - hr = E_INVALIDARG; - } - } - - if (SUCCEEDED(hr)) - { - switch (dwMode) - { - // - // The method should return the size of the memory allocation needed to store the UI plugin Private DEVMODE. - // - case OEMDM_SIZE: - { - pOemDMParam->cbBufSize = sizeof(OEMDEV); - } - break; - - // - // Should fill the Private DEVMODE with the default values. - // - case OEMDM_DEFAULT: - { - try - { - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMOut, E_POINTER))) - { - CUIProperties oemDevOut = CUIProperties(reinterpret_cast(pOemDMParam->pOEMDMOut)); - - hr = oemDevOut.SetDefaults(); - } - } - catch (CXDException &e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - break; - - // - // The method should convert private DEVMODE members to the current version, if necessary. - // - case OEMDM_CONVERT: - { - try - { - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMIn, E_POINTER))) - { - CUIProperties oemDevIn = CUIProperties(reinterpret_cast(pOemDMParam->pOEMDMIn)); - CUIProperties oemDevOut = CUIProperties(reinterpret_cast(pOemDMParam->pOEMDMOut)); - - hr = oemDevOut.Convert(&oemDevIn); - } - } - catch (CXDException &e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - break; - - // - //The method should validate the information contained in private DEVMODE members and merge validated values into a private DEVMODE structure containing default values - // - case OEMDM_MERGE: - { - try - { - if (SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMOut, E_POINTER)) && - SUCCEEDED(hr = CHECK_POINTER(pOemDMParam->pOEMDMIn, E_POINTER))) - { - CUIProperties oemDevIn = CUIProperties(reinterpret_cast(pOemDMParam->pOEMDMIn)); - CUIProperties oemDevOut = CUIProperties(reinterpret_cast(pOemDMParam->pOEMDMOut)); - - if (SUCCEEDED(hr = oemDevOut.Convert(&oemDevIn))) - { - hr = oemDevOut.Validate(); - } - } - } - catch (CXDException &e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - break; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::CommonUIProp - -Routine Description: - - This method allows a user interface plug-in to modify an existing printer property sheet page. - -Arguments: - - dwMode - Supported modes are OEMCUIP_DOCPROP and OEMCUIP_PRNPROP. - pOemCUIPParam - Caller-supplied pointer to an OEMCUIPPARAM structure. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::CommonUIProp( - _In_ DWORD dwMode, - _In_ POEMCUIPPARAM pOemCUIPParam - ) -{ - HRESULT hr = S_OK; - - if (dwMode == OEMCUIP_PRNPROP) - { - // - // We do not implement any printer property sheets - // - hr = E_NOTIMPL; - } - else if (dwMode != OEMCUIP_DOCPROP) - { - // - // Unknown mode encountered - // - hr = E_INVALIDARG; - } - - if (SUCCEEDED(hr) && - SUCCEEDED(hr = CHECK_POINTER(pOemCUIPParam, E_POINTER))) - { - // - // Store the OEMCUIPPARAM pointer so we can modify data and OPTITEMS. - // - m_pOemCUIPParam = pOemCUIPParam; - - // - // The pDrvOptItems member is NULL on the first call through to CommonUIProp(). - // - if (pOemCUIPParam->pDrvOptItems != NULL) - { - try - { - CUIProperties uiProperties; - hr = uiProperties.HideOptItems(pOemCUIPParam); - } - catch (CXDException& e) - { - hr = e; - } - catch (...) - { - hr = E_FAIL; - } - } - } - - ERR_ON_HR_EXC(hr, E_NOTIMPL); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DocumentPropertySheets - -Routine Description: - - This method allows a user interface plug-in to append a new page to a printer device's - document property sheet. - -Arguments: - - pPSUIInfo - Caller-supplied pointer to a PROPSHEETUI_INFO structure. - lParam - Caller-supplied value that depends on the reason value in pPSUIInfo->Reason. - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::DocumentPropertySheets( - _In_ PPROPSHEETUI_INFO pPSUIInfo, - _In_ LPARAM lParam - ) -{ - HRESULT hr = S_OK; - - if (pPSUIInfo == NULL || - pPSUIInfo->Version != PROPSHEETUI_INFO_VERSION) - { - SetLastError(ERROR_INVALID_PARAMETER); - hr = E_INVALIDARG; - } - else - { - switch (pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - { - // - // We need to report the OEMCUIPPARAM structure to the prop sheet - // so ASSERT it is valid. We will let the prop sheet decide if it - // is critical to have a valid pointer or not - // - ASSERTMSG(m_pOemCUIPParam != NULL, "NULL pointer to OEMCUIPPARAM structure.\n"); - - try - { - // - // Create the UI properties object - // - m_pUIProperties = new(std::nothrow) CUIProperties(reinterpret_cast(m_pOemCUIPParam->pOEMDM)); - - // - // Create the property pages for the document property sheet - // - if (SUCCEEDED(hr = CHECK_POINTER(m_pUIProperties, E_OUTOFMEMORY)) && - SUCCEEDED(hr = CreatePropertyPages())) - { - DocPropertyPageMap::iterator iterPropSheets = m_vectPropPages.begin(); - - // - // Make sure the helper interfaces and the OEMCUIPPARAM structure - // are published to the page first. This allows the prop sheet to - // propogate these interfaces to the UI control objects when initializing - // - while (iterPropSheets != m_vectPropPages.end() && - SUCCEEDED(hr = CHECK_POINTER(*iterPropSheets, E_FAIL)) && - SUCCEEDED(hr = (*iterPropSheets)->SetPrintOemDriverUI(m_pDriverUIHelp)) && - SUCCEEDED(hr = (*iterPropSheets)->SetOemCUIPParam(m_pOemCUIPParam))&& - SUCCEEDED(hr = (*iterPropSheets)->SetUIProperties(m_pUIProperties))&& - SUCCEEDED(hr = (*iterPropSheets)->PropPageInit(pPSUIInfo))) - { - iterPropSheets++; - } - } - } - catch (CXDException &e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - } - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - pPSUIInfo->Result = TRUE; - } - } - break; - - case PROPSHEETUI_REASON_DESTROY: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - pPSUIInfo->Result = TRUE; - } - } - break; - - case PROPSHEETUI_REASON_SET_RESULT: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - pPSUIInfo->Result = reinterpret_cast(lParam)->Result; - } - } - break; - - case PROPSHEETUI_REASON_GET_ICON: - { - if (SUCCEEDED(hr = CHECK_POINTER(pPSUIInfo, E_POINTER))) - { - // - // No icon - // - pPSUIInfo->Result = FALSE; - } - } - break; - - default: - { - hr = E_FAIL; - } - break; - } - } - - ERR_ON_HR(hr); - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DevicePropertySheets - -Routine Description: - - This method allows a user interface plug-in to append a new page to a printer device's - printer property sheet. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DevicePropertySheets( - _In_ PPROPSHEETUI_INFO, - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::DevQueryPrintEx - -Routine Description: - - This method allows a user interface plug-in to help determine if a print job is printable. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DevQueryPrintEx( - _In_ POEMUIOBJ, - _In_ PDEVQUERYPRINT_INFO, - _In_ PDEVMODE, - _In_ PVOID - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::DeviceCapabilities - -Routine Description: - - This method enables a user interface plug-in to specify customized device capabilities. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DeviceCapabilities( - _In_ POEMUIOBJ, - _In_ HANDLE, - _In_z_ PWSTR, - _In_ WORD, - _In_ PVOID, - _In_ PDEVMODE, - _In_ PVOID, - _In_ DWORD, - _In_ DWORD* - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::UpgradePrinter - -Routine Description: - - This method allows a user interface plug-in to upgrade device option values - that are stored in the registry. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::UpgradePrinter( - _In_ DWORD, - _In_ PBYTE - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::PrinterEvent - -Routine Description: - - This method allows a user interface plug-in to process printer events. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::PrinterEvent( - _In_ PWSTR , - _In_ INT , - _In_ DWORD , - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::DriverEvent - -Routine Description: - - The printer driver's DrvDriverEvent function calls a user interface plug-in's - IPrintOemUI::DriverEvent method for additional processing of printer driver events. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::DriverEvent( - _In_ DWORD , - _In_ DWORD , - _In_reads_(_Inexpressible_("varies")) PBYTE , - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::QueryColorProfile - -Routine Description: - - This method allows a user interface plug-in to specify an ICC profile to use for color management. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::QueryColorProfile( - _In_ HANDLE , - _In_ POEMUIOBJ , - _In_ PDEVMODE , - _In_ PVOID , - _In_ ULONG , - _Out_writes_(*pcbProfileData) VOID* , - _Inout_ ULONG* pcbProfileData, - _Out_ FLONG* - ) -{ - UNREFERENCED_PARAMETER(pcbProfileData); - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::FontInstallerDlgProc - -Routine Description: - - A user interface plug-in's IPrintOemUI::FontInstallerDlgProc method replaces - the Unidrv font installer's user interface. - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::FontInstallerDlgProc( - _In_ HWND , - _In_ UINT , - _In_ WPARAM , - _In_ LPARAM - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::UpdateExternalFonts - -Routine Description: - - This allows a user interface plug-in to update a printer's Unidrv Font Format Files (.uff file). - -Arguments: - - None referenced. - -Return Value: - - HRESULT - E_NOTIMPL - Method not implemented - ---*/ -HRESULT -CXDSmplUI::UpdateExternalFonts( - _In_ HANDLE, - _In_ HANDLE, - _In_z_ PWSTR - ) -{ - return E_NOTIMPL; -} - -/*++ - -Routine Name: - - CXDSmplUI::CreatePropertyPages - -Routine Description: - - Creates all property page handler objects. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -HRESULT -CXDSmplUI::CreatePropertyPages( - VOID - ) -{ - HRESULT hr = S_OK; - CDocPropPage* pPropPage = NULL; - -// -// This Prefast warning indicates that memory could be leaked -// in the event of an exception. We suppress this false positive because we -// know that the local try/catch block will clean up a single -// CDocPropPage, and the destructor will clean up any that are -// successfully added to the vector. -// -#pragma prefast(push) -#pragma prefast(disable:__WARNING_ALIASED_MEMORY_LEAK_EXCEPTION) - - try - { - // - // Populate the property page vector - // - pPropPage = new(std::nothrow) CColorPropPage(); - - hr = AddPropPage(pPropPage); - - if (SUCCEEDED(hr)) - { - pPropPage = new(std::nothrow) CWatermarkPropPage(); - hr = AddPropPage(pPropPage); - } - - if (SUCCEEDED(hr)) - { - pPropPage = new(std::nothrow) CFeaturePropPage(); - hr = AddPropPage(pPropPage); - } - } - catch (CXDException &e) - { - hr = e; - } - catch (exception& DBG_ONLY(e)) - { - ERR(e.what()); - hr = E_FAIL; - } - - if (FAILED(hr)) - { - // - // If we successfully created a property page but failed to push it onto - // the vector we need to free the allocated property page - // - if (pPropPage != NULL) - { - delete pPropPage; - pPropPage = NULL; - } - } - -#pragma prefast(pop) - - return hr; -} - -/*++ - -Routine Name: - - CXDSmplUI::DestroyPropPages - -Routine Description: - - Destroy all property page handler classes that have been added into the collection. - -Arguments: - - None - -Return Value: - - HRESULT - S_OK - On success - E_* - On error - ---*/ -inline VOID -CXDSmplUI::DestroyPropPages( - VOID - ) -{ - while (!m_vectPropPages.empty()) - { - if (m_vectPropPages.back() != NULL) - { - delete m_vectPropPages.back(); - m_vectPropPages.back() = NULL; - } - - m_vectPropPages.pop_back(); - } - - if (m_pUIProperties != NULL) - { - delete m_pUIProperties; - m_pUIProperties = NULL; - } -} - -// -// Use __drv_aliasesMem annotation to avoid PREfast warning 28197: Possibly leaking memory, -// -HRESULT -// Prefast warning 28194: The function was declared as aliasing the value in variable and exited without doing so. -// We suppress this false positive because STL vector does not have annotation, and we know the pointer has been saved -// to STL vector, which is released in DestroyPropPages(). -#pragma warning(suppress: 28194) -CXDSmplUI::AddPropPage( - _In_opt_ __drv_aliasesMem CDocPropPage* pPropPage - ) -{ - HRESULT hr = CHECK_POINTER(pPropPage, E_OUTOFMEMORY); - - if (SUCCEEDED(hr)) - { - m_vectPropPages.push_back(pPropPage); - } - - return hr; -} - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.def b/print/XPSDrvSmpl/src/ui/xdsmplui.def deleted file mode 100644 index dccec9d5..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.def +++ /dev/null @@ -1,23 +0,0 @@ -; -; Copyright (c) 2005 Microsoft Corporation -; -; All rights reserved. -; -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; File Name: -; -; xdsmplui.def -; -; Abstract: -; -; XPSDrv feature sample config plugin module definition file -; - -LIBRARY XDSmplUI -EXPORTS DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.h b/print/XPSDrvSmpl/src/ui/xdsmplui.h deleted file mode 100644 index c175de88..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.h +++ /dev/null @@ -1,161 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -All rights reserved. - -THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -PARTICULAR PURPOSE. - -File Name: - - xdsmplui.h - -Abstract: - - Definition of the UI plugin. This is responsible for initialising and maintining - the property pages used in the XPSDrv feature sample UI. - ---*/ - -#pragma once - -#include "cunknown.h" -#include "docppg.h" - -typedef std::vector DocPropertyPageMap; - -class CXDSmplUI : public CUnknown -{ -public: - // - // Construction and Destruction - // - CXDSmplUI(); - - virtual ~CXDSmplUI(); - - // - // IPrintOemUI methods - // - STDMETHOD(PublishDriverInterface)(THIS_ - _In_ IUnknown* pIUnknown - ); - - STDMETHOD(GetInfo)(THIS_ - _In_ DWORD dwMode, - _Out_writes_bytes_(cbSize) PVOID pBuffer, - _In_ DWORD cbSize, - _Out_ PDWORD pcbNeeded - ); - - STDMETHOD(DevMode)(THIS_ - _In_ DWORD dwMode, - _In_ POEMDMPARAM pOemDMParam - ); - - STDMETHOD(CommonUIProp)(THIS_ - _In_ DWORD dwMode, - _In_ POEMCUIPPARAM pOemCUIPParam - ); - - STDMETHOD(DocumentPropertySheets)(THIS_ - _In_ PPROPSHEETUI_INFO pPSUIInfo, - _In_ LPARAM lParam - ); - - STDMETHOD(DevicePropertySheets)(THIS_ - _In_ PPROPSHEETUI_INFO pPSUIInfo, - _In_ LPARAM lParam - ); - - STDMETHOD(DevQueryPrintEx)(THIS_ - _In_ POEMUIOBJ poemuiobj, - _In_ PDEVQUERYPRINT_INFO pDQPInfo, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM - ); - - STDMETHOD(DeviceCapabilities)(THIS_ - _In_ POEMUIOBJ poemuiobj, - _In_ HANDLE hPrinter, - _In_z_ PWSTR pDeviceName, - _In_ WORD wCapability, - _In_ PVOID pOutput, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM, - _In_ DWORD dwOld, - _In_ DWORD* dwResult - ); - - STDMETHOD(UpgradePrinter)(THIS_ - _In_ DWORD dwLevel, - _In_ PBYTE pDriverUpgradeInfo - ); - - STDMETHOD(PrinterEvent)(THIS_ - _In_ PWSTR pPrinterName, - _In_ INT iDriverEvent, - _In_ DWORD dwFlags, - _In_ LPARAM lParam - ); - - STDMETHOD(DriverEvent)(THIS_ - _In_ DWORD dwDriverEvent, - _In_ DWORD dwLevel, - _In_reads_(_Inexpressible_("varies")) PBYTE pDriverInfo, - _In_ LPARAM lParam - ); - - STDMETHOD(QueryColorProfile)(THIS_ - _In_ HANDLE hPrinter, - _In_ POEMUIOBJ poemuiobj, - _In_ PDEVMODE pPublicDM, - _In_ PVOID pOEMDM, - _In_ ULONG ulReserved, - _Out_writes_(*pcbProfileData) VOID* pvProfileData, - _Inout_ ULONG* pcbProfileData, - _Out_ FLONG* pflProfileData - ); - - STDMETHOD(FontInstallerDlgProc)(THIS_ - _In_ HWND hWnd, - _In_ UINT usMsg, - _In_ WPARAM wParam, - _In_ LPARAM lParam - ); - - STDMETHOD(UpdateExternalFonts)(THIS_ - _In_ HANDLE hPrinter, - _In_ HANDLE hHeap, - _In_z_ PWSTR pwstrCartridges - ); - -private: - HRESULT - CreatePropertyPages( - VOID - ); - - HRESULT - AddPropPage( - _In_opt_ __drv_aliasesMem CDocPropPage* pPropPage - ); - - inline VOID - DestroyPropPages( - VOID - ); - -private: - POEMCUIPPARAM m_pOemCUIPParam; - - CUIProperties* m_pUIProperties; - - CComPtr m_pDriverUIHelp; - - DocPropertyPageMap m_vectPropPages; -}; - diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj b/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj deleted file mode 100644 index 74f727cb..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj +++ /dev/null @@ -1,582 +0,0 @@ - - - - - Debug - ARM - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {7441D7F2-F509-4A47-9404-3EB8653AE037} - $(MSBuildProjectName) - false - true - Debug - Win32 - {84F0AEE3-8A8E-436B-A381-D88F6D804CB0} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - - MultiThreaded - MultiThreadedDebug - true - Level4 - Sync - - - - xdsmplui - - - xdsmplui - - - xdsmplui - - - xdsmplui - - - xdsmplui - - - xdsmplui - - - xdsmplui - - - xdsmplui - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(PreprocessorDefinitions);USERMODE_DRIVER;_UNICODE;UNICODE - %(PreprocessorDefinitions);PLUGIN_PRINTTICKET - %(AdditionalIncludeDirectories);..\inc;..\debug;..\common;$(DDK_INC_PATH);$(SDK_INC_PATH)\gdiplus - - - %(AdditionalDependencies);kernel32.lib;user32.lib;winspool.lib;ole32.lib;oleaut32.lib;advapi32.lib;msxml6.lib;uuid.lib;Comdlg32.lib;.\..\debug\$(IntDir)\xdsdbg.lib;.\..\common\$(IntDir)\xdsmplcmn.lib - xdsmplui.def - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters b/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters deleted file mode 100644 index cf11c7f8..00000000 --- a/print/XPSDrvSmpl/src/ui/xdsmplui.vcxproj.Filters +++ /dev/null @@ -1,611 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {2AD80BD3-541F-43F0-BAF3-C9D1407DB40F} - - - h;hpp;hxx;hm;inl;inc;xsd - {1C5775CA-818E-4201-BF0E-79C149173495} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {4155F8D0-42D6-4420-B759-01020F4BFE90} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/print/XpsRasFilter/README.md b/print/XpsRasFilter/README.md deleted file mode 100644 index 55f637df..00000000 --- a/print/XpsRasFilter/README.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -page_type: sample -description: "Implements an XPSDrv filter that rasterizes fixed pages in an XPS document." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# XPS Rasterization Filter Service Sample - -This sample implements an XPSDrv filter that rasterizes fixed pages in an XPS document. Hardware vendors can modify this sample to build an XPSDrv filter that produces bitmap images for their printers or other display devices. The sample uses the XPS Rasterization Service that creates rasterizer objects for use by XPSDrv filters. A rasterizer object takes an XPS Object Model (XPS OM) page object and creates a bitmap of a specified region of the page. The sample implements an XPSDrv filter (xpsrasfilter.dll) that can be inserted into the XPS Filter Pipeline. For each fixed page in an XPS document, the sample filter does the following: - -- Uses the XPS rasterization service to create a rasterizer object for the fixed page. - -- Partitions the fixed page into several horizontal bands. - -- Uses the rasterizer object to render each horizontal band as a bitmap image. - -The Print Filter Pipeline is part of the XPS Print Path [Windows Print Path Overview](https://docs.microsoft.com/windows-hardware/drivers/print/windows-print-path-overview). Fixed pages are sent as an XPS data stream from the XPS Spooler to the print filter pipeline. The print filter pipeline manager takes the XPS fixed page, calls each filter in the order defined in the pipeline configuration file, and then sends either Fixed Page OM objects or a data stream to each filter as required. The filters process the data and return either Fixed Page OM objects or a data stream back to the print filter pipeline manager. - -For more information, see [IXpsDocumentProvider](https://docs.microsoft.com/windows-hardware/drivers/ddi/content/filterpipeline/nn-filterpipeline-ixpsdocumentprovider), [IXpsDocumentConsumer](https://docs.microsoft.com/windows-hardware/drivers/ddi/content/filterpipeline/nn-filterpipeline-ixpsdocumentconsumer), [IPrintWriteStream](https://docs.microsoft.com/windows-hardware/drivers/ddi/content/filterpipeline/nn-filterpipeline-iprintwritestream), and [IPrintReadStream](https://docs.microsoft.com/windows-hardware/drivers/ddi/content/filterpipeline/nn-filterpipeline-iprintreadstream). - -As a print filter pipeline service, the XPS Rasterization Service can be loaded into the filter pipeline when the pipeline is initialized by adding a filter service provider tag to the configuration XML file (for example, \). The service is then available to be called by the filters when they are initialized and called by the print filter pipeline manager. - -The XPS Rasterization Service operates as follows: - -- The calling filter initializes an instance of the rasterizer by passing in the XPS OM for the fixed page. - -- The calling filter calls the RasterizeRect method of the rasterizer to render a specified rectangle area of the fixed page. - -- RasterizeRect writes the WIC (Windows Imaging Component) bitmap data to memory. (The address is specified as a parameter to RasterizeRect.) - -The default parameters in this sample are as follows: - -- Letter-sized physical page (can override in print ticket). - -- 0.25-inch margins (creating an 8-inch by 10.5-inch imageable area). - -- Scaling is set to FitApplicationBleedSizeToImageableSize. - -- Destination resolution set to 96 dpi (can override in print ticket). diff --git a/print/XpsRasFilter/XpsRasFilter.sln b/print/XpsRasFilter/XpsRasFilter.sln deleted file mode 100644 index 1c155e19..00000000 --- a/print/XpsRasFilter/XpsRasFilter.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 12.0 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xpsrasfilter", "src\xpsrasfilter.vcxproj", "{D8784A15-C959-4CDF-B5B8-A603F347BDA4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Debug|ARM64.Build.0 = Debug|ARM64 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Debug|Win32.ActiveCfg = Debug|Win32 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Debug|Win32.Build.0 = Debug|Win32 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Debug|x64.ActiveCfg = Debug|x64 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Debug|x64.Build.0 = Debug|x64 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Release|ARM64.ActiveCfg = Release|ARM64 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Release|ARM64.Build.0 = Release|ARM64 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Release|Win32.ActiveCfg = Release|Win32 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Release|Win32.Build.0 = Release|Win32 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Release|x64.ActiveCfg = Release|x64 - {D8784A15-C959-4CDF-B5B8-A603F347BDA4}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/print/XpsRasFilter/install/xpsrassmpl-PipelineConfig.xml b/print/XpsRasFilter/install/xpsrassmpl-PipelineConfig.xml deleted file mode 100644 index c391b545..00000000 --- a/print/XpsRasFilter/install/xpsrassmpl-PipelineConfig.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - diff --git a/print/XpsRasFilter/install/xpsrassmpl.gpd b/print/XpsRasFilter/install/xpsrassmpl.gpd deleted file mode 100644 index 0c300802..00000000 --- a/print/XpsRasFilter/install/xpsrassmpl.gpd +++ /dev/null @@ -1,342 +0,0 @@ -*% -*% Copyright (c) 2005 Microsoft Corporation -*% -*% All rights reserved. -*% -*% THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -*% ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -*% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -*% PARTICULAR PURPOSE. -*% -*% File Name: -*% -*% xpsrassmpl.gpd -*% -*% Abstract: -*% -*% Xps Rasterization Service WDK sample driver install file GPD file. -*% - -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*GPDFileName: "xpsrassmpl.gpd" -*Include: "msxpsinc.gpd" -*Include: "StdNames.gpd" -*ModelName: "XPSRas WDK Sample Driver" -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "unires.dll" -*PrinterType: PAGE -*MaxCopies: 1 - -*%****************************************************************************** -*% PageMediaSize - Paper Size -*%****************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - - *Option: A3 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 9667 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(13460, 19440) - *PrintableOrigin: PAIR(284, 200) - *CursorOrigin: PAIR(284, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(13628, 19368) - *PrintableOrigin: PAIR(200, 236) - *CursorOrigin: PAIR(200, 19604) - } - } - } - - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9352, 13628) - *PrintableOrigin: PAIR(284, 200) - *CursorOrigin: PAIR(284, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(9520, 13556) - *PrintableOrigin: PAIR(200, 236) - *CursorOrigin: PAIR(200, 13792) - } - } - } - - *Option: B4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 6391 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(11572, 16796) - *PrintableOrigin: PAIR(284, 200) - *CursorOrigin: PAIR(284, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(11740, 16724) - *PrintableOrigin: PAIR(200, 236) - *CursorOrigin: PAIR(200, 16960) - } - } - } - - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - } - } - } - - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - } - } - } - - *Option: ENV_10 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(4348, 11000) - *PrintableOrigin: PAIR(300, 200) - *CursorOrigin: PAIR(300, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(4548, 10920) - *PrintableOrigin: PAIR(200, 240) - *CursorOrigin: PAIR(200, 11160) - } - } - } - - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - } - } - } - - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - } - } - } - - *Option: ENV_MONARCH - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(4048, 8600) - *PrintableOrigin: PAIR(300, 200) - *CursorOrigin: PAIR(300, 200) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(4248, 8520) - *PrintableOrigin: PAIR(200, 240) - *CursorOrigin: PAIR(200, 8760) - } - } - } - - *Option: TABLOID - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(12000, 19200) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(400, 400) - } - *case: LANDSCAPE_CC270 - { - *PrintableArea: PAIR(12000, 19200) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(400, 18000) - } - } - } -} - -*%****************************************************************************** -*% PageOrientation -*%****************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - } - - *Option: LANDSCAPE_CC270 - { - *rcNameID: =LANDSCAPE_DISPLAY - } -} - -*%****************************************************************************** -*% Resolution -*%****************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: DPI600 - - *Option: DPI600 - { - *Name: "600 x 600 " =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - } - - *Option: DPI1200 - { - *Name: "1200 x 1200 " =DOTS_PER_INCH - *DPI: PAIR(1200, 1200) - *TextDPI: PAIR(1200, 1200) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - } -} - -*%****************************************************************************** -*% Input Bin -*%****************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: UPPER - *ConcealFromUI?: TRUE - - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - } -} - - -*%****************************************************************************** -*% Printer Memory -*%****************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 32768KB - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } -} - -*%****************************************************************************** -*% Cursor Commands -*%****************************************************************************** -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } - - diff --git a/print/XpsRasFilter/install/xpsrassmpl.inf b/print/XpsRasFilter/install/xpsrassmpl.inf deleted file mode 100644 index d080e428..00000000 Binary files a/print/XpsRasFilter/install/xpsrassmpl.inf and /dev/null differ diff --git a/print/XpsRasFilter/src/BitmapHandler.cpp b/print/XpsRasFilter/src/BitmapHandler.cpp deleted file mode 100644 index d887ddab..00000000 --- a/print/XpsRasFilter/src/BitmapHandler.cpp +++ /dev/null @@ -1,361 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// BitmapHandler.cpp -// -// Abstract: -// -// Abstract class that encapsulates the processing done to each -// individual band bitmap, as well as the concrete implemention -// that streams the bands as Tiffs to the output stream. -// - -#include "precomp.h" -#include "WppTrace.h" -#include "Exception.h" -#include "filtertypes.h" -#include "UnknownBase.h" -#include "xpsrasfilter.h" -#include "OMConvertor.h" -#include "rasinterface.h" -#include "BitmapHandler.h" - -#include "BitmapHandler.tmh" - -namespace xpsrasfilter -{ - -// -//Routine Name: -// -// TiffStreamBitmapHandler::CreateTiffStreamBitmapHandler -// -//Routine Description: -// -// Static factory method that creates an instance of -// TiffStreamBitmapHandler. -// -//Arguments: -// -// pStream - Filter output stream (IPrintWriteStream) -// -//Return Value: -// -// TiffStreamBitmapHandler_t (smart ptr) -// The new TiffStreamBitmapHandler. -// -TiffStreamBitmapHandler_t -TiffStreamBitmapHandler::CreateTiffStreamBitmapHandler( - const IPrintWriteStream_t &pStream - ) -{ - IWICImagingFactory_t pWICFactory; - - // - // Create an instance of a WIC Imaging Factory - // - THROW_ON_FAILED_HRESULT( - ::CoCreateInstance( - CLSID_WICImagingFactory, - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(IWICImagingFactory), - reinterpret_cast(&pWICFactory) - ) - ); - - // - // Construct the TiffStreamBitmapHandler and return it - // - TiffStreamBitmapHandler_t toReturn( - new TiffStreamBitmapHandler( - pWICFactory, - pStream - ) - ); - - return toReturn; -} - -// -//Routine Name: -// -// TiffStreamBitmapHandler::TiffStreamBitmapHandler -// -//Routine Description: -// -// Construct the bitmap handler with the WIC factory -// and filter output stream. -// -//Arguments: -// -// pWICFactory - Windows Imaging Components object factory -// pStream - Output stream -// pHG - Encoder cache HGLOBAL -// -TiffStreamBitmapHandler::TiffStreamBitmapHandler( - const IWICImagingFactory_t &pWICFactory, - const IPrintWriteStream_t &pStream - ) : m_pWICFactory(pWICFactory), - m_pWriter(pStream), - m_nextTiffStart(0), - m_numTiffs(0), - m_tiffStarts(0) -{ -} - -// -//Routine Name: -// -// TiffStreamBitmapHandler::ProcessBitmap -// -//Routine Description: -// -// Encode the bitmap as a TIFF and stream out of the filter. -// -//Arguments: -// -// bitmap - bitmap of a single band, to stream -// -void -TiffStreamBitmapHandler::ProcessBitmap( - const IWICBitmap_t &bitmap - ) -{ - - // - // Create an empty HGLOBAL to hold the encode cache - // - SafeHGlobal_t pHG( - new SafeHGlobal(GMEM_SHARE | GMEM_MOVEABLE, 0) - ); - - // - // Create a stream to the encode buffer so that WIC can - // encode the TIFF in-memory - // - IStream_t pIStream; - - THROW_ON_FAILED_HRESULT( - ::CreateStreamOnHGlobal( - *pHG, - FALSE, // Do NOT Free the HGLOBAL on Release of the stream - &pIStream - ) - ); - - // - // Create a WIC TIFF Encoder on the stream - // - IWICBitmapEncoder_t pWICEncoder; - THROW_ON_FAILED_HRESULT( - m_pWICFactory->CreateEncoder(GUID_ContainerFormatTiff, NULL, &pWICEncoder) - ); - THROW_ON_FAILED_HRESULT( - pWICEncoder->Initialize(pIStream, WICBitmapEncoderNoCache) - ); - - // - // Create a new frame for the band and configure it - // - IWICBitmapFrameEncode_t pWICFrame; - IPropertyBag2_t pFramePropertyBag; - - THROW_ON_FAILED_HRESULT( - pWICEncoder->CreateNewFrame(&pWICFrame, &pFramePropertyBag) - ); - - { - // - // Write the compression method to the frame's property bag - // - PROPBAG2 option = { 0 }; - option.pstrName = L"TiffCompressionMethod"; - - VARIANT varValue; - VariantInit(&varValue); - varValue.vt = VT_UI1; - varValue.bVal = WICTiffCompressionLZW; - - THROW_ON_FAILED_HRESULT( - pFramePropertyBag->Write( - 1, // number of properties being set - &option, - &varValue - ) - ); - } - - THROW_ON_FAILED_HRESULT( - pWICFrame->Initialize(pFramePropertyBag) - ); - - // - // Set the frame's size - // - UINT bitmapWidth, bitmapHeight; - THROW_ON_FAILED_HRESULT( - bitmap->GetSize(&bitmapWidth, &bitmapHeight) - ); - THROW_ON_FAILED_HRESULT( - pWICFrame->SetSize(bitmapWidth, bitmapHeight) - ); - - // - // Set the frame's resolution - // - DOUBLE xDPI, yDPI; - THROW_ON_FAILED_HRESULT( - bitmap->GetResolution(&xDPI, &yDPI) - ); - THROW_ON_FAILED_HRESULT( - pWICFrame->SetResolution(xDPI, yDPI) - ); - - // - // Set the frame's pixel format - // - WICPixelFormatGUID format; - THROW_ON_FAILED_HRESULT( - bitmap->GetPixelFormat(&format) - ); - THROW_ON_FAILED_HRESULT( - pWICFrame->SetPixelFormat(&format) - ); - - // - // Write the bitmap data to the frame - // - WICRect rect = {0, 0, 0, 0}; - rect.Width = bitmapWidth; - rect.Height = bitmapHeight; - THROW_ON_FAILED_HRESULT( - pWICFrame->WriteSource(bitmap, &rect) - ); - - // - // Commit the frame and encoder - // - THROW_ON_FAILED_HRESULT( - pWICFrame->Commit() - ); - THROW_ON_FAILED_HRESULT( - pWICEncoder->Commit() - ); - - // - // Get the size of the TIFF from the stream position - // - ULARGE_INTEGER tiffSize; - LARGE_INTEGER zero; - zero.QuadPart = 0; - - THROW_ON_FAILED_HRESULT( - pIStream->Seek(zero, SEEK_CUR, &tiffSize) - ); - - ULONG cb; - - THROW_ON_FAILED_HRESULT( - ::ULongLongToULong(tiffSize.QuadPart, &cb) - ); - - // - // Update the list of Tiff locations so that it can be written to - // the end of the Tiff stream. - // - m_tiffStarts.push_back(m_nextTiffStart); - m_nextTiffStart += tiffSize.QuadPart; - m_numTiffs++; - - { - // - // Get a pointer to the HGLOBAL memory - // - HGlobalLock_t lock = pHG->Lock(); - BYTE *pCache = lock->GetAddress(); - - // - // Write the encoded Tiff to the output stream - // - ULONG written; - - THROW_ON_FAILED_HRESULT( - m_pWriter->WriteBytes(pCache, cb, &written) - ); - } -} - -// -//Routine Name: -// -// TiffStreamBitmapHandler::WriteFooter -// -//Routine Description: -// -// Write the footer to the stream, making it easier -// to decode the individual TIFFs later. The footer -// looks like this: -// -// |<--8 bytes--->| -// -// +--------------+ -// | Tiff 1 start | -// +--------------+ -// | Tiff 2 start | -// +--------------+ -// | ... | -// +--------------+ -// | Tiff N start | -// +--------------+ -// | N | -// +--------------+ -// -void -TiffStreamBitmapHandler::WriteFooter() -{ - ULONG written; - - // - // Write the vector of Tiff starts to the stream, if any Tiffs - // have been written to the stream. - // - if (m_numTiffs > 0) - { - ULONG toWrite; - - THROW_ON_FAILED_HRESULT( - SizeTToULong( - sizeof(ULONGLONG) * m_tiffStarts.size(), - &toWrite - ) - ); - - THROW_ON_FAILED_HRESULT( - m_pWriter->WriteBytes( - reinterpret_cast(&m_tiffStarts[0]), - toWrite, - &written - ) - ); - } - - // - // Write the number of Tiffs to the stream - // - THROW_ON_FAILED_HRESULT( - m_pWriter->WriteBytes( - reinterpret_cast(&m_numTiffs), - sizeof(m_numTiffs), - &written - ) - ); -} - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/BitmapHandler.h b/print/XpsRasFilter/src/BitmapHandler.h deleted file mode 100644 index 3f78dc30..00000000 --- a/print/XpsRasFilter/src/BitmapHandler.h +++ /dev/null @@ -1,64 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// BitmapHandler.h -// -// Abstract: -// -// Abstract class that encapsulates the processing done to each -// individual band bitmap, as well as the concrete implemention -// that streams the bands as Tiffs to the output stream. -// - -#pragma once - -namespace xpsrasfilter -{ - -class TiffStreamBitmapHandler -{ -public: - - static - TiffStreamBitmapHandler_t - CreateTiffStreamBitmapHandler( - const IPrintWriteStream_t &pStream - ); - - void - ProcessBitmap( - const IWICBitmap_t &bitmap - ); - - void - WriteFooter(); - -private: - IWICImagingFactory_t m_pWICFactory; - IPrintWriteStream_t m_pWriter; // output stream - - // - // Members to keep track of where each Tiff - // starts in the output stream - // - ULONGLONG m_nextTiffStart; - ULONGLONG m_numTiffs; - std::vector m_tiffStarts; - - // - // Constructor is private; use CreateTiffStreamBitmapHandler - // to create instances - // - TiffStreamBitmapHandler( - const IWICImagingFactory_t &pWICFactory, - const IPrintWriteStream_t &pStream - ); -}; - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/Exception.cpp b/print/XpsRasFilter/src/Exception.cpp deleted file mode 100644 index 141c1ac3..00000000 --- a/print/XpsRasFilter/src/Exception.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// Exception.cpp -// -// Abstract: -// -// Exception routine definitions. -// - -#include "precomp.h" -#include "WppTrace.h" -#include "Exception.h" - -#include "Exception.tmh" - -namespace xpsrasfilter -{ - -void ThrowHRException( - HRESULT hr, - char const *fileName, - int lineNum - ) -{ - DoTraceMessage( - XPSRASFILTER_TRACE_ERROR, - L"Throwing HRESULT Exception from %s:%d (HRESULT=%!HRESULT!)", - fileName, - lineNum, - hr - ); - - throw hr_error(hr); -} - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/Exception.h b/print/XpsRasFilter/src/Exception.h deleted file mode 100644 index 887bfbc4..00000000 --- a/print/XpsRasFilter/src/Exception.h +++ /dev/null @@ -1,86 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// Exception.h -// -// Abstract: -// -// Exception macro and class declarations. -// - -#pragma once - -// -// Macro to convert HRESULT into an exception throw -// -#ifndef THROW_ON_FAILED_HRESULT -#define THROW_ON_FAILED_HRESULT(func_) \ -{ \ - HRESULT hr_ = func_; \ - if (FAILED(hr_)) { xpsrasfilter::ThrowHRException(hr_, __FILE__, __LINE__); } \ -} -#endif // THROW_ON_FAILED_HRESULT - -#ifndef THROW_LAST_ERROR -#define THROW_LAST_ERROR() \ -{ \ - HRESULT errhr_ = HRESULT_FROM_WIN32(::GetLastError()); \ - THROW_ON_FAILED_HRESULT(errhr_); \ -} -#endif // THROW_LAST_ERROR - -// -// Macro to catch various exceptions, including -// HRESULT-turned-exceptions. -// -// Because we have defined USE_NATIVE_EH=1, the -// catch(...) block will not catch structural -// exceptions. -// -#ifndef CATCH_VARIOUS -#define CATCH_VARIOUS(hr_) \ - catch(std::bad_alloc const& ) \ - { \ - hr_ = E_OUTOFMEMORY; \ - } \ - catch(xpsrasfilter::hr_error const& e) \ - { \ - hr_ = e.hr; \ - } \ - catch(std::exception const& ) \ - { \ - hr_ = E_FAIL; \ - } \ - catch(...) \ - { \ - hr_ = E_UNEXPECTED; \ - } -#endif // CATCH_VARIOUS - -namespace xpsrasfilter -{ - -// -// HRESULT exception -// -struct hr_error -{ - HRESULT hr; - - hr_error(HRESULT hr_in) : hr(hr_in) - { } -}; - -void ThrowHRException( - HRESULT hr, - char const *fileName, - int lineNum - ); - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/OMConvertor.cpp b/print/XpsRasFilter/src/OMConvertor.cpp deleted file mode 100644 index 2cd478c2..00000000 --- a/print/XpsRasFilter/src/OMConvertor.cpp +++ /dev/null @@ -1,774 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// omconvertor.cpp -// -// Abstract: -// -// Object model conversion routines. This class provides routines -// to convert from filter pipeline objects into Xps Object Model -// objects. -// - -#include "precomp.h" -#include "WppTrace.h" -#include "Exception.h" -#include "filtertypes.h" -#include "UnknownBase.h" -#include "OMConvertor.h" - -#include "OMConvertor.tmh" - -namespace xpsrasfilter -{ - -// -//Routine Name: -// -// CreateXpsOMPageFromIFixedPage -// -//Routine Description: -// -// This is the main method called by the filter. It -// proceeds to call the remaining Create* methods -// to convert from the print pipeline Object Model -// to the Xps Object Model. -// -// Takes an IFixedPage (print pipeline Object Model) -// and converts it to an IXpsOMPage (Xps Object Model). -// -//Arguments: -// -// pPageIn - IFixedPage to convert -// pOMFactory - Xps Object Model Object Factory -// pOpcFactory - Opc Object Factory -// -//Return Value: -// -// IXpsOMPage_t (smart pointer) -// Result IXpsOMPage -// -IXpsOMPage_t -CreateXpsOMPageFromIFixedPage( - const IFixedPage_t &pPageIn, - const IXpsOMObjectFactory_t &pOMFactory, - const IOpcFactory_t &pOpcFactory - ) -{ - // - // Get additional page parameters (uri and stream) - // - IOpcPartUri_t pPartUri; - IStream_t pPartStream; - - pPartStream = GetStreamFromPart( - static_cast(pPageIn) - ); - pPartUri = CreateOpcPartUriFromPart( - static_cast(pPageIn), - pOpcFactory - ); - - // - // Call Xps Object Model to create the page resource - // - IXpsOMPage_t pPageOut; - - THROW_ON_FAILED_HRESULT( - pOMFactory->CreatePageFromStream( - pPartStream, - pPartUri, - CollectPageResources(pPageIn, pOMFactory, pOpcFactory), - FALSE, // Do not reuse objects - &pPageOut - ) - ); - - return pPageOut; -} - -// -//Routine Name: -// -// CreateImageFromIPartImage -// -//Routine Description: -// -// Takes an IPartImage (print pipeline Object Model) -// and converts it to an IXpsOMImageResource (Xps Object Model). -// -//Arguments: -// -// pImageIn - IPartImage to convert -// pOMFactory - Xps Object Model Object Factory -// pOpcFactory - Opc Object Factory -// -//Return Value: -// -// IXpsOMImageResource_t (smart pointer) -// Result IXpsOMImageResource -// -IXpsOMImageResource_t -CreateImageFromIPartImage( - const IPartImage_t &pImageIn, - const IXpsOMObjectFactory_t &pOMFactory, - const IOpcFactory_t &pOpcFactory - ) -{ - // - // Get IPartBase parameters (stream and uri) - // - IStream_t pPartStream; - IOpcPartUri_t pPartUri; - - pPartStream = GetStreamFromPart( - static_cast(pImageIn) - ); - pPartUri = CreateOpcPartUriFromPart( - static_cast(pImageIn), - pOpcFactory - ); - - // - // Get the image type and convert it to the corresponding enum - // - BSTR_t strContentType; - XPS_IMAGE_TYPE type = XPS_IMAGE_TYPE_WDP; - - THROW_ON_FAILED_HRESULT( - pImageIn->GetImageProperties(&strContentType) - ); - - if (0 == _wcsicmp(strContentType, L"image/jpeg")) - { - type = XPS_IMAGE_TYPE_JPEG; - } - else if (0 == _wcsicmp(strContentType, L"image/png")) - { - type = XPS_IMAGE_TYPE_PNG; - } - else if (0 == _wcsicmp(strContentType, L"image/tiff")) - { - type = XPS_IMAGE_TYPE_TIFF; - } - else if (0 == _wcsicmp(strContentType, L"image/vnd.ms-photo")) - { - type = XPS_IMAGE_TYPE_WDP; - } - else - { - // - // unknown content type - // - THROW_ON_FAILED_HRESULT(E_INVALIDARG); - } - - // - // Call Xps Object Model to create the image resource - // - IXpsOMImageResource_t pImageOut; - - THROW_ON_FAILED_HRESULT( - pOMFactory->CreateImageResource( - pPartStream, - type, - pPartUri, - &pImageOut - ) - ); - - return pImageOut; -} - -// -//Routine Name: -// -// CreateProfileFromIPartColorProfile -// -//Routine Description: -// -// Takes an IPartColorProfile (print pipeline Object Model) -// and converts it to an IXpsOMColorProfileResource (Xps Object Model). -// -//Arguments: -// -// pProfileIn - IPartColorProfile to convert -// pOMFactory - Xps Object Model Object Factory -// pOpcFactory - Opc Object Factory -// -//Return Value: -// -// IXpsOMColorProfileResource_t (smart pointer) -// Result IXpsOMColorProfileResource -// -IXpsOMColorProfileResource_t -CreateProfileFromIPartColorProfile( - const IPartColorProfile_t &pProfileIn, - const IXpsOMObjectFactory_t &pOMFactory, - const IOpcFactory_t &pOpcFactory - ) -{ - // - // Get IPartBase parameters (stream and uri) - // - IStream_t pPartStream; - IOpcPartUri_t pPartUri; - - pPartStream = GetStreamFromPart( - static_cast(pProfileIn) - ); - pPartUri = CreateOpcPartUriFromPart( - static_cast(pProfileIn), - pOpcFactory - ); - - // - // Call Xps Object Model to create the color profile resource - // - IXpsOMColorProfileResource_t pProfileOut; - - THROW_ON_FAILED_HRESULT( - pOMFactory->CreateColorProfileResource( - pPartStream, - pPartUri, - &pProfileOut - ) - ); - - return pProfileOut; -} - -// -//Routine Name: -// -// CreateDictionaryFromIPartResourceDictionary -// -//Routine Description: -// -// Takes an IPartResourceDictionary (print pipeline Object Model) -// and converts it to an IXpsOMRemoteDictionaryResource (Xps Object Model). -// -//Arguments: -// -// pDictionaryIn - IPartResourceDictionary to convert -// pOMFactory - Xps Object Model Object Factory -// pOpcFactory - Opc Object Factory -// pResources - The resources of the fixed page -// -//Return Value: -// -// IXpsOMRemoteDictionaryResource_t (smart pointer) -// Result IXpsOMRemoteDictionaryResource -// -IXpsOMRemoteDictionaryResource_t -CreateDictionaryFromIPartResourceDictionary( - const IPartResourceDictionary_t &pDictionaryIn, - const IXpsOMObjectFactory_t &pOMFactory, - const IOpcFactory_t &pOpcFactory, - const IXpsOMPartResources_t &pResources - ) -{ - // - // Get IPartBase parameters (stream and uri) - // - IStream_t pPartStream; - IOpcPartUri_t pPartUri; - - pPartStream = GetStreamFromPart( - static_cast(pDictionaryIn) - ); - pPartUri = CreateOpcPartUriFromPart( - static_cast(pDictionaryIn), - pOpcFactory - ); - - // - // Call Xps Object Model to create the remote dictionary resource - // - IXpsOMRemoteDictionaryResource_t pDictionaryOut; - - THROW_ON_FAILED_HRESULT( - pOMFactory->CreateRemoteDictionaryResourceFromStream( - pPartStream, - pPartUri, - pResources, - &pDictionaryOut) - ); - - return pDictionaryOut; -} - -// -//Routine Name: -// -// CreateFontFromIPartFont -// -//Routine Description: -// -// Takes an IPartFont (print pipeline Object Model) -// and converts it to an IXpsOMFontResource (Xps Object Model). -// -//Arguments: -// -// pFontIn - IPartFont to convert -// pFactory - Xps Object Model Object Factory -// pOpcFactory - Opc Object Factory -// -//Return Value: -// -// IXpsOMFontResource_t (smart pointer) -// Result IXpsOMFontResource -// -IXpsOMFontResource_t -CreateFontFromIPartFont( - const IPartFont_t &pFontIn, - const IXpsOMObjectFactory_t &pOMFactory, - const IOpcFactory_t &pOpcFactory - ) -{ - // - // Get IPartBase parameters (stream and uri) - // - IStream_t pPartStream; - IOpcPartUri_t pPartUri; - - pPartStream = GetStreamFromPart( - static_cast(pFontIn) - ); - pPartUri = CreateOpcPartUriFromPart( - static_cast(pFontIn), - pOpcFactory - ); - - // - // Get the font restriction - // - EXpsFontRestriction eFontRestriction = Xps_Restricted_Font_Installable; - - { - IPartFont2_t pFont2In; - - if (SUCCEEDED(pFontIn->QueryInterface(__uuidof(IPartFont2), reinterpret_cast(&pFont2In)))) - { - pFont2In->GetFontRestriction(&eFontRestriction); - } - } - - // - // Get the font obfuscation - // - EXpsFontOptions eFontOptions; - - { - BSTR_t contentType; - - THROW_ON_FAILED_HRESULT( - pFontIn->GetFontProperties(&contentType, &eFontOptions) - ); - } - - // - // It is necessary to combine the obfuscation and restriction - // attributes from the print pipeline into the one parameter that - // the Xps Object Model consumes. - // - - XPS_FONT_EMBEDDING omEmbedding; - - if (eFontOptions == Font_Normal) - { - omEmbedding = XPS_FONT_EMBEDDING_NORMAL; - } - else if (eFontOptions == Font_Obfusticate && - (eFontRestriction & - (Xps_Restricted_Font_PreviewPrint | - Xps_Restricted_Font_NoEmbedding))) - { - // - // If the font is obfuscated, and either the PreviewPrint or - // NoEmbedding restriction flags are set, then create a - // Restricted font - // - omEmbedding = XPS_FONT_EMBEDDING_RESTRICTED; - } - else - { - omEmbedding = XPS_FONT_EMBEDDING_OBFUSCATED; - } - - // - // Call Xps Object Model to create the font resource - // - IXpsOMFontResource_t pFontOut; - - THROW_ON_FAILED_HRESULT( - pOMFactory->CreateFontResource( - pPartStream, - omEmbedding, - pPartUri, - FALSE, // fonts received from the pipeline are already de-obfuscated - &pFontOut - ) - ); - - return pFontOut; -} - -// -//Routine Name: -// -// CollectPageResources -// -//Routine Description: -// -// Iterates over all of the resources related to -// a fixed page and adds them to a resource -// collection. -// -//Arguments: -// -// pPage - The page to query for resources -// pOMFactory - Xps Object Model Object Factory -// pOpcFactory - Opc Object Factory -// -//Return Value: -// -// IXpsOMPartResources_t (smart pointer) -// The resource collection of all of the resources of the page -// -IXpsOMPartResources_t -CollectPageResources( - const IFixedPage_t &pPage, - const IXpsOMObjectFactory_t &pOMFactory, - const IOpcFactory_t &pOpcFactory - ) -{ - IXpsOMPartResources_t pResources; - - IXpsOMFontResourceCollection_t pFonts; - IXpsOMImageResourceCollection_t pImages; - IXpsOMColorProfileResourceCollection_t pProfiles; - IXpsOMRemoteDictionaryResourceCollection_t pDictionaries; - - // - // collection of resource dictionaries saved for later processing. - // - ResourceDictionaryList_t dictionaryList; - - // - // Create the resource collection and get all of the - // resource-specific sub-collections. - // - THROW_ON_FAILED_HRESULT( - pOMFactory->CreatePartResources(&pResources) - ); - THROW_ON_FAILED_HRESULT( - pResources->GetFontResources(&pFonts) - ); - THROW_ON_FAILED_HRESULT( - pResources->GetImageResources(&pImages) - ); - THROW_ON_FAILED_HRESULT( - pResources->GetColorProfileResources(&pProfiles) - ); - THROW_ON_FAILED_HRESULT( - pResources->GetRemoteDictionaryResources(&pDictionaries) - ); - // - // Get the XpsPartIterator and iterate through all of the parts - // related to this fixed page. - // - IXpsPartIterator_t itPart; - - THROW_ON_FAILED_HRESULT( - pPage->GetXpsPartIterator(&itPart) - ); - - for (; !itPart->IsDone(); itPart->Next()) - { - BSTR_t uri; - IUnknown_t pUnkPart; - - THROW_ON_FAILED_HRESULT( - itPart->Current(&uri, &pUnkPart) - ); - - IPartFont_t pFontPart; - IPartImage_t pImagePart; - IPartColorProfile_t pProfilePart; - IPartResourceDictionary_t pDictionaryPart; - - if (SUCCEEDED(pUnkPart.QueryInterface(&pFontPart))) - { - // - // Convert the font part to Xps Object Model and add it to the - // font resource collection - // - THROW_ON_FAILED_HRESULT( - pFonts->Append( - CreateFontFromIPartFont( - pFontPart, - pOMFactory, - pOpcFactory - ) - ) - ); - } - else if (SUCCEEDED(pUnkPart.QueryInterface(&pImagePart))) - { - // - // Convert the image part to Xps Object Model and add it to the - // image resource collection - // - THROW_ON_FAILED_HRESULT( - pImages->Append( - CreateImageFromIPartImage( - pImagePart, - pOMFactory, - pOpcFactory - ) - ) - ); - } - else if (SUCCEEDED(pUnkPart.QueryInterface(&pProfilePart))) - { - // - // Convert the color profile part to Xps Object Model and add it - // to the color profile resource collection - // - THROW_ON_FAILED_HRESULT( - pProfiles->Append( - CreateProfileFromIPartColorProfile( - pProfilePart, - pOMFactory, - pOpcFactory - ) - ) - ); - } - else if (SUCCEEDED(pUnkPart.QueryInterface(&pDictionaryPart))) - { - // - // In order to process the remote resource dictionary, all of - // its linked resources must be present in pResources. To ensure - // this, we delay the conversion of the remote resource - // dictionaries until all of the other resources have been converted. - // - dictionaryList.push_back(pDictionaryPart); - } - else - { - // - // Any other page resources are ignored - // - } - } - - for (ResourceDictionaryList_t::const_iterator it = dictionaryList.begin(); - it != dictionaryList.end(); - ++it) - { - // - // Convert the remote dictionary to Xps Object Model and add it - // to the remote dictionary collection - // - THROW_ON_FAILED_HRESULT( - pDictionaries->Append( - CreateDictionaryFromIPartResourceDictionary( - *it, - pOMFactory, - pOpcFactory, - pResources - ) - ) - ); - } - - return pResources; -} - -// -//Routine Name: -// -// GetStreamFromPart -// -//Routine Description: -// -// Gets the IStream from this part. -// -//Arguments: -// -// pPart - An Xps Part -// -//Return Value: -// -// IStream_t (smart pointer) -// The stream of the part's content -// -IStream_t -GetStreamFromPart( - const IPartBase_t &pPart - ) -{ - // - // Get the IPrintReadStream for the part from the pipeline Object Model - // - IPrintReadStream_t pStream; - THROW_ON_FAILED_HRESULT( - pPart->GetStream(&pStream) - ); - - return CreateIStreamFromIPrintReadStream(pStream); -} - -// -//Routine Name: -// -// CreateIStreamFromIPrintReadStream -// -//Routine Description: -// -// Creates an IStream from an IPrintReadStream. -// -//Arguments: -// -// pReadStream - A Print Pipeline IPrintReadStream -// -//Return Value: -// -// IStream_t (smart pointer) -// A stream with the same content as the argument stream. -// -IStream_t -CreateIStreamFromIPrintReadStream( - const IPrintReadStream_t &pReadStream - ) -{ - // - // Get the size of the stream - // - ULONGLONG tmpPos; - size_t partSize; - - THROW_ON_FAILED_HRESULT( - pReadStream->Seek(0, SEEK_END, &tmpPos) - ); - - // - // GlobalAlloc can only allocate size_t bytes, so - // throw if the part is larger than that - // - THROW_ON_FAILED_HRESULT( - ULongLongToSizeT(tmpPos, &partSize) - ); - - THROW_ON_FAILED_HRESULT( - pReadStream->Seek(0, SEEK_SET, &tmpPos) - ); - - // - // Allocate an HGLOBAL for the part cache - // - SafeHGlobal_t pHBuf( - new SafeHGlobal(GMEM_FIXED, partSize) - ); - - // - // Read the part into the cache - // - { - // - // Lock the HGLOBAL and get the address of the buffer - // from the RAII lock object - // - HGlobalLock_t lock = pHBuf->Lock(); - BYTE *pBuffer = lock->GetAddress(); - - // - // Allow the number of bytes to read to be clipped to max ULONG - // and then spin on fEOF until the stream is exhausted - // - ULONG numToRead; - - if (FAILED(SizeTToULong(partSize, &numToRead))) - { - numToRead = MAXUINT; - } - - BOOL fEOF; - ULONG numRead; - size_t pos = 0; - - // - // Iterate until all bytes from the stream - // have been read into the buffer - // - do - { - THROW_ON_FAILED_HRESULT( - pReadStream->ReadBytes(pBuffer + pos, numToRead, &numRead, &fEOF) - ); - - pos += numRead; - } while (!fEOF && numRead); - } - - // - // Create an IStream from the part cache - // - IStream_t pIStream = pHBuf->ConvertToIStream(); - - LARGE_INTEGER zero = {0}; - THROW_ON_FAILED_HRESULT( - pIStream->Seek(zero, SEEK_SET, NULL) - ); - - return pIStream; -} - -// -//Routine Name: -// -// CreateOpcPartUriFromPart -// -//Routine Description: -// -// Gets the Opc Uri from the Xps Part. -// -//Arguments: -// -// pPart - An Xps Part -// pFactory - Opc Factory -// -//Return Value: -// -// IOpcPartUri_t (smart pointer) -// The Uri of the part -// -IOpcPartUri_t -CreateOpcPartUriFromPart( - const IPartBase_t &pPart, - const IOpcFactory_t &pFactory - ) -{ - BSTR_t strPartUri; - - THROW_ON_FAILED_HRESULT( - pPart->GetUri(&strPartUri) - ); - - IOpcPartUri_t pPartUri; - THROW_ON_FAILED_HRESULT( - pFactory->CreatePartUri(strPartUri, &pPartUri) - ); - return pPartUri; -} - -} // namespace xpsrasfilter - diff --git a/print/XpsRasFilter/src/OMConvertor.h b/print/XpsRasFilter/src/OMConvertor.h deleted file mode 100644 index 7257da3b..00000000 --- a/print/XpsRasFilter/src/OMConvertor.h +++ /dev/null @@ -1,90 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// omconvertor.h -// -// Abstract: -// -// Object model conversion routines. -// - -#pragma once - -namespace xpsrasfilter -{ - -// -// Top-level Create Page routine -// -IXpsOMPage_t -CreateXpsOMPageFromIFixedPage( - const IFixedPage_t &pPageIn, - const IXpsOMObjectFactory_t &pFactory, - const IOpcFactory_t &pOpcFactory - ); - -// -// Individual Part conversion routines -// -IXpsOMImageResource_t -CreateImageFromIPartImage( - const IPartImage_t &pImageIn, - const IXpsOMObjectFactory_t &pFactory, - const IOpcFactory_t &pOpcFactory - ); - -IXpsOMColorProfileResource_t -CreateProfileFromIPartColorProfile( - const IPartColorProfile_t &pProfileIn, - const IXpsOMObjectFactory_t &pFactory, - const IOpcFactory_t &pOpcFactory - ); - -IXpsOMRemoteDictionaryResource_t -CreateDictionaryFromIPartResourceDictionary( - const IPartResourceDictionary_t &pDictionaryIn, - const IXpsOMObjectFactory_t &pFactory, - const IOpcFactory_t &pOpcFactory, - const IXpsOMPartResources_t &pResources - ); - -IXpsOMFontResource_t -CreateFontFromIPartFont( - const IPartFont_t &pFontIn, - const IXpsOMObjectFactory_t &pFactory, - const IOpcFactory_t &pOpcFactory - ); - -// -// Utility Routines -// -IStream_t -GetStreamFromPart( - const IPartBase_t &pPart - ); - -IOpcPartUri_t -CreateOpcPartUriFromPart( - const IPartBase_t &pPart, - const IOpcFactory_t &pOpcFactory - ); - -IXpsOMPartResources_t -CollectPageResources( - const IFixedPage_t &pPage, - const IXpsOMObjectFactory_t &pFactory, - const IOpcFactory_t &pOpcFactory - ); - -IStream_t -CreateIStreamFromIPrintReadStream( - const IPrintReadStream_t &pReadStream - ); - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/PThandler.cpp b/print/XpsRasFilter/src/PThandler.cpp deleted file mode 100644 index 6b158032..00000000 --- a/print/XpsRasFilter/src/PThandler.cpp +++ /dev/null @@ -1,781 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// PThandler.cpp -// -// Abstract: -// -// Print Ticket Handler class definition. -// - -#include "precomp.h" -#include "WppTrace.h" -#include "Exception.h" -#include "filtertypes.h" -#include "UnknownBase.h" -#include "OMConvertor.h" -#include "rasinterface.h" -#include "xpsrasfilter.h" -#include "PTHandler.h" - -#include "PThandler.tmh" - -namespace xpsrasfilter -{ - -// -// This is an arbitrary page margin that is used to simulate -// an imageable area for scaling calculations. -// -const FLOAT g_pageMargin = 0.25f; - -// -//Routine Name: -// -// PrintTicketHandler::CreatePrintTicketHandler -// -//Routine Description: -// -// Static factory method that creates an instance of -// PrintTicketHandler. -// -//Arguments: -// -// pPropertyBag - Property Bag -// -//Return Value: -// -// PrintTicketHandler_t (smart ptr) -// The new PrintTicketHandler. -// -PrintTicketHandler_t -PrintTicketHandler::CreatePrintTicketHandler( - const IPrintPipelinePropertyBag_t &pPropertyBag - ) -{ - // - // Create MSXML DOM document - // - IXMLDOMDocument2_t pDOMDoc; - - THROW_ON_FAILED_HRESULT( - ::CoCreateInstance( - __uuidof(DOMDocument60), - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(IXMLDOMDocument2), - reinterpret_cast(&pDOMDoc) - ) - ); - - // - // Get the default user Print Ticket Stream Factory - // - Variant_t varUserPrintTicket; - THROW_ON_FAILED_HRESULT( - pPropertyBag->GetProperty( - XPS_FP_USER_PRINT_TICKET, - &varUserPrintTicket - ) - ); - IUnknown_t pUnk = varUserPrintTicket.punkVal; - - IPrintReadStreamFactory_t pStreamFactory; - - THROW_ON_FAILED_HRESULT( - pUnk.QueryInterface(&pStreamFactory) - ); - - // - // Get the default user Print Ticket stream - // and wrap it in an IStream - // - - IPrintReadStream_t pUserPrintTicketStream; - - THROW_ON_FAILED_HRESULT( - pStreamFactory->GetStream(&pUserPrintTicketStream) - ); - - IStream_t pUserPrintTicket = - CreateIStreamFromIPrintReadStream(pUserPrintTicketStream); - - // - // Get the Printer Name - // - Variant_t varPrinterName; - THROW_ON_FAILED_HRESULT( - pPropertyBag->GetProperty( - XPS_FP_PRINTER_NAME, - &varPrinterName - ) - ); - - BSTR_t pPrinterName(varPrinterName.bstrVal); - - // - // Get the User Security Token - // Avoid CComVariant if getting the XPS_FP_USER_TOKEN property. - // Please refer to http://go.microsoft.com/fwlink/?LinkID=255534 for detailed information. - // - SafeVariant varUserSecurityToken; - THROW_ON_FAILED_HRESULT( - pPropertyBag->GetProperty( - XPS_FP_USER_TOKEN, - &varUserSecurityToken - ) - ); - - // - // Open the Print Ticket Provider - // - SafeHPTProvider_t pHProvider( - new SafeHPTProvider( - pPrinterName, - varUserSecurityToken.byref - ) - ); - - PrintTicketHandler_t toReturn( - new PrintTicketHandler( - pDOMDoc, - pHProvider, - pUserPrintTicket - ) - ); - - return toReturn; -} - -// -//Routine Name: -// -// PrintTicketHandler::PrintTicketHandler -// -//Routine Description: -// -// Constructor for the Print Ticket Handler. -// -//Arguments: -// -// pDoc - initialized MSXML DOM document -// pHProvider - handle to the Print Ticket Provider -// -PrintTicketHandler::PrintTicketHandler( - const IXMLDOMDocument2_t &pDoc, - SafeHPTProvider_t pHProvider, - const IStream_t &pUserPrintTicket - ) : m_pDOMDoc(pDoc), - m_pHProvider(pHProvider), - m_pDefaultUserPrintTicket(pUserPrintTicket) -{ -} - -// -//Routine Name: -// -// PrintTicketHandler::ProcessPrintTicket -// -//Routine Description: -// -// Gets the print ticket from the part, merges with -// the base ticket, and returns the result. -// -//Arguments: -// -// pBasePrintTicket - Base Print Ticket -// pDeltaPrintTicketPart - Delta Print Pipeline Print Ticket Part -// scope - Scope of the merged Print Ticket -// -//Return Value: -// -// IStream_t (smart pointer) -// Merged stream -// -IStream_t -PrintTicketHandler::ProcessPrintTicket( - const IStream_t &pBasePrintTicket, - const IPartPrintTicket_t &pDeltaPrintTicketPart, - EPrintTicketScope scope - ) -{ - IStream_t pMergedPrintTicket; - IStream_t pDeltaPrintTicket; - - pDeltaPrintTicket = GetStreamFromPart( - static_cast(pDeltaPrintTicketPart) - ); - - // - // Before calling PTMergeAndValidatePrintTicket, both input - // Print Ticket streams MUST be at position 0. The temp Print - // Ticket stream is already at position 0, but the Base Print - // Ticket may not be. Seek it to 0 to be sure. - // - LARGE_INTEGER zero; - zero.QuadPart = 0; - THROW_ON_FAILED_HRESULT( - pBasePrintTicket->Seek(zero, SEEK_SET, NULL) - ); - - // - // Merge the delta Print Ticket with the - // base Print Ticket - // - THROW_ON_FAILED_HRESULT( - ::CreateStreamOnHGlobal( - NULL, - TRUE, // delete on release - &pMergedPrintTicket - ) - ); - - m_pHProvider->PTMergeAndValidatePrintTicket( - pBasePrintTicket, - pDeltaPrintTicket, - scope, - pMergedPrintTicket - ); - - return pMergedPrintTicket; -} - -// -//Routine Name: -// -// PrintTicketHandler::ProcessPart -// -//Routine Description: -// -// Merges the Fixed Document Sequence Print Ticket with -// the default user Print Ticket and caches the result. -// -//Arguments: -// -// pFDS - Fixed Document Sequence part -// -void -PrintTicketHandler::ProcessPart( - const IFixedDocumentSequence_t &pFDS - ) -{ - IPartPrintTicket_t pPrintTicket; - - HRESULT hr = pFDS->GetPrintTicket(&pPrintTicket); - - // - // E_ELEMENT_NOT_FOUND means that this Fixed Document Sequence - // does not have a Print Ticket. Propagate the Default User - // Print Ticket. - // All other failed HRESULTs should be thrown. - // - if (hr == E_ELEMENT_NOT_FOUND) - { - m_pJobPrintTicket = m_pDefaultUserPrintTicket; - return; - } - - THROW_ON_FAILED_HRESULT(hr); - - m_pDocumentPrintTicket = NULL; - m_pPagePrintTicket = NULL; - - m_pJobPrintTicket = ProcessPrintTicket( - m_pDefaultUserPrintTicket, - pPrintTicket, - kPTJobScope - ); -} - -// -//Routine Name: -// -// PrintTicketHandler::ProcessPart -// -//Routine Description: -// -// Merges the Fixed Document Print Ticket with the -// Fixed Document Sequence Print Ticket and caches -// the result. The tickets are merged at the Document -// scope, so the result contains no job-level features. -// -//Arguments: -// -// pFD - Fixed Document part -// -void -PrintTicketHandler::ProcessPart( - const IFixedDocument_t &pFD - ) -{ - IPartPrintTicket_t pPrintTicket; - - HRESULT hr = pFD->GetPrintTicket(&pPrintTicket); - - // - // E_ELEMENT_NOT_FOUND means that this Fixed Document - // does not have a Print Ticket. Propagate the Job - // Print Ticket. - // All other failed HRESULTs should be thrown. - // - if (hr == E_ELEMENT_NOT_FOUND) - { - m_pDocumentPrintTicket = m_pJobPrintTicket; - return; - } - - THROW_ON_FAILED_HRESULT(hr); - - m_pPagePrintTicket = NULL; - - m_pDocumentPrintTicket = ProcessPrintTicket( - m_pJobPrintTicket, - pPrintTicket, - kPTDocumentScope - ); -} - -// -//Routine Name: -// -// PrintTicketHandler::ProcessPart -// -//Routine Description: -// -// Merges the Fixed Page Print Ticket with the -// Fixed Document Print Ticket and caches the result. -// The tickets are merged at the Page scope, so the -// result contains no job-level or document-level features. -// -//Arguments: -// -// pFP - Fixed Page part -// -void -PrintTicketHandler::ProcessPart( - const IFixedPage_t &pFP - ) -{ - IPartPrintTicket_t pPrintTicket; - - HRESULT hr = pFP->GetPrintTicket(&pPrintTicket); - - // - // E_ELEMENT_NOT_FOUND means that this Fixed Page - // does not have a Print Ticket. Propagate the Document - // Print Ticket. - // All other failed HRESULTs should be thrown. - // - if (hr == E_ELEMENT_NOT_FOUND) - { - m_pPagePrintTicket = m_pDocumentPrintTicket; - return; - } - - THROW_ON_FAILED_HRESULT(hr); - - m_pPagePrintTicket = ProcessPrintTicket( - m_pDocumentPrintTicket, - pPrintTicket, - kPTPageScope - ); -} - -// -//Routine Name: -// -// PrintTicketHandler::GetMergedPrintTicketParams -// -//Routine Description: -// -// Queries a set of parameters from the merged print ticket. -// -// NOTE: Relies on successful calls to all three PrintTicket -// processing methods. -// -//Return Value: -// -// ParametersFromPrintTicket -// The set of parameters queried from the merged -// Print Ticket. -// -ParametersFromPrintTicket -PrintTicketHandler::GetMergedPrintTicketParams() -{ - DoTraceMessage(XPSRASFILTER_TRACE_VERBOSE, L"Getting Print Ticket parameters"); - - if (!m_pPagePrintTicket) - { - DoTraceMessage(XPSRASFILTER_TRACE_ERROR, L"GetMergedPrintTicketParams called before ProcessPagePrintTicket"); - THROW_ON_FAILED_HRESULT(E_FAIL); - } - - ParametersFromPrintTicket params; - - // - // Seek the Page-level Print Ticket to 0 - // - LARGE_INTEGER zero; - zero.QuadPart = 0; - THROW_ON_FAILED_HRESULT( - m_pPagePrintTicket->Seek(zero, SEEK_SET, NULL) - ); - - // - // Load the print ticket stream into a DOM document - // - // NOTE: We are only looking for features at the Page scope for this sample, - // so we only extract features from the effective page-level PrintTicket. - // - Variant_t varStream(m_pPagePrintTicket); - VARIANT_BOOL success; - - THROW_ON_FAILED_HRESULT( - m_pDOMDoc->load(varStream, &success) - ); - if (!success) - { - WPP_LOG_ON_FAILED_HRESULT(E_FAIL); - THROW_ON_FAILED_HRESULT(E_FAIL); - } - - // - // Set the DOM Selection namespace to simplify queries - // - BSTR_t ns(L"xmlns:psf='http://schemas.microsoft.com/windows/2003/08/printing/printschemaframework'"); - Variant_t nsProp(ns); - THROW_ON_FAILED_HRESULT( - m_pDOMDoc->setProperty(L"SelectionNamespaces", nsProp) - ); - - // - // Query the print ticket for parameters of interest - // - params.destDPI = QueryDPI(); - params.scaling = QueryScaling(); - params.physicalPageSize = QueryPhysicalPageSize(); - - // - // We simulate imageable area by assuming a constant margin of - // around the entire page - // - params.imageableArea.x = g_pageMargin * xpsDPI; - params.imageableArea.y = g_pageMargin * xpsDPI; - params.imageableArea.height = params.physicalPageSize.height - - 2 * g_pageMargin * xpsDPI; - params.imageableArea.width = params.physicalPageSize.width - - 2 * g_pageMargin * xpsDPI; - - return params; -} - -// -//Routine Name: -// -// PrintTicketHandler::QueryDPI -// -//Routine Description: -// -// Queries the DPI from the Print Ticket using an XPath query. -// -//Return Value: -// -// FLOAT -// DPI from the Print Ticket. -// -FLOAT -PrintTicketHandler::QueryDPI() -{ - // - // Default DPI: 96 DPI - // - FLOAT dpi = 96.0; - - // - // Perform the page resolution query on the print ticket - // - IXMLDOMNodeList_t pNodes; - - // - // The following XPath query is fairly straightforward, except for the - // predicate attached to Feature. This is necessary to match both the - // keyword AND the namespace of the "name" of the Feature as in: - // - // - // - // In order to match the keyword, we match the substring after the colon: - // - // [substring-after(@name,':')='PageResolution'] - // - // We also need to ensure that the namespace refers to the correct - // printschemakeywords namespace. Thus we get: - // - // [name(namespace::*[.=PRINTSCHEMAKEYWORDNS])=substring-before(@name,':')] - // - // where PRINTSCHEMAKEYWORDNS is: - // - // http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords - // - BSTR_t query(L"psf:PrintTicket/psf:Feature[substring-after(@name,':')='PageResolution']" - L"[name(namespace::*[.='http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords'])=substring-before(@name,':')]" - L"/*/*/psf:Value"); - - THROW_ON_FAILED_HRESULT( - m_pDOMDoc->selectNodes(query, &pNodes) - ); - - if (pNodes) - { - // - // The Print Ticket may have both X and Y resolutions defined, but - // the Xps Rasterization Service only accepts a single resolution. - // We query for both X and Y resolutions and take the larger of the - // two as the destination DPI. The resultant raster data could then - // be scaled down in the other dimension to achieve the non-square - // pixels. - // - - LONG numResolutions; - - THROW_ON_FAILED_HRESULT( - pNodes->get_length(&numResolutions) - ); - - if (numResolutions != 0 && - numResolutions != 1 && - numResolutions != 2) - { - // - // We expect 0, 1, or 2 resolutions to be set in the Print Ticket. - // Throw if this is not the case. - // - THROW_ON_FAILED_HRESULT(E_UNEXPECTED); - } - - LONG maxResolution = 0; - - for (INT i = 0; i < numResolutions; i++) - { - IXMLDOMNode_t pCurrentNode; - - THROW_ON_FAILED_HRESULT( - pNodes->get_item(i, &pCurrentNode) - ); - - BSTR_t strResolution; - - THROW_ON_FAILED_HRESULT( - pCurrentNode->get_text(&strResolution) - ); - - LONG resolution; - - THROW_ON_FAILED_HRESULT( - ::VarI4FromStr( - strResolution, - LOCALE_USER_DEFAULT, - 0, // no custom flags - &resolution - ) - ); - - if (resolution > maxResolution) - { - maxResolution = resolution; - } - } - - dpi = static_cast(maxResolution); - } - - DoTraceMessage(XPSRASFILTER_TRACE_VERBOSE, L"Got DPI: %f", dpi); - - return dpi; -} - -// -//Routine Name: -// -// PrintTicketHandler::QueryPhysicalPageSize -// -//Routine Description: -// -// Queries the physical page size from the -// Print Ticket using an XPath query. -// -//Return Value: -// -// XPS_SIZE -// Physical page size from the Print Ticket (in XPS units). -// -XPS_SIZE -PrintTicketHandler::QueryPhysicalPageSize() -{ - // - // Default page size: 8.5" x 11" at Xps DPI - // - XPS_SIZE pageSize = {11.0f * xpsDPI, - 8.5f * xpsDPI}; - - { - // - // Perform the page width query on the print ticket - // - IXMLDOMNode_t pNode; - - // - // See the comment in PrintTicketHandler::QueryDPI() for details - // about this XPath query. - // - BSTR_t query(L"psf:PrintTicket/psf:Feature[substring-after(@name,':')='PageMediaSize']" - L"[name(namespace::*[.='http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords'])=substring-before(@name,':')]" - L"/*/psf:ScoredProperty[substring-after(@name,':')='MediaSizeWidth']" - L"[name(namespace::*[.='http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords'])=substring-before(@name,':')]" - L"/psf:Value"); - - THROW_ON_FAILED_HRESULT( - m_pDOMDoc->selectSingleNode(query, &pNode) - ); - - if (pNode) - { - BSTR_t strWidth; - THROW_ON_FAILED_HRESULT( - pNode->get_text(&strWidth) - ); - - LONG width; - THROW_ON_FAILED_HRESULT( - ::VarI4FromStr( - strWidth, - LOCALE_USER_DEFAULT, - 0, // no custom flags - &width - ) - ); - - // - // the page dimensions are in microns; convert to Xps units - // - pageSize.width = MicronsToXpsUnits(width); - } - } - - { - // - // Perform the page height query on the print ticket - // - IXMLDOMNode_t pNode; - - // - // See the comment in PrintTicketHandler::QueryDPI() for details - // about this XPath query. - // - BSTR_t query(L"psf:PrintTicket/psf:Feature[substring-after(@name,':')='PageMediaSize']" - L"[name(namespace::*[.='http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords'])=substring-before(@name,':')]" - L"/*/psf:ScoredProperty[substring-after(@name,':')='MediaSizeHeight']" - L"[name(namespace::*[.='http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords'])=substring-before(@name,':')]" - L"/psf:Value"); - - THROW_ON_FAILED_HRESULT( - m_pDOMDoc->selectSingleNode(query, &pNode) - ); - - if (pNode) - { - BSTR_t strHeight; - THROW_ON_FAILED_HRESULT( - pNode->get_text(&strHeight) - ); - - LONG height; - THROW_ON_FAILED_HRESULT( - ::VarI4FromStr( - strHeight, - LOCALE_USER_DEFAULT, - 0, // no custom flags - &height - ) - ); - - // - // the page dimensions are in microns; convert to Xps unit - // - pageSize.height = MicronsToXpsUnits(height); - } - } - - { - // - // Perform the landscape query on the print ticket - // - IXMLDOMNode_t pNode; - - // - // See the comment in PrintTicketHandler::QueryDPI() for details - // about this XPath query. - // - BSTR_t query(L"psf:PrintTicket/psf:Feature[substring-after(@name,':')='PageOrientation']" - L"[name(namespace::*[.='http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords'])=substring-before(@name,':')]" - L"/psf:Option[substring-after(@name,':')='Landscape']" - L"[name(namespace::*[.='http://schemas.microsoft.com/windows/2003/08/printing/printschemakeywords'])=substring-before(@name,':')]"); - - THROW_ON_FAILED_HRESULT( - m_pDOMDoc->selectSingleNode(query, &pNode) - ); - - if (pNode) - { - // - // landscape. swap height and width. - // - FLOAT tmp; - - tmp = pageSize.height; - pageSize.height = pageSize.width; - pageSize.width = tmp; - } - - DoTraceMessage(XPSRASFILTER_TRACE_VERBOSE, L"Physical Page Size: %f x %f", pageSize.width, pageSize.height); - } - - return pageSize; -} - -// -//Routine Name: -// -// PrintTicketHandler::QueryScaling -// -//Routine Description: -// -// Queries the desired type of scaling from the -// Print Ticket using an XPath query. -// -//Return Value: -// -// PrintTicketScaling -// Scaling type from the Print Ticket. -// -PrintTicketScaling -PrintTicketHandler::QueryScaling() -{ - // - // Default Scaling: FitApplicationBleedSizeToPageImageableSize - // - PrintTicketScaling scaling = SCALE_BLEEDTOIMAGEABLE; - - // - // We do not query for media scaling. Rather, we always return - // the equivalent of FitApplicationBleedSizeToPageImageableSize - // - return scaling; -} - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/PThandler.h b/print/XpsRasFilter/src/PThandler.h deleted file mode 100644 index 103e5d78..00000000 --- a/print/XpsRasFilter/src/PThandler.h +++ /dev/null @@ -1,112 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// PThandler.h -// -// Abstract: -// -// Print Ticket Handler class declaration. -// - -#pragma once - -namespace xpsrasfilter -{ - -class PrintTicketHandler -{ -public: - static - PrintTicketHandler_t - CreatePrintTicketHandler( - const IPrintPipelinePropertyBag_t &pPropertyBag - ); - - void - ProcessPart( - const IFixedDocumentSequence_t &pFDS - ); - - void - ProcessPart( - const IFixedDocument_t &pFD - ); - - void - ProcessPart( - const IFixedPage_t &pFP - ); - - ParametersFromPrintTicket - GetMergedPrintTicketParams(); - -private: - // - // Constructor is private; use CreatePrintTicketHandler - // to create instances. - // - PrintTicketHandler( - const IXMLDOMDocument2_t &pDoc, - SafeHPTProvider_t pHProvider, - const IStream_t &pUserPrintTicket - ); - - IStream_t - ProcessPrintTicket( - const IStream_t &pBasePrintTicket, - const IPartPrintTicket_t &pDeltaPrintTicketPart, - EPrintTicketScope scope - ); - - // - // Inline function to convert from microns to Xps Units - // - inline - FLOAT - MicronsToXpsUnits( - long dimensionInMicrons - ) - { - const FLOAT micronsPerInch = 25400.0f; // 2.54 cm/in --> 25400 um/in - - return ((static_cast(dimensionInMicrons) / micronsPerInch) * xpsDPI); - } - - // - // Routines to query parameters from the DOM document - // - FLOAT - QueryDPI(); - - XPS_SIZE - QueryPhysicalPageSize(); - - PrintTicketScaling - QueryScaling(); - - // - // MSXML DOM document - // - IXMLDOMDocument2_t m_pDOMDoc; - - // - // Handle to the Print Ticket Provider - // - SafeHPTProvider_t m_pHProvider; - - // - // Cached Print Tickets - // - IStream_t m_pDefaultUserPrintTicket; - IStream_t m_pJobPrintTicket; - IStream_t m_pDocumentPrintTicket; - IStream_t m_pPagePrintTicket; -}; - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/UnknownBase.h b/print/XpsRasFilter/src/UnknownBase.h deleted file mode 100644 index 5ecd2487..00000000 --- a/print/XpsRasFilter/src/UnknownBase.h +++ /dev/null @@ -1,158 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// UnknownBase.h -// -// Abstract: -// -// IUnknown implementation common to filter components derived from -// IUnknown. -// - -#pragma once - -namespace xpsrasfilter -{ - -template -class UnknownBase : public Interface -{ -public: - UnknownBase() : m_cRef(1) { } - virtual ~UnknownBase() { }; - - // - //Routine Name: - // - // UnknownBase::QueryInterface - // - //Routine Description: - // - // Implements IUnknown QueryInterface. - // - //Arguments: - // - // riid - id of the interface - // ppv - void pointer to the requested interface - // - //Return Value: - // - // HRESULT - // S_OK - On success - // E_NOINTERFACE - Invalid interface - // - _Must_inspect_result_ - HRESULT STDMETHODCALLTYPE - QueryInterface( - _In_ REFIID riid, - _Outptr_ PVOID *ppv - ) - { - HRESULT hr = S_OK; - - if (ppv == NULL) - { - WPP_LOG_ON_FAILED_HRESULT(E_POINTER); - - return E_POINTER; - } - - if (riid == IID_IUnknown) - { - *ppv = static_cast(this); - } - else if (riid == __uuidof(Interface)) - { - *ppv = static_cast(this); - } - else - { - *ppv = NULL; - WPP_LOG_ON_FAILED_HRESULT( - hr = E_NOINTERFACE - ); - } - - if (SUCCEEDED(hr)) - { - AddRef(); - } - - return hr; - } - - // - //Routine Name: - // - // UnknownBase::AddRef - // - //Routine Description: - // - // Implements IUnknown reference count increment - // on the current interface. - // - //Arguments: - // - // None - // - //Return Value: - // - // ULONG - // New reference count - // - ULONG STDMETHODCALLTYPE - AddRef() - { - return ::InterlockedIncrement(&m_cRef); - } - - // - //Routine Name: - // - // UnknownBase::Release - // - //Routine Description: - // - // Implements IUnknown reference count decrement - // on the current interface. - // - //Arguments: - // - // None - // - //Return Value: - // - // ULONG - // New reference count - // - //Note: - // - // The drv_at annotation tells Prefast to consider this object's memory - // freed after Release has been called. - // - _At_(this, __drv_freesMem(object)) - ULONG STDMETHODCALLTYPE - Release() - { - ULONG cRef = ::InterlockedDecrement(&m_cRef); - - if (0 == cRef) - { - delete this; - } - - return cRef; - } - -private: - volatile ULONG m_cRef; // interface reference count -}; - -} // namespace xpsrasfilter - diff --git a/print/XpsRasFilter/src/WppTrace.cpp b/print/XpsRasFilter/src/WppTrace.cpp deleted file mode 100644 index b788c461..00000000 --- a/print/XpsRasFilter/src/WppTrace.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// WppTrace.h -// -// Abstract: -// -// WPP tracing definitions. -// - -#include "precomp.h" -#include "WppTrace.h" - -#include "WppTrace.tmh" - -namespace xpsrasfilter -{ - -void TraceFailedHRESULT( - HRESULT hr, - char const *fileName, - int lineNum, - wchar_t const *extraText - ) -{ - DoTraceMessage(XPSRASFILTER_TRACE_ERROR, - "Failed HRESULT (%!HRESULT!) at %s:%d (%S)", - hr, - fileName, - lineNum, - extraText - ); -} - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/WppTrace.h b/print/XpsRasFilter/src/WppTrace.h deleted file mode 100644 index 4f33db3b..00000000 --- a/print/XpsRasFilter/src/WppTrace.h +++ /dev/null @@ -1,58 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// WppTrace.h -// -// Abstract: -// -// WPP tracing definitions. -// - -#pragma once - -#define WPP_CONTROL_GUIDS WPP_DEFINE_CONTROL_GUID( \ - XpsRasFilter, \ - (EB4C6075, 0B67, 4a79, A0A3, 7CD9DF881194), \ - WPP_DEFINE_BIT(XPSRASFILTER_TRACE_ERROR) \ - WPP_DEFINE_BIT(XPSRASFILTER_TRACE_WARNING) \ - WPP_DEFINE_BIT(XPSRASFILTER_TRACE_INFO) \ - WPP_DEFINE_BIT(XPSRASFILTER_TRACE_VERBOSE) \ - ) - -#define WPP_LOG_ON_FAILED_HRESULT_WITH_TEXT(func_,text_) \ - { \ - HRESULT hr_ = func_; \ - if (FAILED(hr_)) \ - { \ - xpsrasfilter::TraceFailedHRESULT( \ - hr_, \ - __FILE__, \ - __LINE__, \ - text_ \ - ); \ - } \ - } - -#define WPP_LOG_ON_FAILED_HRESULT(func_) \ - { \ - WPP_LOG_ON_FAILED_HRESULT_WITH_TEXT(func_, L"") \ - } - -namespace xpsrasfilter -{ - -void -TraceFailedHRESULT( - HRESULT hr, - char const *fileName, - int lineNum, - wchar_t const *extraText - ); - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/dllentry.cpp b/print/XpsRasFilter/src/dllentry.cpp deleted file mode 100644 index 8e19ae16..00000000 --- a/print/XpsRasFilter/src/dllentry.cpp +++ /dev/null @@ -1,326 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// dllentry.cpp -// -// Abstract: -// -// Xps Rasterization Service filter DLL entry points. -// - -#include "precomp.h" -#include "WppTrace.h" -#include "Exception.h" -#include "filtertypes.h" -#include "UnknownBase.h" -#include "xpsrasfilter.h" - -#include "dllentry.tmh" - -namespace xpsrasfilter -{ - -// -// Class Factory returned by DllGetClassObject() -// -class __declspec( uuid("CFF7BE69-E62D-403b-BE4F-48EC73F5DA1A") ) XPSRasFilterFactory : public UnknownBase -{ -public: - XPSRasFilterFactory() : - m_serverLocks(0) - { - ::InterlockedIncrement(&XPSRasFilter::ms_numObjects); - } - - ~XPSRasFilterFactory() - { - ::InterlockedDecrement(&XPSRasFilter::ms_numObjects); - } - - // - //Routine Name: - // - // XPSRasFilterFactory::CreateInstance - // - //Routine Description: - // - // Returns an instance of XPSRasFilter. - // - //Arguments: - // - // pUnkOuter - Outer class (must be NULL) - // riid - Requested interface (IPrintPipelineFilter) - // ppvObject - Pointer to the requested interface - // - //Return Value: - // - // HRESULT - // S_OK - On success - // Otherwise - Failure - // - HRESULT - STDMETHODCALLTYPE - CreateInstance( - IUnknown *pUnkOuter, - REFIID riid, - void **ppvObject - ) - { - HRESULT hr = S_OK; - - if (pUnkOuter != NULL) - { - WPP_LOG_ON_FAILED_HRESULT(CLASS_E_NOAGGREGATION); - - return CLASS_E_NOAGGREGATION; - } - - if (ppvObject == NULL) - { - WPP_LOG_ON_FAILED_HRESULT(E_POINTER); - - return E_POINTER; - } - - *ppvObject = NULL; - - xpsrasfilter::XPSRasFilter *pFilter = NULL; - - // - // XpsRasFilter::XpsRasFilter() can throw, as can new - // - try - { - DoTraceMessage(XPSRASFILTER_TRACE_INFO, L"Instantiating filter"); - pFilter = new xpsrasfilter::XPSRasFilter(); - } - CATCH_VARIOUS(hr) - - if (SUCCEEDED(hr)) - { - WPP_LOG_ON_FAILED_HRESULT( - hr = pFilter->QueryInterface(riid, ppvObject) - ); - - pFilter->Release(); - } - - return hr; - } - - // - //Routine Name: - // - // XPSRasFilterFactory::LockServer - // - //Routine Description: - // - // Allows clients to lock the filter factory in - // memory. - // - //Arguments: - // - // fLock - TRUE - lock; FALSE - unlock - // - //Return Value: - // - // HRESULT - // S_OK - On success - // - HRESULT - STDMETHODCALLTYPE - LockServer( - BOOL fLock - ) - { - LONG result; - - if (fLock) // lock - { - result = ::InterlockedIncrement(&m_serverLocks); - - if (result == 1) - { - // - // This was the first 'lock' call; increment the - // global numObjects - // - ::InterlockedIncrement(&XPSRasFilter::ms_numObjects); - } - } - else // unlock - { - result = ::InterlockedDecrement(&m_serverLocks); - - if (result == 0) - { - // - // All locks have been unlocked; decrement the - // global numObjects - // - ::InterlockedDecrement(&XPSRasFilter::ms_numObjects); - } - } - - return S_OK; - } - -private: - volatile LONG m_serverLocks; -}; - -} // namespace xpsrasfilter - -// -//Routine Name: -// -// DllGetClassObject -// -//Routine Description: -// -// Returns an instance of XPSRasFilterFactory. -// -//Arguments: -// -// rclsid - Requested class (XPSRasFilter) -// riid - Requested interface (IClassFactory) -// ppv - Pointer to the requested interface -// -//Return Value: -// -// HRESULT -// S_OK - On success -// Otherwise - Failure -// -STDAPI -DllGetClassObject( - _In_ REFCLSID rclsid, - _In_ REFIID riid, - _Outptr_ LPVOID *ppv - ) -{ - HRESULT hr = S_OK; - - if (ppv == NULL) - { - WPP_LOG_ON_FAILED_HRESULT(E_POINTER); - - return E_POINTER; - } - - *ppv = NULL; - - if (rclsid != __uuidof(xpsrasfilter::XPSRasFilterFactory)) - { - WPP_LOG_ON_FAILED_HRESULT(CLASS_E_CLASSNOTAVAILABLE); - - return CLASS_E_CLASSNOTAVAILABLE; - } - - DoTraceMessage(XPSRASFILTER_TRACE_INFO, L"Instantiating class factory"); - - xpsrasfilter::XPSRasFilterFactory *pFactory = NULL; - pFactory = new(std::nothrow) xpsrasfilter::XPSRasFilterFactory(); - - if (pFactory == NULL) - { - WPP_LOG_ON_FAILED_HRESULT(E_OUTOFMEMORY); - - hr = E_OUTOFMEMORY; - } - - if (SUCCEEDED(hr)) - { - WPP_LOG_ON_FAILED_HRESULT( - hr = pFactory->QueryInterface(riid, ppv) - ); - - pFactory->Release(); - } - - return hr; -} - -// -//Routine Name: -// -// DllCanUnloadNow -// -//Routine Description: -// -// Checks whether the DLL can be unloaded. That is, -// whether there are any instances of XPSRasFilter. -// -//Arguments: -// -// None -// -//Return Value: -// -// HRESULT -// S_OK - Can unload. -// Otherwise - Cannot unload. -// -STDAPI -DllCanUnloadNow() -{ - return (0 == xpsrasfilter::XPSRasFilter::ms_numObjects) ? S_OK : S_FALSE; -} - -// -//Routine Name: -// -// DllMain -// -//Routine Description: -// -// Initializes WPP tracing when the DLL is loaded -// and cleans up WPP tracing when the DLL is unloaded. -// -//Arguments: -// -// None -// -//Return Value: -// -// HRESULT -// S_OK - On success. -// Otherwise - Otherwise. -// -extern "C" -BOOL -WINAPI -DllMain( - _In_ HINSTANCE hinstDLL, - _In_ DWORD fdwReason, - _In_opt_ LPVOID /*lpvReserved*/ - ) -{ - switch(fdwReason) - { - case DLL_PROCESS_ATTACH: - - ::DisableThreadLibraryCalls(hinstDLL); - - WPP_INIT_TRACING(L"XpsRasFilter"); - DoTraceMessage(XPSRASFILTER_TRACE_INFO, L"DLL_PROCESS_ATTACH"); - - break; - - case DLL_PROCESS_DETACH: - - DoTraceMessage(XPSRASFILTER_TRACE_INFO, L"DLL_PROCESS_DETACH"); - WPP_CLEANUP(); - - break; - } - - return TRUE; -} - diff --git a/print/XpsRasFilter/src/filtertypes.h b/print/XpsRasFilter/src/filtertypes.h deleted file mode 100644 index 6b5c35e6..00000000 --- a/print/XpsRasFilter/src/filtertypes.h +++ /dev/null @@ -1,497 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// filtertypes.h -// -// Abstract: -// -// Smart pointer types. Shared structures and enums. -// - -#pragma once - -// -// XpsDrv Print Pipeline types -// -typedef CComPtr IXpsDocument_t; -typedef CComPtr IFixedDocumentSequence_t; -typedef CComPtr IFixedDocument_t; -typedef CComPtr IFixedPage_t; -typedef CComPtr IPrintReadStreamFactory_t; -typedef CComPtr IPrintReadStream_t; -typedef CComPtr IPrintWriteStream_t; -typedef CComPtr IInterFilterCommunicator_t; -typedef CComPtr IPrintPipelinePropertyBag_t; -typedef CComPtr IPrintPipelineManagerControl_t; -typedef CComPtr IXpsDocumentProvider_t; -typedef CComPtr IXpsDocumentConsumer_t; -typedef CComPtr IXpsPartIterator_t; -typedef CComPtr IPartBase_t; -typedef CComPtr IPartFont2_t; -typedef CComPtr IPartFont_t; -typedef CComPtr IPartImage_t; -typedef CComPtr IPartColorProfile_t; -typedef CComPtr IPartResourceDictionary_t; -typedef std::vector> ResourceDictionaryList_t; -typedef CComPtr IPartPrintTicket_t; - -// -// Xps Object Model types -// -typedef CComPtr IXpsOMObjectFactory_t; -typedef CComPtr IXpsOMPartResources_t; -typedef CComPtr IXpsOMFontResourceCollection_t; -typedef CComPtr IXpsOMImageResourceCollection_t; -typedef CComPtr IXpsOMColorProfileResourceCollection_t; -typedef CComPtr IXpsOMRemoteDictionaryResourceCollection_t; -typedef CComPtr IXpsOMFontResource_t; -typedef CComPtr IXpsOMImageResource_t; -typedef CComPtr IXpsOMColorProfileResource_t; -typedef CComPtr IXpsOMRemoteDictionaryResource_t; -typedef CComPtr IXpsOMPage_t; - -// -// Opc Types -// -typedef CComPtr IOpcFactory_t; -typedef CComPtr IOpcPartUri_t; - -// -// Common types -// -typedef CComPtr IStream_t; -typedef CComPtr IUnknown_t; -typedef CComBSTR BSTR_t; -typedef CComVariant Variant_t; -typedef CComPtr IPropertyBag2_t; - -// -// WIC types -// -typedef CComPtr IWICImagingFactory_t; -typedef CComPtr IWICBitmap_t; -typedef CComPtr IWICStream_t; -typedef CComPtr IWICBitmapEncoder_t; -typedef CComPtr IWICBitmapFrameEncode_t; - -// -// Xps Rasterization Service types -// -typedef CComPtr IXpsRasterizationFactory_t; -typedef CComPtr IXpsRasterizer_t; - -// -// MSXML DOM types -// -typedef CComPtr IXMLDOMDocument2_t; -typedef CComPtr IXMLDOMNode_t; -typedef CComPtr IXMLDOMNodeList_t; - -namespace xpsrasfilter -{ - -// -// Supported types of print ticket scaling -// -enum PrintTicketScaling -{ - SCALE_NONE, - SCALE_BLEEDTOIMAGEABLE, - SCALE_CONTENTTOIMAGEABLE, - SCALE_MEDIASIZETOIMAGEABLE, - SCALE_MEDIASIZETOMEDIASIZE -}; - -// -// Parameters that can be read from the Print Ticket -// to feed into rasterization calculations. -// -struct ParametersFromPrintTicket -{ - XPS_SIZE physicalPageSize; // in XPS units - PrintTicketScaling scaling; // scaling type - FLOAT destDPI; // target rasterization dpi - XPS_RECT imageableArea; // in XPS units -}; - -// -// Parameters read from the FixedPage -// to feed into rasterization calculations. -// -struct ParametersFromFixedPage -{ - XPS_SIZE fixedPageSize; // in XPS units - XPS_RECT bleedBoxRect; // in XPS units - XPS_RECT contentBoxRect; // in XPS units -}; - -// -// Forward Declarations -// -class RasterizationInterface; -class PrintTicketHandler; -class TiffStreamBitmapHandler; -class FilterLiveness; - -} // namespace xpsrasfilter - -// -// This class handles setting and clearing the security -// context, based on a token. This token is retrieved from -// the filter pipeline, and we do not want to free it. -// -class ScopeImpersonation -{ -public: - ScopeImpersonation( - HANDLE token - ) - { - if ( - !SetThreadToken( - NULL, // set the current thread's token - token - ) - ) - { - THROW_LAST_ERROR(); - } - } - - ~ScopeImpersonation() - { - if ( - !SetThreadToken( - NULL, // set the current thread's token - NULL // revert to default security context - ) - ) - { - // - // We couldn't revert the security context. The filter pipeline - // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can log the - // error and continue to run. - // - DWORD error = ::GetLastError(); - - WPP_LOG_ON_FAILED_HRESULT_WITH_TEXT( - HRESULT_FROM_WIN32(error), - L"Failed to revert thread security context." - ); - } - } - -private: - ScopeImpersonation(ScopeImpersonation const&); - ScopeImpersonation& operator=(ScopeImpersonation const&); -}; - -// -// RAII object to make HGLOBAL locks exception-safe. This requires -// unlocking during unwind. -// -class HGlobalLock -{ -public: - HGlobalLock( - HGLOBAL hG - ) : - m_hGlobal(hG) - { - m_pAddress = static_cast( - ::GlobalLock(m_hGlobal) - ); - - if (!m_pAddress) - { - THROW_LAST_ERROR(); - } - } - - ~HGlobalLock() - { - if (!::GlobalUnlock(m_hGlobal)) - { - WPP_LOG_ON_FAILED_HRESULT( - HRESULT_FROM_WIN32(::GetLastError()) - ); - } - } - - BYTE* - GetAddress() - { - return m_pAddress; - } -private: - HGLOBAL m_hGlobal; - BYTE *m_pAddress; - - HGlobalLock(HGlobalLock const&); - HGlobalLock& operator=(HGlobalLock const&); - -}; - -typedef std::auto_ptr HGlobalLock_t; - -// -// Safe handle to make HGLOBAL exception-safe. This requires both -// freeing and unlocking during unwind. -// -class SafeHGlobal -{ -public: - - SafeHGlobal( - UINT flags, - SIZE_T size - ) - { - m_hGlobal = ::GlobalAlloc(flags, size); - - if (!m_hGlobal) - { - THROW_ON_FAILED_HRESULT(E_OUTOFMEMORY); - } - } - - virtual - ~SafeHGlobal() - { - if (m_hGlobal) - { - // - // Free the HGLOBAL - // - ::GlobalFree(m_hGlobal); - } - } - - operator HGLOBAL() - { - return m_hGlobal; - } - - // - // Passes ownership of the HGLOBAL from this safe handle - // to a new IStream. - // - IStream_t - ConvertToIStream() - { - IStream_t pStream; - - THROW_ON_FAILED_HRESULT( - ::CreateStreamOnHGlobal( - m_hGlobal, - TRUE, // Free the HGLOBAL on Release of the stream - &pStream - ) - ); - - m_hGlobal = NULL; - - return pStream; - } - - HGlobalLock_t - Lock() - { - HGlobalLock_t toReturn( - new HGlobalLock(m_hGlobal) - ); - return toReturn; - } - -private: - - HGLOBAL m_hGlobal; - - SafeHGlobal(SafeHGlobal const&); - SafeHGlobal& operator=(SafeHGlobal const&); - -}; - -// -// Safe handle to make HPTPROVIDER exception safe. This -// requires closing the provider during unwind. -// -class SafeHPTProvider -{ -public: - SafeHPTProvider( - const wchar_t *printerName, - HANDLE userSecurityToken - ) : - m_token(userSecurityToken) - { - // - // We impersonate the user while we call PTQuerySchemaVersionSupport - // and PTOpenProviderEx. - // - ScopeImpersonation impersonate(m_token); - - DWORD maxVersion, - tempVersion; - - THROW_ON_FAILED_HRESULT( - ::PTQuerySchemaVersionSupport( - printerName, - &maxVersion - ) - ); - - THROW_ON_FAILED_HRESULT( - ::PTOpenProviderEx( - printerName, - maxVersion, // maximum version - maxVersion, // preferred version - &m_hProvider, - &tempVersion // version used by the provider - ) - ); - } - - virtual - ~SafeHPTProvider() - { - WPP_LOG_ON_FAILED_HRESULT( - ::PTCloseProvider(m_hProvider) - ); - } - - void - PTMergeAndValidatePrintTicket( - const IStream_t &pBasePrintTicket, - const IStream_t &pDeltaPrintTicket, - EPrintTicketScope scope, - _Inout_ IStream_t &pMergedPrintTicket - ) - { - // - // We impersonate the user while we call PTMergeAndValidatePrintTicket. - // - ScopeImpersonation impersonate(m_token); - - BSTR_t error; - - HRESULT hr = ::PTMergeAndValidatePrintTicket( - m_hProvider, - pBasePrintTicket, - pDeltaPrintTicket, - scope, - pMergedPrintTicket, - &error - ); - - WPP_LOG_ON_FAILED_HRESULT_WITH_TEXT( - hr, - error - ); - - THROW_ON_FAILED_HRESULT(hr); - } - -private: - - HPTPROVIDER m_hProvider; - HANDLE m_token; - - SafeHPTProvider(SafeHPTProvider const&); - SafeHPTProvider& operator=(SafeHPTProvider const&); -}; - -// -// CoInitialize/CoUninitialize RAII object -// -// This object ensures that COM is initialized for the duration -// of the XpsRasFilter's lifetime, and then uninitialized after -// all of the COM objects, regardless of how the filter exits -// -class SafeCoInit -{ -public: - SafeCoInit() : - m_doCoUninitialize(FALSE) - { - // - // Initialize COM - // - HRESULT hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED); - - if (FAILED(hr) && - hr != RPC_E_CHANGED_MODE) - { - // - // RPC_E_CHANGED_MODE indicates that we attempted to change the - // threading model. It is safe to ignore since we do not *require* - // multi-threading. Throw on any other errors. - // - - THROW_ON_FAILED_HRESULT(hr); - } - else if (SUCCEEDED(hr)) - { - // - // It is important that we only call CoUninitialize() if we - // succeeded in setting the threading model. - // - - m_doCoUninitialize = TRUE; - } - } - - ~SafeCoInit() - { - if (m_doCoUninitialize) - { - ::CoUninitialize(); - } - } -private: - SafeCoInit(SafeCoInit const&); - SafeCoInit& operator=(SafeCoInit const&); - - BOOL m_doCoUninitialize; -}; - -// -// RAII object to make VARIANT exception-safe. This requires -// VariantClear during unwind. -// -class SafeVariant : public VARIANT -{ -public: - SafeVariant() - { - ::VariantInit(this); - } - - ~SafeVariant() - { - ::VariantClear(this); - } -private: - SafeVariant(SafeVariant const&); - SafeVariant& operator=(SafeVariant const&); -}; - -// -// Internal Types -// -typedef std::auto_ptr RasterizationInterface_t; -typedef std::auto_ptr PrintTicketHandler_t; -typedef std::auto_ptr TiffStreamBitmapHandler_t; -typedef std::auto_ptr SafeHGlobal_t; -typedef std::auto_ptr SafeHPTProvider_t; -typedef CComPtr FilterLiveness_t; - diff --git a/print/XpsRasFilter/src/precomp.h b/print/XpsRasFilter/src/precomp.h deleted file mode 100644 index 8cfbe37b..00000000 --- a/print/XpsRasFilter/src/precomp.h +++ /dev/null @@ -1,87 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// precomp.h -// -// Abstract: -// -// Precompiled header for the Xps Rasterization Service sample filter. -// - -#pragma once - -// -// Define this as a usermode driver for analysis purposes -// -#include -__user_driver - -// -// Standard Annotation Language include -// -#include - -// -// Windows includes -// -#include - -// Standard includes -#include -#include -#include -#include - -// STL -#include - -// -// COM includes -// -#include -#include - -// -// Filter pipeline includes -// -#include -#include -#include -#include - -// -// ATL -// -#include - -// -// WIC -// -#include - -// -// MSXML -// -#include - -// -// OPC Layer -// -#include - -// -// Xps Object Model -// -#include - -// -// Xps Rasterization Service -// -#include - diff --git a/print/XpsRasFilter/src/precompsrc.cpp b/print/XpsRasFilter/src/precompsrc.cpp deleted file mode 100644 index 5944cf51..00000000 --- a/print/XpsRasFilter/src/precompsrc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/XpsRasFilter/src/rasinterface.cpp b/print/XpsRasFilter/src/rasinterface.cpp deleted file mode 100644 index adbf73e4..00000000 --- a/print/XpsRasFilter/src/rasinterface.cpp +++ /dev/null @@ -1,412 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// rasinterface.cpp -// -// Abstract: -// -// Class to wrap rasterization-related calculations, interactions with -// the Xps Rasterization Service, Xps Rasterization Service Callback, -// and eventual raster output (i.e. TIFF encoding) -// - -#include "precomp.h" -#include "WppTrace.h" -#include "Exception.h" -#include "filtertypes.h" -#include "UnknownBase.h" -#include "xpsrasfilter.h" -#include "OMConvertor.h" -#include "rasinterface.h" -#include "BitmapHandler.h" - -#include "rasinterface.tmh" - -namespace xpsrasfilter -{ - -// -//Routine Name: -// -// RasterizationInterface::CreateRasterizationInterface -// -//Routine Description: -// -// Static factory method that creates an instance of -// RasterizationInterface. -// -//Arguments: -// -// pPropertyBag - Property Bag -// pStream - Filter output stream (IPrintWriteStream) -// -//Return Value: -// -// RasterizationInterface_t (smart ptr) -// The new RasterizationInterface. -// -RasterizationInterface_t -RasterizationInterface::CreateRasterizationInterface( - const IPrintPipelinePropertyBag_t &pPropertyBag, - const IPrintWriteStream_t &pStream - ) -{ - Variant_t varRasFactory; - IXpsRasterizationFactory_t pXPSRasFactory; - - // - // Get the Xps Rasterization Service factory. Since XpsRasterService.dll - // is specified as an OptionalFilterServiceProvider in the filter pipeline - // configuration file, the factory may not be available in the property bag - // (e.g. when running on Windows Vista, Windows XP, etc). In this case, - // this call will fail and the filter could fail, as we do here, or could - // default to some other behavior. - // - THROW_ON_FAILED_HRESULT( - pPropertyBag->GetProperty( - L"MS_IXpsRasterizationFactory", - &varRasFactory - ) - ); - - IUnknown_t pUnk(varRasFactory.punkVal); - - THROW_ON_FAILED_HRESULT( - pUnk.QueryInterface(&pXPSRasFactory) - ); - - // - // Prepare the rasterization/encode/stream interface - // - TiffStreamBitmapHandler_t pBitmapHandler( - TiffStreamBitmapHandler::CreateTiffStreamBitmapHandler(pStream) - ); - - RasterizationInterface_t pReturnInterface( - new RasterizationInterface( - pXPSRasFactory, - pBitmapHandler - ) - ); - - return pReturnInterface; -} - -// -//Routine Name: -// -// RasterizationInterface::RasterizationInterface -// -//Routine Description: -// -// Construct the Rasterization Interface with the -// IXpsRasterizationFactory interface and bitmap -// handler. -// -//Arguments: -// -// pRasFactory - Xps Rasterization Service object factory -// pBitmapHandler - Class to handle band bitmaps -// -RasterizationInterface::RasterizationInterface( - const IXpsRasterizationFactory_t &pRasFactory, - TiffStreamBitmapHandler_t pBitmapHandler - ) : m_pXPSRasFactory(pRasFactory), - m_pBitmapHandler(pBitmapHandler) -{ -} - -// -//Routine Name: -// -// RasterizationInterface::FinishRasterization -// -//Routine Description: -// -// Tell the Rasterization Interface that the last -// page has been rasterized. -// -//Arguments: -// -// None -// -void -RasterizationInterface::FinishRasterization() -{ - m_pBitmapHandler->WriteFooter(); -} - - -// -//Routine Name: -// -// RasterizationInterface::RasterizeAndStreamPage -// -//Routine Description: -// -// Given an IXpsOMPage and a set of Print Ticket -// parameters, this method invokes the Xps Rasterization -// Service for each band of the page, and outputs the -// resultant raster data. -// -//Arguments: -// -// pPage - page to rasterize -// printTicketparams - raw parameters from the print ticket(s) -// -void -RasterizationInterface::RasterizePage( - const IXpsOMPage_t &pPage, - const ParametersFromPrintTicket &printTicketParams, - const FilterLiveness_t &pLiveness - ) -{ - // - // Calculate rasterization parameters - // - ParametersFromFixedPage fixedPageParams; - THROW_ON_FAILED_HRESULT( - pPage->GetPageDimensions(&fixedPageParams.fixedPageSize) - ); - THROW_ON_FAILED_HRESULT( - pPage->GetBleedBox(&fixedPageParams.bleedBoxRect) - ); - THROW_ON_FAILED_HRESULT( - pPage->GetContentBox(&fixedPageParams.contentBoxRect) - ); - - RasterizationParameters rastParams( - printTicketParams, - fixedPageParams - ); - - // - // Create the Rasterizer - // - IXpsRasterizer_t rasterizer; - THROW_ON_FAILED_HRESULT( - m_pXPSRasFactory->CreateRasterizer( - pPage, - rastParams.rasterizationDPI, - XPSRAS_RENDERING_MODE_ANTIALIASED, - XPSRAS_RENDERING_MODE_ANTIALIASED, - &rasterizer - ) - ); - - // - // Set the minimal line width to 1 pixel - // - THROW_ON_FAILED_HRESULT( - rasterizer->SetMinimalLineWidth(1) - ); - - // - // Loop over bands - // - INT bandOriginY = 0; - - while (pLiveness->IsAlive() && - bandOriginY < rastParams.rasterHeight) - { - DoTraceMessage(XPSRASFILTER_TRACE_VERBOSE, L"Rasterizing Band"); - - IWICBitmap_t bitmap; - - // - // Calculate the height of this band - // - INT bandHeight = rastParams.bandHeight; - if (bandOriginY + rastParams.bandHeight >= rastParams.rasterHeight) - { - bandHeight = rastParams.rasterHeight - bandOriginY; - } - - // - // Rasterize this band - // - { - HRESULT hr = rasterizer->RasterizeRect( - rastParams.originX, - bandOriginY + rastParams.originY, - rastParams.rasterWidth, - bandHeight, - static_cast(pLiveness), - &bitmap - ); - - // - // Do not throw if we have cancelled rasterization - // - if (hr == HRESULT_FROM_WIN32(ERROR_PRINT_CANCELLED)) - { - DoTraceMessage(XPSRASFILTER_TRACE_VERBOSE, L"Rasterization Cancelled"); - return; - } - - THROW_ON_FAILED_HRESULT(hr); - } - - bandOriginY += bandHeight; - - // - // The resolution of the bitmap defaults to the - // rasterization DPI, which includes the scaling factor. - // We want the output bitmap to reflect the destination DPI. - // - THROW_ON_FAILED_HRESULT( - bitmap->SetResolution( - printTicketParams.destDPI, - printTicketParams.destDPI - ) - ); - - // - // Encode the raster data as TIFF and stream out - // - m_pBitmapHandler->ProcessBitmap(bitmap); - } -} - -// -//Routine Name: -// -// RasterizationParameters::RasterizationParameters -// -//Routine Description: -// -// Given a set of fixed page parameters and a set of Print Ticket -// parameters, this constructor calculates the parameters necessary to -// invoke the Xps Rasterization Service. -// -//Arguments: -// -// printTicketparams - raw parameters from the print ticket(s) -// fixedPageParams - raw parameters from the fixed page -// -RasterizationParameters::RasterizationParameters( - const ParametersFromPrintTicket &printTicketParams, - const ParametersFromFixedPage &fixedPageParams - ) -{ - // - // Rasterize the entire physical page at the desired resolution. The fixed page - // is scaled and traslated to place it correctly witin the physical page. - // - rasterHeight = static_cast( - printTicketParams.physicalPageSize.height - * (printTicketParams.destDPI / xpsDPI) - + 0.5 - ); - rasterWidth = static_cast( - printTicketParams.physicalPageSize.width - * (printTicketParams.destDPI / xpsDPI) - + 0.5 - ); - - // - // Determine the source rectangle for the scale operation - // - XPS_RECT srcRect = {0,0,0,0}; - - switch(printTicketParams.scaling) - { - case SCALE_BLEEDTOIMAGEABLE: - - srcRect = fixedPageParams.bleedBoxRect; - - break; - default: - DoTraceMessage(XPSRASFILTER_TRACE_ERROR, L"Unknown scaling type"); - THROW_ON_FAILED_HRESULT(E_UNEXPECTED); - break; - } - - // - // Determine the destination rectangle for the scale operation - // - XPS_RECT destRect = {0,0,0,0}; - - switch(printTicketParams.scaling) - { - case SCALE_BLEEDTOIMAGEABLE: - - destRect = printTicketParams.imageableArea; - - break; - default: - DoTraceMessage(XPSRASFILTER_TRACE_ERROR, L"Unknown scaling type"); - THROW_ON_FAILED_HRESULT(E_UNEXPECTED); - break; - } - - - // - // Because we want to fit the fixed page into a physical page of - // potentially different aspect ratio, it is necessary to calculate - // the scaling factor assuming either the height or width constrains - // the operation; the rasterization dpi is then the smaller of the two. - // - // - // The basic calculation for scaling factor is: - // - // Scaling Factor = (Destination Dimension / Source Dimension) - // - // Multiplying by desired Destination DPI we get the DPI at which to - // rasterize the source content in order to get the desired size - // - // Rasterization DPI = Scaling Factor * Desired Destination DPI - // - { - FLOAT heightScalingFactor = destRect.height / srcRect.height; - FLOAT widthScalingFactor = destRect.width / srcRect.width; - - FLOAT heightRastDPI = heightScalingFactor * printTicketParams.destDPI; - FLOAT widthRastDPI = widthScalingFactor * printTicketParams.destDPI; - - rasterizationDPI = min(heightRastDPI, widthRastDPI); - } - - // - // To determine the rasterization origin, subtract the translation - // due to the destination rectangle (e.g. imageable area) from the - // translation due to the choice of scale (e.g. bleed box origin) - // - { - FLOAT srcOffsetX = srcRect.x * rasterizationDPI / xpsDPI; - FLOAT srcOffsetY = srcRect.y * rasterizationDPI / xpsDPI; - - FLOAT destOffsetX = destRect.x * printTicketParams.destDPI / xpsDPI; - FLOAT destOffsetY = destRect.y * printTicketParams.destDPI / xpsDPI; - - originX = static_cast(srcOffsetX - destOffsetX - 0.5); - originY = static_cast(srcOffsetY - destOffsetY - 0.5); - } - - // - // The height of each band is determined by the maximum band size (in bytes) - // divided by 4 bytes per pixel to get the total pixels, and then divided by - // the width of the raster data. This results in a band bitmap that is close - // to the target band size. - // - bandHeight = (RasterizationInterface::ms_targetBandSize / 4) / rasterWidth; - - if (bandHeight == 0) - { - // - // The physical page is too wide to rasterize at this - // maximum band size and dpi. Throw. - // - THROW_ON_FAILED_HRESULT( - E_OUTOFMEMORY - ); - } -} - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/rasinterface.h b/print/XpsRasFilter/src/rasinterface.h deleted file mode 100644 index 3fae74cf..00000000 --- a/print/XpsRasFilter/src/rasinterface.h +++ /dev/null @@ -1,107 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// rasinterface.h -// -// Abstract: -// -// Class to wrap rasterization-related calculations, interactions with -// the Xps Rasterization Service, Xps Rasterization Service Callback, -// and eventual raster output (i.e. TIFF encoding) -// - -#pragma once - -namespace xpsrasfilter -{ - -class RasterizationInterface -{ -public: - static - RasterizationInterface_t - CreateRasterizationInterface( - const IPrintPipelinePropertyBag_t &pPropertyBag, - const IPrintWriteStream_t &pStream - ); - - RasterizationInterface(); - - void - RasterizePage( - const IXpsOMPage_t &pPage, - const ParametersFromPrintTicket &printTicketParams, - const FilterLiveness_t &pLiveness - ); - - void - CancelRasterization(); - - void - FinishRasterization(); - - // - // Target band size; 16MB - // - const static LONG ms_targetBandSize = 1024 * 1024 * 16; - -private: - - // - // Constructor is private; use CreateRasterizationInterface - // to create instances - // - RasterizationInterface( - const IXpsRasterizationFactory_t &pRasFactory, - TiffStreamBitmapHandler_t pBitmapHandler - ); - - // - // prevent copy semantics - // - RasterizationInterface(const RasterizationInterface&); - RasterizationInterface& operator=(const RasterizationInterface&); - - // - // Internal data members - // - - // - // Xps Rasterization Service Factory - // - IXpsRasterizationFactory_t m_pXPSRasFactory; - - // - // Bitmap Handler - // - TiffStreamBitmapHandler_t m_pBitmapHandler; -}; - -// -// Parameters that determine how a page is rasterized, in the -// units that the Rasterization Service expects -// -struct RasterizationParameters -{ - FLOAT rasterizationDPI; // dpi (scaling factor) - INT rasterHeight; // total size of raster - INT rasterWidth; - INT originX; // origin of the rasterization (translation) - INT originY; - INT bandHeight; // height of individual bands - - RasterizationParameters( - const ParametersFromPrintTicket &printTicketParams, - const ParametersFromFixedPage &fixedPageParams - ); -}; - -const FLOAT xpsDPI = 96.0f; - -} // namespace xpsrasfilter diff --git a/print/XpsRasFilter/src/xpsrasfilter.cpp b/print/XpsRasFilter/src/xpsrasfilter.cpp deleted file mode 100644 index 1199a540..00000000 --- a/print/XpsRasFilter/src/xpsrasfilter.cpp +++ /dev/null @@ -1,396 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// xpsrasfilter.cpp -// -// Abstract: -// -// Xps Rasterization Service filter implementation. -// - -#include "precomp.h" -#include "WppTrace.h" -#include "Exception.h" -#include "filtertypes.h" -#include "UnknownBase.h" -#include "OMConvertor.h" -#include "rasinterface.h" -#include "BitmapHandler.h" -#include "PThandler.h" -#include "xpsrasfilter.h" - -#include "xpsrasfilter.tmh" - -namespace xpsrasfilter -{ - -long XPSRasFilter::ms_numObjects = 0; // Initialize static object count - -// -//Routine Name: -// -// XPSRasFilter::XPSRasFilter -// -//Routine Description: -// -// Xps Rasterization Service sample filter default constructor. -// -//Arguments: -// -// None -// -//Return Value: -// -// None -// -XPSRasFilter::XPSRasFilter() -{ - // - // Take ownership with no AddRef - // - m_pLiveness.Attach(new FilterLiveness()); - - ::InterlockedIncrement(&ms_numObjects); -} - -// -//Routine Name: -// -// XPSRasFilter::~XPSRasFilter -// -//Routine Description: -// -// Xps Rasterization Service sample filter destructor. -// -//Arguments: -// -// None -// -//Return Value: -// -// None -// -XPSRasFilter::~XPSRasFilter() -{ - ::InterlockedDecrement(&ms_numObjects); -} - -// -//Routine Name: -// -// XPSRasFilter::InitializeFilter -// -//Routine Description: -// -// Exception boundary wrapper for IPrintPipelineFilter initialization. -// -//Arguments: -// -// pICommunicator - interface to interfilter communicator -// pIPropertyBag - interface to pipeline property bag -// pIPipelineControl - interface to pipeline control methods -// -//Return Value: -// -// ULONG -// New reference count -// -_Must_inspect_result_ -HRESULT STDMETHODCALLTYPE -XPSRasFilter::InitializeFilter( - _In_ IInterFilterCommunicator *pICommunicator, - _In_ IPrintPipelinePropertyBag *pIPropertyBag, - _In_ IPrintPipelineManagerControl *pIPipelineControl - ) -{ - DoTraceMessage(XPSRASFILTER_TRACE_INFO, L"Initializing Filter"); - - if (pICommunicator == NULL || - pIPropertyBag == NULL || - pIPipelineControl == NULL) - { - WPP_LOG_ON_FAILED_HRESULT(E_POINTER); - - return E_POINTER; - } - - HRESULT hr = S_OK; - - try - { - InitializeFilter_throws( - pICommunicator, - pIPropertyBag - ); - } - CATCH_VARIOUS(hr); - - return hr; -} - -// -//Routine Name: -// -// XPSRasFilter::InitializeFilter_throws -// -//Routine Description: -// -// Implements IPrintPipelineFilter initialization. Gets -// all necessary communication interfaces. -// -//Arguments: -// -// pICommunicator - interface to interfilter communicator -// pIPropertyBag - interface to pipeline property bag -// -VOID -XPSRasFilter::InitializeFilter_throws( - const IInterFilterCommunicator_t &pICommunicator, - const IPrintPipelinePropertyBag_t &pIPropertyBag - ) -{ - // - // Get the pipeline communication interfaces - // - THROW_ON_FAILED_HRESULT( - pICommunicator->RequestReader(reinterpret_cast(&m_pReader)) - ); - THROW_ON_FAILED_HRESULT( - pICommunicator->RequestWriter(reinterpret_cast(&m_pWriter)) - ); - - { - // - // Check to ensure that the provided interfaces are as expected. - // That is, that the GUIDs were correctly listed in the - // pipeline configuration file - // - IXpsDocumentProvider_t pReaderCheck; - IPrintWriteStream_t pWriterCheck; - - THROW_ON_FAILED_HRESULT( - m_pReader.QueryInterface(&pReaderCheck) - ); - THROW_ON_FAILED_HRESULT( - m_pWriter.QueryInterface(&pWriterCheck) - ); - } - - // - // Save a pointer to the Property Bag for further - // initialization, later. - // - m_pIPropertyBag = pIPropertyBag; -} - -// -//Routine Name: -// -// XPSRasFilter::ShutdownOperation -// -//Routine Description: -// -// Called asynchronously by the pipeline manager -// to shutdown filter operation. -// -//Arguments: -// -// None -// -//Return Value: -// -// HRESULT -// S_OK - On success -// -_Must_inspect_result_ -HRESULT -XPSRasFilter::ShutdownOperation() -{ - DoTraceMessage(XPSRASFILTER_TRACE_INFO, L"Shutting Down Operation"); - - m_pLiveness->Cancel(); - - return S_OK; -} - -// -//Routine Name: -// -// XPSRasFilter::StartOperation -// -//Routine Description: -// -// Called by the pipeline manager to start processing -// a document. Exception boundary for page processing. -// -//Arguments: -// -// None -// -//Return Value: -// -// HRESULT -// S_OK - On success -// Otherwise - Failure -// -_Must_inspect_result_ -HRESULT -XPSRasFilter::StartOperation() -{ - HRESULT hr = S_OK; - - DoTraceMessage(XPSRASFILTER_TRACE_INFO, L"Starting Operation"); - - // - // Process the Xps Package - // - try { - StartOperation_throws(); - } - CATCH_VARIOUS(hr); - - m_pWriter->Close(); - - return hr; -} - -// -//Routine Name: -// -// XPSRasFilter::StartOperation_throws -// -//Routine Description: -// -// Iterates over the 'trunk' parts of the document -// and calls appropriate processing methods. -// -//Arguments: -// -// None -// -void -XPSRasFilter::StartOperation_throws() -{ - // - // CoInitialize/CoUninitialize RAII object. - // COM is inititalized for the lifetime of this method. - // - SafeCoInit coInit; - - IXpsOMObjectFactory_t pOMFactory; - - // - // Create Xps Object Model Object Factory instance - // - THROW_ON_FAILED_HRESULT( - ::CoCreateInstance( - __uuidof(XpsOMObjectFactory), - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(IXpsOMObjectFactory), - reinterpret_cast(&pOMFactory) - ) - ); - - IOpcFactory_t pOpcFactory; - - // - // Create Opc Object Factory instance - // - THROW_ON_FAILED_HRESULT( - ::CoCreateInstance( - __uuidof(OpcFactory), - NULL, - CLSCTX_INPROC_SERVER, - __uuidof(IOpcFactory), - reinterpret_cast(&pOpcFactory) - ) - ); - - // - // Create the rasterization interface - // - RasterizationInterface_t pRasInterface = - RasterizationInterface::CreateRasterizationInterface( - m_pIPropertyBag, - m_pWriter - ); - - // - // Create the Print Ticket Handler - // - PrintTicketHandler_t pPrintTicketHandler = - PrintTicketHandler::CreatePrintTicketHandler( - m_pIPropertyBag - ); - - IUnknown_t pUnk; - - // - // Get first part - // - THROW_ON_FAILED_HRESULT(m_pReader->GetXpsPart(&pUnk)); - - while (m_pLiveness->IsAlive() && - pUnk != NULL) - { - IXpsDocument_t pDoc; - IFixedDocumentSequence_t pFDS; - IFixedDocument_t pFD; - IFixedPage_t pFP; - - if (SUCCEEDED(pUnk.QueryInterface(&pFP))) - { - DoTraceMessage(XPSRASFILTER_TRACE_VERBOSE, L"Handling a Page"); - - pPrintTicketHandler->ProcessPart(pFP); - - ParametersFromPrintTicket printTicketParams = - pPrintTicketHandler->GetMergedPrintTicketParams(); - - pRasInterface->RasterizePage( - CreateXpsOMPageFromIFixedPage(pFP, pOMFactory, pOpcFactory), - printTicketParams, - m_pLiveness - ); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFD))) - { - pPrintTicketHandler->ProcessPart(pFD); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pFDS))) - { - pPrintTicketHandler->ProcessPart(pFDS); - } - else if (SUCCEEDED(pUnk.QueryInterface(&pDoc))) - { - // - // Do nothing with the XML Document part - // - } - else - { - // - // Any other document 'trunk' parts are ignored. - // - } - - pUnk.Release(); - - // - // Get Next Part - // - THROW_ON_FAILED_HRESULT(m_pReader->GetXpsPart(&pUnk)); - } - - pRasInterface->FinishRasterization(); -} - -} // namespace xpsrasfilter - diff --git a/print/XpsRasFilter/src/xpsrasfilter.def b/print/XpsRasFilter/src/xpsrasfilter.def deleted file mode 100644 index a3dac1cc..00000000 --- a/print/XpsRasFilter/src/xpsrasfilter.def +++ /dev/null @@ -1,22 +0,0 @@ -; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -; ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -; PARTICULAR PURPOSE. -; -; Copyright (c) Microsoft Corporation. All rights reserved -; -; File Name: -; -; xpsrasfilter.def -; -; Abstract: -; -; Defines DLL exports for xpsrasfilter.dll -; - -LIBRARY "xpsrasfilter.dll" - -EXPORTS - DllGetClassObject PRIVATE - DllCanUnloadNow PRIVATE - diff --git a/print/XpsRasFilter/src/xpsrasfilter.h b/print/XpsRasFilter/src/xpsrasfilter.h deleted file mode 100644 index 2ad3a4f9..00000000 --- a/print/XpsRasFilter/src/xpsrasfilter.h +++ /dev/null @@ -1,141 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// xpsrasfilter.h -// -// Abstract: -// -// Xps Rasterization Service sample filter definition. The -// XPSRasFilter provides the interface to the filter pipeline manager. -// - -#pragma once - -namespace xpsrasfilter -{ - -// -// Class to maintain the shared state of operation between multiple components -// of the filter. Also provides the callback for the Xps Rasterization Service. -// -class FilterLiveness : public UnknownBase -{ -public: - - FilterLiveness() : - m_isAlive(TRUE) - {} - - virtual - ~FilterLiveness() {} - - BOOL - IsAlive() - { - return m_isAlive; - } - - void - Cancel() - { - // - // May be called from a different thread - // - m_isAlive = FALSE; - } - - // - // IXpsRasterizerNotificationCallback Method - // - virtual _Must_inspect_result_ - HRESULT STDMETHODCALLTYPE - Continue() - { - return (m_isAlive) ? (S_OK) : (HRESULT_FROM_WIN32(ERROR_PRINT_CANCELLED)); - } - -private: - volatile BOOL m_isAlive; - - // - // prevent copy semantics - // - FilterLiveness(const FilterLiveness&); - FilterLiveness& operator=(const FilterLiveness&); -}; - -class XPSRasFilter : public UnknownBase -{ - -public: - - static LONG ms_numObjects; // Number of instances of XPSRasFilter - - XPSRasFilter(); - - virtual - ~XPSRasFilter(); - - // - // IPrintPipelineFilter Methods - // - virtual _Must_inspect_result_ - HRESULT STDMETHODCALLTYPE - InitializeFilter( - _In_ IInterFilterCommunicator *pICommunicator, - _In_ IPrintPipelinePropertyBag *pIPropertyBag, - _In_ IPrintPipelineManagerControl *pIPipelineControl - ); - - virtual _Must_inspect_result_ - HRESULT STDMETHODCALLTYPE - ShutdownOperation(); - - virtual _Must_inspect_result_ - HRESULT STDMETHODCALLTYPE - StartOperation(); - -private: - // - // prevent copy semantics - // - XPSRasFilter(const XPSRasFilter&); - XPSRasFilter& operator=(const XPSRasFilter&); - - // - // Xps package part reader - // - IXpsDocumentProvider_t m_pReader; - IPrintWriteStream_t m_pWriter; - - // - // Pipeline Property Bag - // - IPrintPipelinePropertyBag_t m_pIPropertyBag; - - // - // IPrintPipelineFilter Methods (throwing) - // - VOID - StartOperation_throws(); - - VOID - InitializeFilter_throws( - const IInterFilterCommunicator_t &pICommunicator, - const IPrintPipelinePropertyBag_t &pIPropertyBag - ); - - // - // Keeps track of whether the operation has been cancelled - // - FilterLiveness_t m_pLiveness; -}; - -} // namespace xpsrasfilter - diff --git a/print/XpsRasFilter/src/xpsrasfilter.rc b/print/XpsRasFilter/src/xpsrasfilter.rc deleted file mode 100644 index d7f2fc40..00000000 --- a/print/XpsRasFilter/src/xpsrasfilter.rc +++ /dev/null @@ -1,28 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// File Name: -// -// xpsrasfilter.rc -// -// Abstract: -// -// Xps Rasterization Service filter resource file. -// - -#include -#include - -#define VER_FILETYPE VFT_DLL -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "XPS Rasterization Service WDK Sample Filter" -#define VER_INTERNALNAME_STR "xpsrasfilter.dll" -#define VER_ORIGINALFILENAME_STR "xpsrasfilter.dll" -#define VER_FILEVERSION 0, 3, VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE - -#include "common.ver" - diff --git a/print/XpsRasFilter/src/xpsrasfilter.vcxproj b/print/XpsRasFilter/src/xpsrasfilter.vcxproj deleted file mode 100644 index 267efbef..00000000 --- a/print/XpsRasFilter/src/xpsrasfilter.vcxproj +++ /dev/null @@ -1,454 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {D8784A15-C959-4CDF-B5B8-A603F347BDA4} - $(MSBuildProjectName) - Debug - Win32 - {29519C3F-63DD-4C01-B6A7-E1E7B4B517BD} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - DynamicLibrary - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - true - .cpp.cxx.h.hxx.inl - .h.hxx.inl - XpsRasFilter - true - - - - xpsrasfilter - - - xpsrasfilter - - - xpsrasfilter - - - xpsrasfilter - - - xpsrasfilter - - - xpsrasfilter - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - _DllMainCRTStartup@12 - _DllMainCRTStartup - - - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalDependencies);uuid.lib;prntvpt.lib;Kernel32.lib;winspool.lib;ole32.lib;oleaut32.lib;Advapi32.lib - - - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalDependencies);uuid.lib;prntvpt.lib;Kernel32.lib;winspool.lib;ole32.lib;oleaut32.lib;Advapi32.lib - - - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalDependencies);uuid.lib;prntvpt.lib;Kernel32.lib;winspool.lib;ole32.lib;oleaut32.lib;Advapi32.lib - - - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalDependencies);uuid.lib;prntvpt.lib;Kernel32.lib;winspool.lib;ole32.lib;oleaut32.lib;Advapi32.lib - - - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalDependencies);uuid.lib;prntvpt.lib;Kernel32.lib;winspool.lib;ole32.lib;oleaut32.lib;Advapi32.lib - - - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalIncludeDirectories);$(DDK_INC_PATH) - - - %(AdditionalDependencies);uuid.lib;prntvpt.lib;Kernel32.lib;winspool.lib;ole32.lib;oleaut32.lib;Advapi32.lib - - - - Dynamic - - - Dynamic - - - Dynamic - - - Dynamic - - - Dynamic - - - Dynamic - - - - Sync - true - Level4 - - - - - Sync - true - Level4 - - - - - Sync - true - Level4 - - - - - Sync - true - Level4 - - - - - Sync - true - Level4 - - - - - Sync - true - Level4 - - - - - xpsrasfilter.def - - - - - xpsrasfilter.def - - - - - xpsrasfilter.def - - - - - xpsrasfilter.def - - - - - xpsrasfilter.def - - - - - xpsrasfilter.def - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/XpsRasFilter/src/xpsrasfilter.vcxproj.Filters b/print/XpsRasFilter/src/xpsrasfilter.vcxproj.Filters deleted file mode 100644 index 220e456f..00000000 --- a/print/XpsRasFilter/src/xpsrasfilter.vcxproj.Filters +++ /dev/null @@ -1,178 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {8AFE48DE-3776-4F24-9EB1-3DA85555D037} - - - h;hpp;hxx;hm;inl;inc;xsd - {01B86B81-A94E-4D93-8DCE-7DC040F8B64B} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {26A0ED4E-3E48-4ECB-96A1-B4B7F18BC8C9} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - Header Files - - - - - - - - - - - - - - Source Files - - - \ No newline at end of file diff --git a/print/autoconfig/ACnfgPS.gdl b/print/autoconfig/ACnfgPS.gdl deleted file mode 100644 index e2fb2eb0..00000000 --- a/print/autoconfig/ACnfgPS.gdl +++ /dev/null @@ -1,100 +0,0 @@ -*%****************************************************************************************** -*% ACnfgPS.GDL -*% This file implements the *BidiQuery, *BidiResponse and *Option elements that correspond to -*% the InstalledMemory, DuplexUnit and HardDisk features in AutoCnfg.PPD file. The feature -*% name in the GDL file should exaclty match the corresponding feature and option names in the PPD. -*%****************************************************************************************** - - -%******************************************************************************************* -*% Memory -*% -*%****************************************************************************************** - -*Feature: InstalledMemory -{ - *FeatureType: PRINTER_PROPERTY - *BidiQuery: InstalledMemory - { - *QueryString: "\Printer.Configuration.Memory:Size" - } - - *BidiResponse: InstalledMemory - { - *ResponseType: BIDI_INT - *ResponseData: ENUM_OPTION(Memory) - } - *Option: 32Meg - { - *BidiValue: INT(32768) - } - *Option: 64Meg - { - *BidiValue: INT(65536) - } - *Option: 128Meg - { - *BidiValue: INT(131072) - } - *Option: 256Meg - { - *BidiValue: INT(262144) - } - -} - - -*%****************************************************************************************** -*% Duplex Unit -*%****************************************************************************************** - -*Feature: DuplexUnit -{ - *FeatureType: PRINTER_PROPERTY - *BidiQuery: DuplexUnit - { - *QueryString: "\Printer.Configuration.DuplexUnit:Installed" - } - - *BidiResponse: DuplexUnit - { - *ResponseType: BIDI_BOOL - *ResponseData: ENUM_OPTION(DuplexUnit) - } - - *Option: False - { - *BidiValue: BOOL(FALSE) - } - - *Option: True - { - *BidiValue: BOOL(TRUE) - } -} - -*%****************************************************************************************** -*% Hard Disk -*%****************************************************************************************** - -*Feature: HardDisk -{ - *FeatureType: PRINTER_PROPERTY - *BidiQuery:HardDisk - { - *QueryString: "\Printer.Configuration.HardDisk:Installed" - } - *BidiResponse: HardDisk - { - *ResponseType: BIDI_BOOL - *ResponseData: ENUM_OPTION(PrinterHardDisk) - } - *Option: False - { - *BidiValue: BOOL(FALSE) - } - *Option: True - { - *BidiValue: BOOL(TRUE) - } -} diff --git a/print/autoconfig/ACnfgUni.GDL b/print/autoconfig/ACnfgUni.GDL deleted file mode 100644 index 655b4cb2..00000000 --- a/print/autoconfig/ACnfgUni.GDL +++ /dev/null @@ -1,111 +0,0 @@ -*%****************************************************************************************** -*% ACnfgUni.GDL -*% This file implements the *BidiQuery, *BidiResponse and *Option elements that correspond -*% to the Memory,DuplexUnit and PrinterHardDisk features in AutoCnfg.GPD file. The feature -*% name in the GDL file should exaclty match the corresponding feature and option names in the GPD. -*%****************************************************************************************** - - -%******************************************************************************************* -*% Memory -*% -*%****************************************************************************************** - -*Feature: Memory -{ - *FeatureType: PRINTER_PROPERTY - *BidiQuery: Memory - { - *QueryString: "\Printer.Configuration.Memory:Size" - } - - *BidiResponse: Memory - { - *ResponseType: BIDI_INT - *ResponseData: ENUM_OPTION(Memory) - } - *Option: 16384KB - { - *BidiValue: INT(16384) - } - *Option: 24576KB - { - *BidiValue: INT(24576) - } - *Option: 32768KB - { - *BidiValue: INT(32768) - } - *Option: 49152KB - { - *BidiValue: INT(49152) - } - *Option: 65536KB - { - *BidiValue: INT(65536) - } - *Option: 98304KB - { - *BidiValue: INT(98304) - } - *Option: 131072KB - { - *BidiValue: INT(131072) - } -} - - -*%****************************************************************************************** -*% Duplex Unit -*%****************************************************************************************** - -*Feature: DuplexUnit -{ - *FeatureType: PRINTER_PROPERTY - *BidiQuery: DuplexUnit - { - *QueryString: "\Printer.Configuration.DuplexUnit:Installed" - } - - *BidiResponse: DuplexUnit - { - *ResponseType: BIDI_BOOL - *ResponseData: ENUM_OPTION(DuplexUnit) - } - - *Option: FALSE - { - *BidiValue: BOOL(FALSE) - } - - *Option: TRUE - { - *BidiValue: BOOL(TRUE) - } -} - -*%****************************************************************************************** -*% Hard Disk -*%****************************************************************************************** - -*Feature: PrinterHardDisk -{ - *FeatureType: PRINTER_PROPERTY - *BidiQuery:PrinterHardDisk - { - *QueryString: "\Printer.Configuration.HardDisk:Installed" - } - *BidiResponse: PrinterHardDisk - { - *ResponseType: BIDI_BOOL - *ResponseData: ENUM_OPTION(PrinterHardDisk) - } - *Option: FALSE - { - *BidiValue: BOOL(FALSE) - } - *Option: TRUE - { - *BidiValue: BOOL(TRUE) - } -} diff --git a/print/autoconfig/AutoCnfg.GPD b/print/autoconfig/AutoCnfg.GPD deleted file mode 100644 index a9eb8b6f..00000000 --- a/print/autoconfig/AutoCnfg.GPD +++ /dev/null @@ -1,733 +0,0 @@ -*Include: "stdnames.gpd" -*Include: "ttfsub.gpd" - -*ModelName: "Unidrv AutoConfiguration Sample" -*PrinterType: PAGE -*GPDSpecVersion: "1.0" - -*MasterUnits: PAIR(1200, 1200) -*ResourceDLL: "pcl5eres.dll" -*MaxCopies: 32767 - - -*GPDFileName: "autocnfg.gpd" -*GPDFileVersion: "1.0" -*Personality: =PERSONALITY_PCL_DISPLAY -*PrintRatePPM: 16 - -*%****************************************************************************************** -*% Common Resources -*%****************************************************************************************** -*ResourceDLL: "pcl5eres.dll" -*ResourceDLL: "unires.dll" - -*Feature: RESDLL -{ - *Option: PCL5ERES - { - *Name: "pcl5eres.dll" - } -} - - -*rcInstalledOptionNameID: RESDLL.PCL5ERES.443 *% Installed -*rcNotInstalledOptionNameID: RESDLL.PCL5ERES.444 *% Not Installed - -*%****************************************************************************************** -*% Specify ACnfgUni.GDL as the Bidi query file which has the GDL extensions for -*% Autoconfig corresponding to the Memory,DuplexUnit and PrinterHardDisk features. The -*% GDL extensions can also be put in the GPD file itself instead of in a separate GDL -*% file. Using a separate GDL file reduces the amount of change in the original GPD -*% file, thereby reducing the chances for unintended alteration of the existing GPD data. -*%****************************************************************************************** - -*Ifdef: WINNT_60 -*BidiQueryFile: "ACnfgUni.GDL" -*Endif: WINNT_60 - -*%****************************************************************************************** -*% HP-GL/2 Graphics Support -*%****************************************************************************************** -*Ifdef: WINNT_51 -*Personality: =PERSONALITY_HPGL2 -*Feature: GraphicsMode -{ - *rcNameID: =GRAPHICSMODE_DISPLAY - *DefaultOption: RASTERMODE - *Option: HPGL2MODE - { - *rcNameID: =GRAPHICSMODE_HPGL2_DISPLAY - } - *Option: RASTERMODE - { - *rcNameID: =GRAPHICSMODE_RASTER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.3 - *Cmd: "@PJL SET LIMAGEENHANCE=OFF<0A>" - } - } -} -*Endif: - - - -*%****************************************************************************************** -*% Orientation -*%****************************************************************************************** -*Feature: Orientation -{ - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT - { - *rcNameID: =PORTRAIT_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *NoPageEject?: TRUE - *Cmd: "<1B>&l0o1E" - } - } - *Option: LANDSCAPE_CC90 - { - *rcNameID: =LANDSCAPE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.8 - *NoPageEject?: TRUE - *Cmd: "<1B>&l1o1E" - } - } -} - -*%****************************************************************************************** -*% Input Bin -*%****************************************************************************************** -*Feature: InputBin -{ - *rcNameID: =PAPER_SOURCE_DISPLAY - *DefaultOption: AUTO - *Option: AUTO - { - *rcNameID: =AUTO_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l7H" - } - } - *Option: UPPER - { - *rcNameID: =UPPER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l1H" - } - } - *Option: LOWER - { - *rcNameID: =LOWER_TRAY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l1H" - } - } - *Option: ENVELOPE - { - *rcNameID: =ENV_FEED_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l6H" - } - } - *Option: MANUAL - { - *rcNameID: =MANUAL_FEED_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.11 - *Cmd: "<1B>&l2H" - } - } -} - -*%****************************************************************************************** -*% Resolution -*%****************************************************************************************** -*Feature: Resolution -{ - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: 600_DPI - *Option: 600_DPI - { - *Name: "600 x 600 " =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED,TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rB" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.5 - *Cmd: "@PJL SET RESOLUTION=600<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t600R" - } - } - *Option: 300_DPI - { - *Name: "300 x 300 " =DOTS_PER_INCH - *DPI: PAIR(300, 300) - *TextDPI: PAIR(300, 300) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rB" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.5 - *Cmd: "@PJL SET RESOLUTION=300<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t300R" - } - } - *Option: 150_DPI - { - *Name: "150 x 150 " =DOTS_PER_INCH - *DPI: PAIR(150, 150) - *TextDPI: PAIR(150, 150) - *MinStripBlankPixels: 32 - EXTERN_GLOBAL: *StripBlanks: LIST(ENCLOSED, TRAILING) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd : "<1B>*r1A" } - *Command: CmdEndRaster { *Cmd : "<1B>*rB" } - *Command: CmdSendBlockData { *Cmd : "<1B>*b" %d{NumOfDataBytes}"W" } - *Command: CmdSelect - { - *Order: DOC_SETUP.5 - *Cmd: "@PJL SET RESOLUTION=150<0A>@PJL ENTER LANGUAGE=PCL<0A0D1B>E<1B>*t150R" - } - } -} - -*%****************************************************************************************** -*% Paper Size -*%****************************************************************************************** -*Feature: PaperSize -{ - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - *Option: LETTER - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1028 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9500, 12500) - *PrintableOrigin: PAIR(400, 400) - *CursorOrigin: PAIR(300, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t5260x7704Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9500, 12200) - *PrintableOrigin: PAIR(450, 300) - *CursorOrigin: PAIR(200, 12900) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l2a8c1E<1B>*p0x0Y<1B>*c0t7332x5880Y" - } - } - } - } - *Option: LEGAL - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 1692 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 600) - *CursorOrigin: PAIR(180, 300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t5880x8900Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9000, 15500) - *PrintableOrigin: PAIR(400, 900) - *CursorOrigin: PAIR(180, 16500) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l3a8c1E<1B>*p0x0Y<1B>*c0t8900x5880Y" - } - } - } - } - *Option: EXECUTIVE - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4109 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(8100, 11500) - *PrintableOrigin: PAIR(300, 300) - *CursorOrigin: PAIR(300, 200) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t4860x7344Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(8300, 11500) - *PrintableOrigin: PAIR(200, 300) - *CursorOrigin: PAIR(200, 12300) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l1a8c1E<1B>*p0x0Y<1B>*c0t7272x4980Y" - } - } - } - } - *Option: A4 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 4249 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(288, 180) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t5594x8201Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(9100, 13200) - *PrintableOrigin: PAIR(400, 300) - *CursorOrigin: PAIR(204, 13824) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l26a8c1E<1B>*p0x0Y<1B>*c0t8129x5714Y" - } - } - } - } - *Option: B5 - { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *PageProtectMem: 3198 - *switch: Orientation - { - *case: PORTRAIT - { - *PrintableArea: PAIR(7900, 11140) - *PrintableOrigin: PAIR(352, 300) - *CursorOrigin: PAIR(300, 100) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t4970x7040Y" - } - } - *case: LANDSCAPE_CC90 - { - *PrintableArea: PAIR(7760, 11140) - *PrintableOrigin: PAIR(300, 400) - *CursorOrigin: PAIR(100, 11940) - *Command: CmdSelect - { - *Order: DOC_SETUP.12 - *Cmd: "<1B>&l12a8c1E<1B>*p0x0Y<1B>*c0t6780x4970Y" - } - } - } - } -} - -*%****************************************************************************************** -*% Media Type -*%****************************************************************************************** -*Feature: MediaType -{ - *rcNameID: =MEDIA_TYPE_DISPLAY - *DefaultOption: PLAIN - *Option: PLAIN - { - *rcNameID: =PLAIN_PAPER_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n6WdPlain" - } - } - *Option: TRANSPARENCY - { - *rcNameID: =TRANSPARENCY_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.15 - *Cmd: "<1B>&n13WdTransparency" - } - } -} - -*%****************************************************************************************** -*% Color Mode -*%****************************************************************************************** -*Feature: ColorMode -{ - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *DefaultOption: 24bpp - *Option: Mono - { - *rcNameID: =MONO_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 1 - *Color?: FALSE - } - *Option: 24bpp - { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 -*% *Command: CmdEnableDRC { *Cmd : "<1B>*b3M" } - *PaletteSize: 256 - *PaletteProgrammable? : TRUE - *Command: CmdDefinePaletteEntry - { - *Cmd : "<1B>*v" %d{RedValue}"a" -+ %d{GreenValue}"b" -+ %d{BlueValue}"c" -+ %d{PaletteIndexToProgram}"I" - } - *Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } - *Command: CmdSetSrcBmpWidth { *Cmd : "<1B>*r" %d{RasterDataWidthInBytes / 3}"S" } - *Command: CmdSelect - { - *Order: PAGE_SETUP.16 - *Cmd: "<1B>*v1N<1B>*v1O<1B>*l184O<1B>*v6W<000308080808><1B>*v0a0b0c7i255a255b255c0I<1B>*o3W<060406>" - } - } -} - -*%****************************************************************************************** -*% HalfTone -*%****************************************************************************************** -*Feature: Halftone -{ - *rcNameID: =HALFTONING_DISPLAY - *DefaultOption: HT_PATSIZE_AUTO - *Option: HT_PATSIZE_AUTO - { - *rcNameID: =HT_AUTO_SELECT_DISPLAY - } - *Option: HT_PATSIZE_SUPERCELL_M - { - *rcNameID: =HT_SUPERCELL_DISPLAY - } - *Option: HT_PATSIZE_6x6_M - { - *rcNameID: =HT_DITHER6X6_DISPLAY - } - *Option: HT_PATSIZE_8x8_M - { - *rcNameID: =HT_DITHER8X8_DISPLAY - } -} - -*%****************************************************************************************** -*% Memory -*% -*% Note: Unidrv uses the font memory information to estimate when it needs to stop -*% downloading fonts for a page, and thus driver writers should err on the conservative -*% side. Otherwise, printers will generate "out of memory" device errors for pages with -*% a large number of fonts / unique glyphs. -*%****************************************************************************************** -*Feature: Memory -{ - *rcNameID: =PRINTER_MEMORY_DISPLAY - *FeatureType: PRINTER_PROPERTY - *DefaultOption: 32768KB - *Option: 16384KB - { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 13950) - } - *Option: 24576KB - { - *Name: "24MB" - *MemoryConfigKB: PAIR(24576, 21150) - } - *Option: 32768KB - { - *Name: "32MB" - *MemoryConfigKB: PAIR(32768, 28350) - } - *Option: 49152KB - { - *Name: "48MB" - *MemoryConfigKB: PAIR(49152, 43050) - } - *Option: 65536KB - { - *Name: "64MB" - *MemoryConfigKB: PAIR(65536, 57150) - } - *Option: 98304KB - { - *Name: "96MB" - *MemoryConfigKB: PAIR(98304, 85950) - } - *Option: 131072KB - { - *Name: "128MB" - *MemoryConfigKB: PAIR(131072, 116250) - } -} - - -*%****************************************************************************************** -*% Duplex Unit -*%****************************************************************************************** -*Feature: DuplexUnit -{ - *rcNameID: RESDLL.PCL5ERES.429 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *rcNameID: RESDLL.PCL5ERES.444 - *DisabledFeatures: LIST(Duplex) - *Constraints: LIST(Duplex.VERTICAL, Duplex.HORIZONTAL) - } - *Option: TRUE - { - *rcNameID: RESDLL.PCL5ERES.443 - } -} - - -*%****************************************************************************************** -*% Duplex Type -*%****************************************************************************************** -*Feature: Duplex -{ - *rcNameID: =TWO_SIDED_PRINTING_DISPLAY - *DefaultOption: NONE - *Option: NONE - { - *rcNameID: =NONE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l0S" - } - } - *Option: VERTICAL - { - *rcNameID: =FLIP_ON_LONG_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l1S" - } - } - *Option: HORIZONTAL - { - *rcNameID: =FLIP_ON_SHORT_EDGE_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.9 - *Cmd: "<1B>&l2S" - } - } -} - -*%****************************************************************************************** -*% Hard Disk -*%****************************************************************************************** -*Feature: PrinterHardDisk -{ - *rcNameID: RESDLL.PCL5ERES.430 - *FeatureType: PRINTER_PROPERTY - *DefaultOption: FALSE - *Option: FALSE - { - *rcNameID: RESDLL.PCL5ERES.444 - } - *Option: TRUE - { - *rcNameID: RESDLL.PCL5ERES.443 - } -} - - -*%****************************************************************************************** -*% Page Protect -*%****************************************************************************************** -*Feature: PageProtect -{ - *rcNameID: =PAGE_PROTECTION_DISPLAY - *DefaultOption: OFF - *Option: ON - { - *rcNameID: =ON_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "@PJL SET PAGEPROTECT=ON<0A>" - } - } - *Option: OFF - { - *rcNameID: =OFF_DISPLAY - *Command: CmdSelect - { - *Order: DOC_SETUP.1 - *Cmd: "@PJL SET PAGEPROTECT=OFF<0A>" - } - } -} - -*%****************************************************************************************** -*% Doc setup commands -*%****************************************************************************************** -*Command: CmdStartDoc -{ - *Order: DOC_SETUP.7 - *Cmd: "<1B>&u1200D<1B>*r0F" -} -*Command: CmdStartPage -{ - *Order: PAGE_SETUP.1 - *Cmd: "<1B>*b0M<0D>" -} -*Command: CmdEndJob -{ - *Order: JOB_FINISH.1 - *Cmd: "<1B>E<1B>%%-12345X@PJL<20>LPORTROTATE<0A><1B>%%-12345X" -} -*Command: CmdCopies -{ - *Order: DOC_SETUP.13 - *Cmd: "<1B>&l" %d{NumOfCopies}"X" -} - -*%****************************************************************************************** -*% Cursor, Page and Color Commands -*%****************************************************************************************** -*RotateCoordinate?: TRUE -*RotateRaster?: TRUE -*RotateFont?: TRUE -*TextCaps: LIST(TC_CR_90,TC_UA_ABLE) -*MemoryUsage: LIST(FONT, RASTER, VECTOR) -*CursorXAfterCR: AT_PRINTABLE_X_ORIGIN -*BadCursorMoveInGrxMode: LIST(X_PORTRAIT,Y_LANDSCAPE) -*XMoveThreshold: 0 -*YMoveThreshold: 0 -*XMoveUnit: 300 -*YMoveUnit: 300 -*Command: CmdXMoveAbsolute { *Cmd : "<1B>*p" %d{(DestX) }"X" } -*Command: CmdXMoveRelRight { *Cmd : "<1B>*p+" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdXMoveRelLeft { *Cmd : "<1B>*p-" %d[0,9600]{max_repeat((DestXRel) )}"X" } -*Command: CmdYMoveAbsolute { *Cmd : "<1B>*p" %d{(DestY) }"Y" } -*Command: CmdYMoveRelDown { *Cmd : "<1B>*p+" %d{(DestYRel) }"Y" } -*Command: CmdYMoveRelUp { *Cmd : "<1B>*p-" %d{(DestYRel) }"Y" } -*Command: CmdDefinePaletteEntry { *Cmd : "<1B>*v" %d{RedValue}"a" %d{GreenValue}"b" %d{BlueValue}"c" -+ %d{PaletteIndexToProgram} "I" } -*Command: CmdSelectPaletteEntry { *Cmd : "<1B>*v" %d{CurrentPaletteIndex}"S" } -*Command: CmdCR { *Cmd : "<0D>" } -*Command: CmdLF { *Cmd : "<0A>" } -*Command: CmdFF { *Cmd : "<0C>" } -*Command: CmdBackSpace { *Cmd : "<08>" } -*Command: CmdUniDirectionOn { *Cmd : "<00>" } -*Command: CmdUniDirectionOff { *Cmd : "<00>" } -*Command: CmdPushCursor { *Cmd : "<1B>&f0S" } -*Command: CmdPopCursor { *Cmd : "<1B>&f1S" } -*Command: CmdSetSimpleRotation { *Cmd : "<1B>&a" %d{PrintDirInCCDegrees}"P" } -*EjectPageWithFF?: TRUE -*Command: CmdEnableTIFF4 { *Cmd : "<1B>*b2M" } -*Command: CmdDisableCompression { *Cmd : "<1B>*b0M" } -*OutputDataFormat: H_BYTE -*OptimizeLeftBound?: TRUE -*CursorXAfterSendBlockData: AT_GRXDATA_ORIGIN -*CursorYAfterSendBlockData: AUTO_INCREMENT - -*%****************************************************************************************** -*% Font Descriptions and Commands -*%****************************************************************************************** -*TTFSEnabled?: TRUE -*DefaultFont: 136 -*DefaultCTT: 0 -*CharPosition: BASELINE -*DeviceFonts: LIST(136,138,146,147,148,149,150,151,152,153,154,155,156,157, -+ 163,164,165,166,196,197,198,199,200,201,202,203,209,210, -+ 211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, -+ 227,228,229,230) -*MinFontID: 16534 -*MaxFontID: 32768 -*switch: Resolution -{ - *case: 600_DPI - { - *FontFormat: HPPCL_OUTLINE - } - *case: 300_DPI - { - *FontFormat: HPPCL_OUTLINE - } - *case: 150_DPI - { - *FontFormat: HPPCL_RES - } -} -*Command: CmdSetFontID { *Cmd : "<1B>*c" %d{NextFontID}"D" } -*Command: CmdSelectFontID { *Cmd : "<1B>(" %d{CurrentFontID}"X" } -*Command: CmdSetCharCode { *Cmd : "<1B>*c" %d{NextGlyph}"E" } -*Command: CmdUnderlineOn { *Cmd : "<1B>&dD" } -*Command: CmdUnderlineOff { *Cmd : "<1B>&d@" } -*Command: CmdWhiteTextOn { *Cmd : "<1B>*v1o1T" } -*Command: CmdWhiteTextOff { *Cmd : "<1B>*v0o0T" } - - -*%******************************************************************************************** -*%* Vector Commands. -*%******************************************************************************************** -*MinGrayFill: 1 -*MaxGrayFill: 100 -*Command: CmdSetRectWidth { *Cmd : "<1B>*c" %d{(RectXSize) }"A" } -*Command: CmdSetRectHeight { *Cmd : "<1B>*c" %d{(RectYSize) }"B" } -*Command: CmdRectGrayFill { *Cmd : "<1B>*c" %d{GrayPercentage }"g2P" } -*Command: CmdRectWhiteFill { *Cmd : "<1B>*c1P" } -*Command: CmdRectBlackFill { *Cmd : "<1B>*c0P" } diff --git a/print/autoconfig/AutoCnfg.PPD b/print/autoconfig/AutoCnfg.PPD deleted file mode 100644 index e6591b8c..00000000 --- a/print/autoconfig/AutoCnfg.PPD +++ /dev/null @@ -1,479 +0,0 @@ -*PPD-Adobe: "4.3" -*% Adobe Systems PostScript(R) Printer Description File -*% Copyright (c) 2005 Microsoft Corp. All rights reserved. - -*FormatVersion: "4.3" -*FileVersion: "2.0" -*LanguageEncoding: ISOLatin1 -*LanguageVersion: English -*Product: "(PostScript AutoConfiguration)" -*PSVersion: "(2015.105) 9" -*Manufacturer: "Microsoft" -*ModelName: "PostScript AutoConfiguration Sample" -*ShortNickName: "PostScript AutoConfiguration" -*NickName: "PostScript AutoConfiguration" -*PCFileName: "AutoCnfg.PPD" - -*MSBidiQueryFile: "ACnfgPS.GDL" - -*% === Installable Options =========== -*OpenGroup: InstallableOptions/Options Installed - -*OpenUI *DuplexUnit/Duplex Unit: Boolean -*DefaultDuplexUnit: False -*DuplexUnit True/Installed: "" -*DuplexUnit False/Not Installed: "" -*CloseUI: *DuplexUnit - -*OpenUI *HardDisk/Printer Hard Disk: Boolean -*DefaultHardDisk: False -*HardDisk True/Installed: "" -*HardDisk False/Not Installed: "" -*CloseUI: *HardDisk - -*OpenUI *InstalledMemory/Printer Memory: PickOne -*DefaultInstalledMemory: 32Meg -*InstalledMemory 32Meg/32 MB: "" -*InstalledMemory 64Meg/64 MB: "" -*InstalledMemory 128Meg/128 MB: "" -*InstalledMemory 256Meg/256 MB: "" -*CloseUI: *InstalledMemory - -*CloseGroup: InstallableOptions - -*% === Constraints =================== - - -*% === Basic Device Capabilities ============ - -*LanguageLevel: "2" -*Protocols: BCP - -*FreeVM: "6666752" -*VMOption 32Meg/32 MB: "6609408" -*VMOption 64Meg/64 MB: "6666752" -*VMOption 128Meg/128 MB: "9705984" -*VMOption 256Meg/256 MB: "13736448" - - -*ColorDevice: True -*DefaultColorSpace: CMYK -*AccurateScreensSupport: True -*SuggestedJobTimeout: "0" -*SuggestedWaitTimeout: "300" -*SuggestedManualFeedTimeout: "60" -*End -*TTRasterizer: Type42 -*?TTRasterizer: " - save - 42 /FontType resourcestatus - { pop pop (Type42)} {pop pop (None)} ifelse = flush - restore" -*End - -*Emulators: hpgl -*StartEmulator_hpgl: "currentfile /hpgl statusdict /emulate get exec " -*StopEmulator_hpgl: "<1B7F>0" - -*FileSystem: True -*?FileSystem: " - save false - (%disk?%) - { currentdevparams dup /Writeable known - { /Writeable get {pop true} if } {pop} ifelse - } 10 string /IODevice resourceforall - {(True)}{(False)} ifelse = flush - restore" -*End -*Throughput: "14" -*Password: "(0)" -*ExitServer: " - count 0 eq - { false } { true exch startjob } ifelse - not - { (WARNING: Cannot modify initial VM.) = - (Missing or invalid password.) = - (Please contact the author of this software.) = flush quit - } if" -*End -*Reset: " - count 0 eq - { false } { true exch startjob } ifelse - not - { (WARNING: Cannot reset printer.) = - (Missing or invalid password.) = - (Please contact the author of this software.) = flush quit - } if - systemdict /quit get exec - (WARNING : Printer Reset Failed.) = flush" -*End - -*DefaultResolution: 600x600dpi -*?Resolution: " - save currentpagedevice - /HWResolution get - aload pop exch ( ) cvs print (x) print ( ) cvs print (dpi) - = flush - restore" -*End - -*% Halftone Information ================= - -*DefaultHalftoneType: 9 -*ScreenFreq: "60.0" -*ScreenAngle: "0.0" -*DefaultScreenProc: Null -*ScreenProc Null: "{}" - -*DefaultTransfer: Null -*Transfer Null: "{ }" -*Transfer Null.Inverse: "{ 1 exch sub }" - - -*% Tray Selection ============ - -*OpenUI *InputSlot: PickOne -*OrderDependency: 10 AnySetup *InputSlot -*DefaultInputSlot: Paper -*InputSlot Upper: " - (<<) cvx exec - /MediaPosition 0 - /MediaType null - /TraySwitch false - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Middle: " - (<<) cvx exec - /MediaPosition 1 - /MediaType null - /TraySwitch false - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Lower: " - (<<) cvx exec - /MediaPosition 2 - /MediaType null - /TraySwitch false - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Paper: " - (<<) cvx exec - /MediaPosition null - /MediaType (Paper) - /TraySwitch true - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot Transparency: " - (<<) cvx exec - /MediaPosition null - /MediaType (Transparency) - /TraySwitch true - /ManualFeed false - (>>) cvx exec setpagedevice" -*End -*InputSlot ManualPaper/Manual Paper: " - (<<) cvx exec - /MediaPosition null - /MediaType (Paper) - /TraySwitch false - /ManualFeed true - (>>) cvx exec setpagedevice" -*End -*InputSlot ManualTransparency/Manual Transparency: " - (<<) cvx exec - /MediaPosition null - /MediaType (Transparency) - /TraySwitch false - /ManualFeed true - (>>) cvx exec setpagedevice" -*End -*?InputSlot: " - save - currentpagedevice /MediaPosition get - dup null eq - { pop currentpagedevice /MediaType get - dup null eq - { pop (Upper) } - { dup (Paper) eq - { pop currentpagedevice /ManualFeed get - { (ManualPaper) } - { (Paper) } ifelse - } - { - (Transparency) eq - { currentpagedevice /ManualFeed get - { (ManualTransparency) } - { (Transparency) } ifelse - } - { (Unknown) } ifelse - } ifelse - } ifelse - } - { - dup 0 eq - { pop (Upper) } - { dup 1 eq - { pop (Middle) } - { 2 eq - { (Lower) } - { (Unknown) } ifelse - } ifelse - } ifelse - } ifelse - = flush restore" -*End -*CloseUI: *InputSlot - -*% Paper Handling =================== - -*% Use these entries to set paper size most of the time, unless there is -*% specific reason to use PageRegion. -*OpenUI *PageSize: PickOne -*OrderDependency: 20 AnySetup *PageSize -*DefaultPageSize: Letter -*PageSize Letter: "(<<) cvx exec /PageSize [612 792] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageSize Legal: "(<<) cvx exec /PageSize [612 1008] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageSize A4: "(<<) cvx exec /PageSize [595 842] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*?PageSize: " - save currentpagedevice /PageSize get aload pop - 2 copy gt {exch} if (Unknown) - (<<) cvx exec - [612 792] (Letter) - [612 1008] (Legal) - [595 842] (A4) (>>) cvx exec - { exch aload pop 4 index sub abs 5 le exch 5 index sub abs 5 le and - { exch pop exit } { pop } ifelse - } bind forall = flush pop pop - restore" -*End -*CloseUI: *PageSize - -*% These entries will set up the frame buffer. Usually used with manual feed. -*OpenUI *PageRegion: PickOne -*OrderDependency: 30 AnySetup *PageRegion -*DefaultPageRegion: Letter -*PageRegion Letter: "(<<) cvx exec /PageSize [612 792] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageRegion Legal: "(<<) cvx exec /PageSize [612 1008] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*PageRegion A4: "(<<) cvx exec /PageSize [595 842] /ImagingBBox null - (>>) cvx exec setpagedevice" -*End -*CloseUI: *PageRegion - -*% The following entries provide information about specific paper keywords. -*DefaultImageableArea: Letter -*ImageableArea Letter: "10.32 15.9 601.68 776.22" -*ImageableArea Legal: "10.32 16.3801 601.68 991.74" -*ImageableArea A4: "13.44 14.46 581.76 828.54" -*?ImageableArea: " - save - /cvp { ( ) cvs print ( ) print } bind def - /upperright {10000 mul floor 10000 div} bind def - /lowerleft {10000 mul ceiling 10000 div} bind def - newpath clippath pathbbox - 4 -2 roll exch 2 {lowerleft cvp} repeat - exch 2 {upperright cvp} repeat flush - restore" -*End - -*% These provide the physical dimensions of the paper (by keyword) -*DefaultPaperDimension: Letter -*PaperDimension Letter: "612 792" -*PaperDimension Legal: "612 1008" -*PaperDimension A4: "595 842" - -*RequiresPageRegion All: True - -*% Print Quality Selection =================== - -*OpenUI *OutputMode/Print Quality: PickOne -*OrderDependency: 50 AnySetup *OutputMode -*DefaultOutputMode: Standard -*OutputMode Fast/Fast Color 600x600 dpi: " - (<<) cvx exec - /HWResolution [600 600] - /ProcessColorModel /DeviceCMY - (>>) cvx exec setpagedevice" -*End -*OutputMode Standard/Standard 600x600 dpi: " - (<<) cvx exec - /HWResolution [600 600] - /ProcessColorModel /DeviceCMYK - (>>) cvx exec setpagedevice" -*End -*OutputMode Enhanced/Enhanced 1200x600 dpi: " - (<<) cvx exec - /HWResolution [1200 600] - /ProcessColorModel /DeviceCMYK - (>>) cvx exec setpagedevice" -*End -*OutputMode Premium/Premium 1200x1200 dpi: " - (<<) cvx exec - /HWResolution [1200 1200] - /ProcessColorModel /DeviceCMYK - (>>) cvx exec setpagedevice" -*End -*?OutputMode: " - save - currentpagedevice /ProcessColorModel get /DeviceCMY eq - { (Fast) } - { currentpagedevice /HWResolution get - aload pop 1200 eq - { pop (Premium) } - { 1200 eq - { (Enhanced) } - { (Standard) } ifelse - } ifelse - } ifelse - = flush restore" -*End -*CloseUI: *OutputMode - -*OpenUI *OutputOrder/Output Order: PickOne -*OrderDependency: 60 AnySetup *OutputOrder -*DefaultOutputOrder: Reverse -*OutputOrder Normal/Face Down: " - (<<) cvx exec - /OutputFaceUp false - (>>) cvx exec setpagedevice" -*End -*OutputOrder Reverse/Face Up: " - (<<) cvx exec - /OutputFaceUp true - (>>) cvx exec setpagedevice" -*End -*?OutputOrder: " - save - currentpagedevice /OutputFaceUp get {(Reverse)}{(Normal)}ifelse - = flush restore" -*End -*CloseUI: *OutputOrder - -*OpenUI *Collate/Quick Collate: Boolean -*OrderDependency: 70 AnySetup *Collate -*DefaultCollate: False -*Collate False: " - (<<) cvx exec - /Collate false - (>>) cvx exec setpagedevice" -*End -*Collate True: " - (<<) cvx exec - /Collate true - (>>) cvx exec setpagedevice" -*End -*?Collate: " - save - currentpagedevice /Collate get {(True)}{(False)}ifelse - = flush restore" -*End -*CloseUI: *Collate - -*%================================ -*% Two-sided Printing (Duplex) -*%================================ - -*OpenUI *Duplex/Duplex: PickOne -*OrderDependency: 50 AnySetup *Duplex -*DefaultDuplex: None -*Duplex None/Off: " - <> setpagedevice" -*End -*Duplex DuplexNoTumble/Flip on Long Edge (Standard): " - <> setpagedevice" -*End -*Duplex DuplexTumble/Flip on Short Edge: " - <> setpagedevice" -*End -*?Duplex: "save - currentpagedevice dup /Duplex known - {dup /Duplex get - {/Tumble get{(DuplexTumble)}{(DuplexNoTumble)}ifelse} - {pop (None)} ifelse - } - {(None)} ifelse = flush -restore -" -*End -*CloseUI: *Duplex - -*% ================================= -*% User Interface Constraints -*% ================================= - -*% If the duplex unit is not installed disable duplex modes. - -*UIConstraints: *DuplexUnit NotInstalled *Duplex DuplexNoTumble -*UIConstraints: *DuplexUnit NotInstalled *Duplex DuplexTumble - - -*% Font Information ===================== -*DefaultFont: Courier -*Font Courier: Standard "(002.003)" Standard ROM -*Font Courier-Bold: Standard "(002.003)" Standard ROM -*Font Courier-BoldOblique: Standard "(002.003)" Standard ROM -*Font Courier-Oblique: Standard "(002.003)" Standard ROM -*Font Helvetica: Standard "(001.006)" Standard ROM -*Font Helvetica-Bold: Standard "(001.007)" Standard ROM -*Font Helvetica-BoldOblique: Standard "(001.007)" Standard ROM -*Font Helvetica-Condensed: Standard "(001.001)" Standard ROM -*Font Helvetica-Condensed-Bold: Standard "(001.002)" Standard ROM -*Font Helvetica-Condensed-BoldObl: Standard "(001.002)" Standard ROM -*Font Helvetica-Condensed-Oblique: Standard "(001.001)" Standard ROM -*Font Helvetica-Narrow: Standard "(001.006)" Standard ROM -*Font Helvetica-Narrow-Bold: Standard "(001.007)" Standard ROM -*Font Helvetica-Narrow-BoldOblique: Standard "(001.007)" Standard ROM -*Font Helvetica-Narrow-Oblique: Standard "(001.006)" Standard ROM -*Font Helvetica-Oblique: Standard "(001.006)" Standard ROM -*Font Symbol: Special "(001.007)" Special ROM -*Font Times-Bold: Standard "(001.007)" Standard ROM -*Font Times-BoldItalic: Standard "(001.009)" Standard ROM -*Font Times-Italic: Standard "(001.007)" Standard ROM -*Font Times-Roman: Standard "(001.007)" Standard ROM -*Font ZapfChancery-MediumItalic: Standard "(001.006)" Standard ROM -*Font ZapfDingbats: Special "(001.004)" Special ROM -*?FontQuery: " - save - { count 1 gt - { exch dup 127 string cvs (/) print print (:) print - /Font resourcestatus {pop pop (Yes)} {(No)} ifelse = - } { exit } ifelse - } bind loop - (*) = flush restore" -*End - -*?FontList: " - save (*) {cvn ==} 128 string /Font resourceforall - (*) = flush restore" -*End - -*DefaultColorSep: ProcessBlack.60lpi.600x600dpi/60 lpi / 600x600 dpi - -*% For 60 lpi / 600x600dpi ================================ - -*ColorSepScreenAngle ProcessBlack.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle CustomColor.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle ProcessCyan.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle ProcessMagenta.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" -*ColorSepScreenAngle ProcessYellow.60lpi.600x600dpi/60 lpi / 600x600 dpi: "0.0" - -*ColorSepScreenFreq ProcessBlack.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq CustomColor.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq ProcessCyan.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq ProcessMagenta.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" -*ColorSepScreenFreq ProcessYellow.60lpi.600x600dpi/60 lpi / 600x600 dpi: "60.0" - -*% end of PPD file for MS PS5 OEM Custimization diff --git a/print/autoconfig/AutoCnfg.inf b/print/autoconfig/AutoCnfg.inf deleted file mode 100644 index 8e0f0859..00000000 Binary files a/print/autoconfig/AutoCnfg.inf and /dev/null differ diff --git a/print/autoconfig/AutoConfig.htm b/print/autoconfig/AutoConfig.htm deleted file mode 100644 index 5a32268c..00000000 --- a/print/autoconfig/AutoConfig.htm +++ /dev/null @@ -1,367 +0,0 @@ - - - - -Auto-Configuration Samples - - - - - -

Auto-Configuration Samples

-

Summary

-

-AutoConfig sample -demonstrates how to implement Unidrv-based and PScript5-based drivers to -leverage the inbox support for auto-configuration.

-

-The sample -works only when used with the standard TCP/IP port monitor or the -Network-Connected Device (NCD) port monitor.

-

 

-

-Note: The -sample is provided here only as a proof of concept.

-

 

-

The -table shown below identifies which operating systems this sample will build and -work on.

-

 

-

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

- Operating System

-

- Can sample be - built in the OS? -

-

- Does sample work - in the OS?

-

- - Can sample be used in a production environment for the OS?

-

- Windows Vista

-

- Yes

-

- Yes

-

- No

-

- Windows Server - 2003

-

- No

-

- No

-

- No

-

- Windows XP

-

- No

-

- No

-

- No

-

- Windows 2000

-

- No

-

- No

-

- No

-

- Windows Me

-

- No

-

- No

-

- No

-

- Windows 98 SE

-

- No

-

- No

-

- No

-

 

-

Auto-Configuration -Basics

-

Prior -to Microsoft® Windows® Vista, the settings of a print queue are set initially to -the driver's default settings, rather than to the appropriate settings based on -the device. For Unidrv or Pscript5, this means that static default values -specified in the GPD or PPD file are used for the initial print queue setup. -This static set of defaults necessarily must represent the minimum configuration -that a printer can ship with. For instance, if a stapling unit is optional for a -device, then by default, such a device cannot have stapling capability enabled, -otherwise the user interface for devices without the stapling unit would show -stapling as an option. A customer who selected the stapling option but found -that it did not work would likely be confused.

-

For any device that -comes with features not present in the basic model, a user or administrator must -manually configure these features on the print queue after installation. This -can at times be a confusing and non-intuitive experience. The configuration -process is easy to get wrong, particularly with regard to internal parameters -such as memory and hard disk size, which significantly can affect printing speed -and quality.

-

Auto-configuration -solves this problem by -automatically configuring the print queue according to the installable features -on the device, rather than simply using the driver's static default settings. -The main target for auto-configuration is network printers. They are the most -likely ones to have multiple optional features and require more manual -configuration.

-

Auto-configuration -works by means of -bi-directional printer communication (also known as bidi communication) between -the print subsystem and the printer. In order for auto-configuration to work, -the printer must be able to:

-

-·                  - -Understand a -query sent by the port monitor.

-

-·                  - -Generate the -appropriate response to the query.

-

To support -auto-configuration, both the printer driver and the port monitor must be -modified.

-

A printer driver -must:

-

-·                  - -Be aware of -the Bidi Notification Schema.

-

-·                  - -Be able to -receive notifications about device configuration changes using the Bidi -Notification Schema.

-

-·                  - -Be able to -solicit configuration data from the printer using the Bidi Communication -Interfaces, and specifically the IBidiSpl2 COM interface (described in -the Platform SDK documentation).

-

A port monitor -must:

-

-·                  - -Support a -device protocol capable of querying the printer's configuration.

-

-·                  - -Be able to -receive unsolicited status messages from the printer.

-

-·                  - -Convert -unsolicited status messages to an appropriate driver notification.

-

-·                  - -Keep all of -the device status and configuration data up-to date by means of polling or -alerts.

-

-·                  - -Inform the -driver or application of any configuration changes in the device.

-

Unidrv-based and -PScript5-based drivers using the standard TCP/IP port monitor or the -Network-Connected Device (NCD) port monitor provide support for -auto-configuration.

-

CODE TOUR

-

 

-

-Unidrv - -Auto-Configuration Sample

-

- 

-

The main part of the -sample is the auto-configuration GDL file ACnfgUni.GDL. This file implements -the  *BidiQuery, *BidiResponse and *Option elements that correspond to the -Memory, DuplexUnit and PrinterHardDisk features in AutoCnfg.GPD file. The -Feature and Option names in the auto-configuration GDL file should exaclty match -the corresponding Feature and Option names in the GPD file. The -auto-configuration GDL file is specified in the GPD file using the *BidiQueryFile -keyword. The auto-configuration GDL content can also be contained directly -inside the GPD file itself instead of in a separate GDL file, in which case the -*BidiQueryFile keyword should specify the GPD file name.

-

 

-

-PScript5 Auto-Configuration -Sample

-

 

-

The -main part of the sample is the auto-configuration GDL file ACnfgPS.GDL. This -file implements the *BidiQuery, *BidiResponse and *Option elements that -corresponds to the InstalledMemory, DuplexUnit and HardDisk features in -AutoCnfg.PPD file. As mentioned for the Unidrv sample, the Feature and Option -names should exactly match. Please note that the GPD and PPD files do not have -the same Feature and Option names. That is why the two GDL files are not -identical. The auto-configuration GDL file is specified in the PPD file using -the *MSBidiQueryFile keyword.

-

INSTALLING/TESTING THE SAMPLE

-

The samples don’t have -any binaries to be built. They may be installed by using Add Printer Wizard and -supplying the AutoCnfg.INF as the INF file. To test the auto-configuration -feature you need to install the driver to a Standard TCP/IP port.  You need a -printer, which understands and responds to the bidi SNMP queries, connected to -the port. The tcpbidi.xml file located in system32 directory has information -about the SNMP OIDs used for each query. The installable options in the device -settings will reflect the information obtained by querying the printer. -

-

File Manifest 

-
 
-
Root:
-
 
-
Files                  Description
-
 
-

AutoConfig.htm      The documentation for this sample -(this file)

-

AutoCnfg.INF        The printer INF that will install -Unidrv and PScript5 auto-configuration samples

-

AutoCnfg.GPD        The GPD file for the Unidrv -auto-configuration sample

-

AutoCnfg.PPD        The PPD file for the PScript5 -auto-configuration sample

-

ACnfgUni.GDL        The GDL file for the Unidrv -auto-configuration sample

-

ACnfgPS.GDL         The GDL file for the PScript5 -auto-configuration sample

-

Resources

-

For -the latest release of the Windows Device Driver Development Kit, see - -http://www.microsoft.com/whdc/ddk/winddk.mspx.

-

 

-

If -you have questions on using or adapting this sample for your project, you can -either contact - -Microsoft Technical Support or post your questions in the - -Microsoft driver development newsgroup.

- - - - diff --git a/print/autoconfig/AutoConfig.sln b/print/autoconfig/AutoConfig.sln deleted file mode 100644 index 41c3f755..00000000 --- a/print/autoconfig/AutoConfig.sln +++ /dev/null @@ -1,61 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 12.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{C8C5A4C2-DE1C-4B59-9E50-DD766C931F7A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AutoConfig", "AutoConfig", "{02B91EC2-24FC-4562-AEB5-4269AA96F54F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "Package\package.VcxProj", "{34C973B1-CBF0-4A78-A05A-176FCFB1D25F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AutoConfig", "AutoConfig.vcxproj", "{DBBDF822-170C-4685-BAE7-5E0531334164}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Debug|ARM64.Build.0 = Debug|ARM64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Debug|Win32.ActiveCfg = Debug|Win32 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Debug|Win32.Build.0 = Debug|Win32 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Debug|x64.ActiveCfg = Debug|x64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Debug|x64.Build.0 = Debug|x64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Release|ARM64.ActiveCfg = Release|ARM64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Release|ARM64.Build.0 = Release|ARM64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Release|ARM64.Deploy.0 = Release|ARM64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Release|Win32.ActiveCfg = Release|Win32 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Release|Win32.Build.0 = Release|Win32 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Release|x64.ActiveCfg = Release|x64 - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F}.Release|x64.Build.0 = Release|x64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Debug|ARM64.Build.0 = Debug|ARM64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Debug|Win32.ActiveCfg = Debug|Win32 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Debug|Win32.Build.0 = Debug|Win32 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Debug|x64.ActiveCfg = Debug|x64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Debug|x64.Build.0 = Debug|x64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Release|ARM64.ActiveCfg = Release|ARM64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Release|ARM64.Build.0 = Release|ARM64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Release|ARM64.Deploy.0 = Release|ARM64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Release|Win32.ActiveCfg = Release|Win32 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Release|Win32.Build.0 = Release|Win32 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Release|x64.ActiveCfg = Release|x64 - {DBBDF822-170C-4685-BAE7-5E0531334164}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {C8C5A4C2-DE1C-4B59-9E50-DD766C931F7A} = {02B91EC2-24FC-4562-AEB5-4269AA96F54F} - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F} = {C8C5A4C2-DE1C-4B59-9E50-DD766C931F7A} - {DBBDF822-170C-4685-BAE7-5E0531334164} = {02B91EC2-24FC-4562-AEB5-4269AA96F54F} - EndGlobalSection -EndGlobal diff --git a/print/autoconfig/AutoConfig.vcxproj b/print/autoconfig/AutoConfig.vcxproj deleted file mode 100644 index 157a3421..00000000 --- a/print/autoconfig/AutoConfig.vcxproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {DBBDF822-170C-4685-BAE7-5E0531334164} - $(MSBuildProjectName) - false - true - Debug - Win32 - {821AA832-43DA-484F-B436-A751BBC5E1F9} - - - - Windows10 - False - Desktop - None - WindowsKernelModeDriver10.0 - Utility - - - Windows10 - False - Desktop - None - WindowsKernelModeDriver10.0 - Utility - - - Windows10 - True - Desktop - None - WindowsKernelModeDriver10.0 - Utility - - - Windows10 - True - Desktop - None - WindowsKernelModeDriver10.0 - Utility - - - Windows10 - False - Desktop - None - WindowsKernelModeDriver10.0 - Utility - - - Windows10 - True - Desktop - None - WindowsKernelModeDriver10.0 - Utility - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - AutoConfig - - - AutoConfig - - - AutoConfig - - - AutoConfig - - - AutoConfig - - - AutoConfig - - - - - - - - - - - - - - - - - - - - sha256 - - - - - - - - - - - - - - - sha256 - - - - - - - - - - - - - - - sha256 - - - - - - - - - sha256 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/autoconfig/AutoConfig.vcxproj.Filters b/print/autoconfig/AutoConfig.vcxproj.Filters deleted file mode 100644 index de588577..00000000 --- a/print/autoconfig/AutoConfig.vcxproj.Filters +++ /dev/null @@ -1,33 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {D1B6D29E-5EA1-4F2A-960C-443922495DA5} - - - h;hpp;hxx;hm;inl;inc;xsd - {0ABCC6C5-B619-4FCF-AB9C-73DBCBE6068D} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {E239B7F1-0E58-4214-A82C-6EF67A1B3200} - - - inf;inv;inx;mof;mc; - {4E1D1476-C128-41DB-8AC6-44D5C6CD9B08} - - - - - Driver Files - - - - - - - - - - \ No newline at end of file diff --git a/print/autoconfig/Package/package.VcxProj b/print/autoconfig/Package/package.VcxProj deleted file mode 100644 index 2a7cb511..00000000 --- a/print/autoconfig/Package/package.VcxProj +++ /dev/null @@ -1,118 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - {DBBDF822-170C-4685-BAE7-5E0531334164} - - - - WindowsKernelModeDriver10.0 - Utility - Package - true - Debug - - - - {34C973B1-CBF0-4A78-A05A-176FCFB1D25F} - {2E5E1DA7-8772-44A5-ABE9-1B80A98A90AD} - $(MSBuildProjectName) - - - Windows10 - true - - - Windows10 - false - - - Windows10 - true - - - Windows10 - true - - - Windows10 - false - - - Windows10 - false - - - - - - - - - - - DbgengKernelDebugger - False - None - - - - - - %PathToInf% - False - False - True - - 133563 - - - - sha256 - - - - - sha256 - - - - - sha256 - - - - - sha256 - - - - - - \ No newline at end of file diff --git a/print/autoconfig/Package/package.VcxProj.Filters b/print/autoconfig/Package/package.VcxProj.Filters deleted file mode 100644 index c693e880..00000000 --- a/print/autoconfig/Package/package.VcxProj.Filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {AFCC4B11-852A-4DCE-95D8-5D2DCAE22085} - - - h;hpp;hxx;hm;inl;inc;xsd - {0ECC0278-CEC7-4209-951D-119A7D63A76D} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {51B9F757-EC1F-4B30-8B99-C9D27C96E97F} - - - inf;inv;inx;mof;mc; - {7FD4D4E0-CF4E-4AA5-ABAD-FC643918C407} - - - \ No newline at end of file diff --git a/print/autoconfig/README.md b/print/autoconfig/README.md deleted file mode 100644 index a4311618..00000000 --- a/print/autoconfig/README.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -page_type: sample -description: "Demonstrates how to implement auto-configuration in v4 print drivers." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# Print auto-configuration sample - -This sample demonstrates how to implement auto-configuration in v4 print drivers. - -## Auto-configuration basics - -Many printers ship with optional components which are not present in all versions of the printer. For these printers, it's important that the driver only shows options which are enabled by the currently installed hardware. For example, if a stapling unit is optional for a particular printer, then the driver shouldn't expose the stapling feature to the end user if that unit is not installed. - -Windows auto-configuration allows a print driver to specify a mapping between driver installable options and the state of the printer as expressed through the Bidi Schema. - -For more information on auto-configuration, see [Printer Autoconfiguration](https://docs.microsoft.com/windows-hardware/drivers/print/printer-autoconfiguration). - -For more information on the Bidi Schema, see [Bidirectional Communication Schema](https://docs.microsoft.com/windows-hardware/drivers/print/bidirectional-communication-schema). - -## Build the sample - -The auto-configuration sample doesn't have any binaries to be built. It may be installed by using **Add Printer Wizard** and supplying the AutoCnfg.INF as the INF file. - -Too build a signed driver package using Windows Driver Kit (WDK) 10 and Visual Studio 2015, for the project file (csproj) that ships with the auto-configuration sample, perform the following steps. - -1. Open the solution file in Visual Studio 2015. - -1. On the **Build** menu, select **Configuration Manager...**. - -1. In **Configuration Manager**, select the **Configuration** and **Platform** that you want to build your driver for. - -> [!NOTE] -> When the driver builds, it will be placed in the output folder for the architecture you selected. - -At this point, Visual Studio will be able to build a driver package and output the files to disk. In order to configure driver signing and deployment, see [Developing, Testing, and Deploying Drivers](https://docs.microsoft.com/windows-hardware/drivers/develop/). - -For more information about how to build a driver solution using Microsoft Visual Studio, see [Building a Driver with Visual Studio and the WDK](https://docs.microsoft.com/windows-hardware/drivers/develop/building-a-driver). - -## Run the sample - -To run the auto-configuration sample, you must install this driver to support a printer which is installed against either a WSD port, or TCP/IP port. Additionally, USB printers may be supported if the driver is updated to incorporate USB Bidi Javascript, as described here: [Print Driver USB Monitor and Bidi Sample](https://docs.microsoft.com/samples/microsoft/windows-driver-samples/print-driver-usb-monitor-and-bidi-sample/). diff --git a/print/cpsuisam/CPSUIDAT.C b/print/cpsuisam/CPSUIDAT.C deleted file mode 100644 index c3854001..00000000 --- a/print/cpsuisam/CPSUIDAT.C +++ /dev/null @@ -1,1331 +0,0 @@ -/*++ - -Copyright (c) 1990-2003 Microsoft Corporation -All Rights Reserved - - -Module Name: - - cpsuidat.c - - -Abstract: - - This module contains all the predefined data - - ---*/ - - -#include "precomp.h" -#pragma hdrstop - -#define DBG_CPSUIFILENAME DbgTVPage - - - -#define DBG_TVTESTCB 0x00000001 -#define DBG_PUSHDLGPROC 0x00000002 - -DEFINE_DBGVAR(0); - -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) - - -HINSTANCE hInstApp = NULL; - -TCHAR TitleName[] = TEXT("Common Property Sheet UI Sample"); -TCHAR ClassName[] = TEXT("CPSUISampleClass"); -TCHAR MenuName[] = TEXT("CPSUISampleMenu"); -TCHAR OptItemName[] = TEXT("CPSUI TreeView Sample"); -TCHAR szWinSpool[] = TEXT("WinSpool.Drv"); -CHAR szDocPropSheets[] = "DocumentPropertySheets"; - -BOOL UpdatePermission = TRUE; -BOOL UseStdAbout = TRUE; - - -INT_PTR -CALLBACK -PushButtonProc( - HWND hDlg, - UINT Msg, - WPARAM wParam, - LPARAM lParam - ); - -CPSUICALLBACK -TVTestCallBack( - _In_ PCPSUICBPARAM pCPSUICBParam - ); - - -OPTPARAM NoYesOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - (LPTSTR)IDS_CPSUI_NO, // pData - IDI_CPSUI_NO, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - (LPTSTR)IDS_CPSUI_YES, // pData - IDI_CPSUI_YES, // IconID - 1 // lParam - } -}; - -EXTCHKBOX ECB_EP_ECB = { - - sizeof(EXTCHKBOX), - 0, - TEXT("Include Icon"), - (LPTSTR)IDS_CPSUI_SLASH_SEP, - TEXT("Icon"), - IDI_CPSUI_GRAPHIC }; - - -OPTPARAM ECB_EP_OP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("None"), // pData - IDI_CPSUI_EMPTY, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("Extended CheckBox"), // pData - IDI_CPSUI_EMPTY, // IconID - 1 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("Extended Push"), // pData - IDI_CPSUI_EMPTY, // IconID - 0 // lParam - } -}; - - -OPTTYPE ECB_EP_OT = { - - sizeof(OPTTYPE), // cbSize - TVOT_3STATES, // Type - 0, // Flags OPTTF_xxxx - 3, // Count - 0, // BegCtrlID - ECB_EP_OP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTTYPE NoYesOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_2STATES, // Type - 0, // Flags OPTTF_xxxx - 2, // Count - 0, // BegCtrlID - NoYesOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTPARAM TVOT3StatesOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("States 1"), // pData - IDI_CPSUI_PORTRAIT, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("States 2"), // pData - IDI_CPSUI_LANDSCAPE, // IconID - 1 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("States 3"), // pData - IDI_CPSUI_ROT_LAND, // IconID - 0 // lParam - } -}; - -OPTTYPE TVOT2StatesOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_2STATES, // Type - 0, // Flags OPTTF_xxxx - 2, // Count - 0, // BegCtrlID - TVOT3StatesOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTTYPE TVOT3StatesOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_3STATES, // Type - 0, // Flags OPTTF_xxxx - 3, // Count - 0, // BegCtrlID - TVOT3StatesOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTPARAM MinRangeOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT(""), // pData (postfix) - IDI_CPSUI_EMPTY, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - NULL, // pData (help line) - (DWORD)MIN_INT, // IconID - MAX_INT // lParam - } -}; - -OPTTYPE MinRangeOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_UDARROW, // Type - 0, // Flags OPTTF_xxxx - 2, // Count - 0, // BegCtrlID - MinRangeOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTPARAM MaxRangeOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT(""), // pData (postfix) - IDI_CPSUI_EMPTY, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - NULL, // pData (help line) - (DWORD)MIN_INT, // IconID - MAX_INT // lParam - } -}; - -OPTTYPE MaxRangeOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_UDARROW, // Type - 0, // Flags OPTTF_xxxx - 2, // Count - 0, // BegCtrlID - MaxRangeOP, // pOptParam - 0 // Style, OTS_xxxx - }; - - -OPTPARAM MinMaxRangeOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("%"), // pData (postfix) - IDI_CPSUI_SCALING, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - NULL, // pData (help line) - (DWORD)MIN_INT, // IconID - MAX_INT // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - NULL, // pData (help line) - 2, // IconID - 50 // lParam - } -}; - -OPTTYPE TVOTUDArrowOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_UDARROW, // Type - 0, // Flags OPTTF_xxxx - 2, // Count - 0, // BegCtrlID - MinMaxRangeOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTTYPE TVOTTrackBarOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_TRACKBAR, // Type - 0, // Flags OPTTF_xxxx - 3, // Count - 0, // BegCtrlID - MinMaxRangeOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTTYPE TVOTScrollBarOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_SCROLLBAR, // Type - 0, // Flags OPTTF_xxxx - 3, // Count - 0, // BegCtrlID - MinMaxRangeOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTPARAM TVOTLBCBOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - (LPTSTR)IDS_CPSUI_NOTINSTALLED, // pData - IDI_CPSUI_SEL_NONE, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT(" 1 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT(" 2 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT(" 4 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT(" 6 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT(" 8 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("10 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("12 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("14 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("16 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("18 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("20 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("24 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("32 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("48 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("64 MB"), // pData - IDI_CPSUI_MEM, // IconID - 0 // lParam - }, -}; - - -OPTTYPE TVOTListBoxOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_LISTBOX, // Type - 0, // Flags OPTTF_xxxx - COUNT_ARRAY(TVOTLBCBOP), // Count - 0, // BegCtrlID - TVOTLBCBOP, // pOptParam - 0 // Style, OTS_xxxx - }; - - -OPTTYPE TVOTComboBoxOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_COMBOBOX, // Type - 0, // Flags OPTTF_xxxx - COUNT_ARRAY(TVOTLBCBOP), // Count - 0, // BegCtrlID - TVOTLBCBOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -TCHAR TVOTEditBoxBuf[128] = TEXT("Confidential"); - -OPTPARAM TVOTEditBoxOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("*Mark*"), // pData - IDI_CPSUI_WATERMARK, // IconID - 0 // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("Type in WaterMark text"), // pData - COUNT_ARRAY(TVOTEditBoxBuf), // IconID - 0 // lParam - } -}; - - -OPTTYPE TVOTEditBoxOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_EDITBOX, // Type - 0, // Flags OPTTF_xxxx - 2, // Count - 0, // BegCtrlID - TVOTEditBoxOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -OPTPARAM TVOTChkBoxOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - CHKBOXS_FALSE_TRUE, // style - TEXT("Let's do it!"), // pData - IDI_CPSUI_TELEPHONE, // IconID - 0 // lParam - } -}; - - - -OPTTYPE TVOTChkBoxOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_CHKBOX, // Type - 0, // Flags OPTTF_xxxx - 1, // Count - 0, // BegCtrlID - TVOTChkBoxOP, // pOptParam - 0 // Style, OTS_xxxx - }; - - -OPTPARAM ChkBoxTypeOP[] = { - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("CHKBOXS_FALSE_TRUE"), // pData - IDI_CPSUI_EMPTY, // IconID - CHKBOXS_FALSE_TRUE // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("CHKBOXS_NO_YES"), // pData - IDI_CPSUI_EMPTY, // IconID - CHKBOXS_NO_YES // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("CHKBOXS_OFF_ON"), // pData - IDI_CPSUI_EMPTY, // IconID - CHKBOXS_OFF_ON // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("CHKBOXS_FALSE_PDATA"), // pData - IDI_CPSUI_EMPTY, // IconID - CHKBOXS_FALSE_PDATA // lParam - }, - - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("CHKBOXS_NO_PDATA"), // pData - IDI_CPSUI_EMPTY, // IconID - CHKBOXS_NO_PDATA // lParam - }, - - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("CHKBOXS_OFF_PDATA"), // pData - IDI_CPSUI_EMPTY, // IconID - CHKBOXS_OFF_PDATA // lParam - }, - - { - sizeof(OPTPARAM), // cbSize - 0, // OPTPF_xxx - 0, // style - TEXT("CHKBOXS_NONE_PDATA"), // pData - IDI_CPSUI_EMPTY, // IconID - CHKBOXS_NONE_PDATA // lParam - } -}; - - -OPTTYPE ChkBoxTypeOT = { - - sizeof(OPTTYPE), // cbSize - TVOT_LISTBOX, // Type - 0, // Flags OPTTF_xxxx - COUNT_ARRAY(ChkBoxTypeOP), // Count - 0, // BegCtrlID - ChkBoxTypeOP, // pOptParam - 0 // Style, OTS_xxxx - }; - -EXTCHKBOX TV_ECB = { - - sizeof(EXTCHKBOX), - ECBF_OVERLAY_WARNING_ICON, - TEXT("Extended CheckBox Test"), - (LPTSTR)IDS_CPSUI_SLASH_SEP, - TEXT("Got Checked!!!"), - IDI_APPLE }; - -EXTPUSH TV_EP = { - - sizeof(EXTPUSH), - 0, - TEXT("Extended Push Test"), - NULL, //DLGPROC - IDI_APPLE, - 0 }; - - - -OPTITEM TVTestOptItems[] = { - - { sizeof(OPTITEM), LEVEL_0, 0, OPTIF_NONE, 0, - (LPTSTR)TEXT("TreeView Test"), IDI_CPSUI_QUESTION, NULL, - NULL, 0, DMPUB_TVTEST }, - - { sizeof(OPTITEM), LEVEL_1, 0, OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("CPSUI Options"), 0, NULL, - NULL, 0, DMPUB_TVOPT }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Extended Type"), 0, &ECB_EP_ECB, - &ECB_EP_OT, 0, DMPUB_TVOPT_ECB_EP }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Disabled Extended"), 0, NULL, - &NoYesOT, 0, DMPUB_EXT_DISABLED }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Overlay 'Warning' Icon"), 0, NULL, - &NoYesOT, 0, DMPUB_EXT_OVERLAY_WARNING }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Overlay 'Stop' Icon"), 0, NULL, - &NoYesOT, 0, DMPUB_EXT_OVERLAY_STOP }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Overlay 'No' Icon"), 0, NULL, - &NoYesOT, 0, DMPUB_EXT_OVERLAY_NO }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("OptItem/OptType"), 0, NULL, - NULL, 0, DMPUB_TVOPT }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Disabled OptType"), 0, NULL, - &NoYesOT, 0, DMPUB_TVOPT_DISABLED }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Overlay 'Warning' Icon"), 0, NULL, - &NoYesOT, 0, DMPUB_TVOPT_OVERLAY_WARNING }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Overlay 'Stop' Icon"), 0, NULL, - &NoYesOT, 0, DMPUB_TVOPT_OVERLAY_STOP }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Overlay 'No' Icon"), 0, NULL, - &NoYesOT, 0, DMPUB_TVOPT_OVERLAY_NO }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("ScrollBar/TrackBar Ranges"), 0, NULL, - NULL, 0, DMPUB_TVOPT }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - TEXT("Min Range"), MIN_INT, NULL, - &MinRangeOT, 0, DMPUB_MINRANGE }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - TEXT("Max. Range"), MAX_INT, NULL, - &MaxRangeOT, 0, DMPUB_MAXRANGE }, - - { sizeof(OPTITEM), LEVEL_1, 0, OPTIF_NONE, 0, - TEXT("TVOT Test"), IDI_CPSUI_QUESTION, NULL, - NULL, 0, DMPUB_TVOPT_TEST }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - (LPTSTR)TEXT("TVOT_2STATES"), 0, NULL, - &TVOT2StatesOT, 0, DMPUB_2STATES }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_3STATES"), 0, NULL, - &TVOT3StatesOT, 0, DMPUB_3STATES }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_UDARROW"), 55, NULL, - &TVOTUDArrowOT, 0, DMPUB_UDARROW }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_TRACKBAR"), 100, NULL, - &TVOTTrackBarOT, 0, DMPUB_TRACKBAR }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_SCROLLBAR"), 210, NULL, - &TVOTScrollBarOT, 0, DMPUB_SCROLLBAR }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_LISTBOX"), 2, NULL, - &TVOTListBoxOT, 0, DMPUB_LISTBOX }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Include 16x16 Icons"), 1, NULL, - &NoYesOT, 0, DMPUB_TVOPT_ICONS }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_COMBOBOX"), 4, NULL, - &TVOTComboBoxOT, 0, DMPUB_COMBOBOX }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, - (LPTSTR)TEXT("Include 16x16 Icons"), 1, NULL, - &NoYesOT, 0, DMPUB_TVOPT_ICONS }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_EDITBOX"), 0, NULL, // fill in TVOTEditBoxBuf later - &TVOTEditBoxOT, 0, DMPUB_EDITBOX }, - - { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, - TEXT("TVOT_CHKBOX"), 0, NULL, - &TVOTChkBoxOT, 0, DMPUB_CHKBOX }, - - { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK, 0, - TEXT("CheckBox Type"), 0, NULL, - &ChkBoxTypeOT, 0, DMPUB_CHKBOX_TYPE } - -}; - - - -INT_PTR -CALLBACK -PushButtonProc( - HWND hDlg, - UINT Msg, - WPARAM wParam, - LPARAM lParam - ) -{ - -#ifndef DBG - UNREFERENCED_PARAMETER(lParam); -#endif - - switch (Msg) { - - case WM_INITDIALOG: /* message: initialize dialog box */ - - CPSUIDBG(DBG_PUSHDLGPROC, - ("PushButtonProc lParam=%s", (LPSTR)lParam)); - break; - - case WM_COMMAND: - - switch(LOWORD(wParam)) { - - case IDOK: - case IDCANCEL: - - EndDialog(hDlg, (BOOL)(LOWORD(wParam) == IDOK)); - return(TRUE); - } - } - - return(FALSE); -} - - - -INT_PTR -APIENTRY -MyAboutProc( - HWND hDlg, - UINT Msg, - WPARAM wParam, - LPARAM lParam - ) - -/*++ - -Routine Description: - - This is the about... callback which pop up appliation's own about - - ---*/ -{ - PCOMPROPSHEETUI pCPSUI = NULL; - TCHAR Buf[128] = {0}; - HRESULT hr = S_OK; - - switch (Msg) { - - case WM_INITDIALOG: /* message: initialize dialog box */ - - pCPSUI = (PCOMPROPSHEETUI)lParam; - - hr = pCPSUI ? S_OK : E_INVALIDARG; - - if (SUCCEEDED(hr)) - { - hr = StringCchPrintf(Buf, ARRAY_SIZE(Buf), TEXT("About %s"), pCPSUI->pCallerName); - } - - if (SUCCEEDED(hr)) - { - hr = SetWindowText(hDlg, Buf) ? S_OK : E_FAIL; - } - - if (SUCCEEDED(hr)) - { - hr = StringCchPrintf(Buf, ARRAY_SIZE(Buf), - TEXT("%s Version %u.%u"), - pCPSUI->pCallerName, - (UINT)HIBYTE(pCPSUI->CallerVersion), - (UINT)LOBYTE(pCPSUI->CallerVersion)); - } - - if (SUCCEEDED(hr)) - { - hr = SetDlgItemText(hDlg, IDD_ABOUT1, Buf) ? S_OK : E_FAIL; - } - - if (SUCCEEDED(hr)) - { - hr = StringCchPrintf(Buf, ARRAY_SIZE(Buf), - TEXT("%s Version %u.%u"), - pCPSUI->pOptItemName, - (UINT)HIBYTE(pCPSUI->OptItemVersion), - (UINT)LOBYTE(pCPSUI->OptItemVersion)); - } - - if (SUCCEEDED(hr)) - { - hr = SetDlgItemText(hDlg, IDD_ABOUT2, Buf) ? S_OK : E_FAIL; - } - - break; - - case WM_COMMAND: - - switch(LOWORD(wParam)) { - - case IDOK: - case IDCANCEL: - - EndDialog(hDlg, (BOOL)(LOWORD(wParam) == IDOK)); - return(TRUE); - } - } - - return (FALSE); -} - - - -POPTITEM -FindOptItem( - POPTITEM pOptItem, - UINT cOptItem, - BYTE DMPubID - ) -{ - while (cOptItem--) { - - if (pOptItem->DMPubID == DMPubID) { - - return(pOptItem); - } - - ++pOptItem; - } - - return(NULL); -} - - - -CPSUICALLBACK -TVTestCallBack( - _In_ PCPSUICBPARAM pCPSUICBParam - ) -{ - POPTITEM pCurItem = pCPSUICBParam->pCurItem; - POPTITEM pItem; - BYTE DMPubID; - LONG Sel; - LONG Action = CPSUICB_ACTION_NONE; - - - DMPubID = pCurItem->DMPubID; - Sel = pCurItem->Sel; - - switch (pCPSUICBParam->Reason) { - - case CPSUICB_REASON_OPTITEM_SETFOCUS: - - CPSUIDBG(DBG_TVTESTCB, ("Got OPTITEM_SETFOCUS CallBack now")); - - switch (DMPubID) - { - case DMPUB_MINRANGE: - { - pItem = FindOptItem(pCPSUICBParam->pOptItem, - pCPSUICBParam->cOptItem, - DMPUB_MAXRANGE); - - if (pItem) - { - pCurItem->pOptType->pOptParam[1].lParam = (LONG)pItem->Sel; - } - } - - break; - - case DMPUB_MAXRANGE: - { - pItem = FindOptItem(pCPSUICBParam->pOptItem, - pCPSUICBParam->cOptItem, - DMPUB_MINRANGE); - - if (pItem) - { - pCurItem->pOptType->pOptParam[1].IconID = (DWORD)pItem->Sel; - } - } - - break; - - } - - break; - - case CPSUICB_REASON_ABOUT: - - DialogBoxParam(hInstApp, - MAKEINTRESOURCE(DLGABOUT), - pCPSUICBParam->hDlg, - MyAboutProc, - (LPARAM)(pCPSUICBParam->pOldSel)); - - break; - - case CPSUICB_REASON_ECB_CHANGED: - - CPSUIDBG(DBG_TVTESTCB, ("Got ECB_CHANGED CallBack now")); - - switch (DMPubID) { - - case DMPUB_TVOPT_ECB_EP: - - if (pCurItem->Flags & OPTIF_ECB_CHECKED) { - - TV_EP.IconID = - TV_ECB.IconID = IDI_APPLE; - - } else { - - TV_EP.IconID = - TV_ECB.IconID = 0; - } - - Action = CPSUICB_ACTION_OPTIF_CHANGED; - break; - - default: - - break; - } - - break; - - case CPSUICB_REASON_SEL_CHANGED: - - CPSUIDBG(DBG_TVTESTCB, ("Got SEL_CHANGED CallBack now")); - - switch (DMPubID) - { - case DMPUB_CHKBOX_TYPE: - { - pItem = FindOptItem(pCPSUICBParam->pOptItem, - pCPSUICBParam->cOptItem, - DMPUB_CHKBOX); - - if (pItem) - { - pItem->pOptType->pOptParam[0].Style = (BYTE)pCurItem->Sel; - - pItem->Flags |= OPTIF_CHANGED; - Action = CPSUICB_ACTION_OPTIF_CHANGED; - } - } - break; - - case DMPUB_TVOPT_ICONS: - - pItem = pCurItem - 1; - - if (Sel) { - - pItem->pOptType->Style &= ~OTS_LBCB_NO_ICON16_IN_ITEM; - - } else { - - pItem->pOptType->Style |= OTS_LBCB_NO_ICON16_IN_ITEM; - } - - break; - - case DMPUB_EXT_OVERLAY_WARNING: - - if (Sel) { - - TV_EP.Flags |= EPF_OVERLAY_WARNING_ICON; - TV_ECB.Flags |= ECBF_OVERLAY_WARNING_ICON; - - } else { - - TV_EP.Flags &= ~EPF_OVERLAY_WARNING_ICON; - TV_ECB.Flags &= ~ECBF_OVERLAY_WARNING_ICON; - } - - break; - - case DMPUB_EXT_OVERLAY_STOP: - - if (Sel) { - - TV_EP.Flags |= EPF_OVERLAY_STOP_ICON; - TV_ECB.Flags |= ECBF_OVERLAY_STOP_ICON; - - } else { - - TV_EP.Flags &= ~EPF_OVERLAY_STOP_ICON; - TV_ECB.Flags &= ~ECBF_OVERLAY_STOP_ICON; - } - - break; - - case DMPUB_EXT_OVERLAY_NO: - - if (Sel) { - - TV_EP.Flags |= EPF_OVERLAY_NO_ICON; - TV_ECB.Flags |= ECBF_OVERLAY_NO_ICON; - - } else { - - TV_EP.Flags &= ~EPF_OVERLAY_NO_ICON; - TV_ECB.Flags &= ~ECBF_OVERLAY_NO_ICON; - } - - break; - - case DMPUB_MINRANGE: - - MinMaxRangeOP[1].IconID = (DWORD)Sel; - break; - - case DMPUB_MAXRANGE: - - MinMaxRangeOP[1].lParam = (LONG)Sel; - break; - - case DMPUB_TVOPT_OVERLAY_WARNING: - case DMPUB_TVOPT_OVERLAY_STOP: - case DMPUB_TVOPT_OVERLAY_NO: - - Action = CPSUICB_ACTION_REINIT_ITEMS; - - case DMPUB_TVOPT_ECB_EP: - - if (Sel) { - - pCurItem->Flags &= ~OPTIF_EXT_DISABLED; - - } else { - - pCurItem->Flags |= OPTIF_EXT_DISABLED; - } - - pCurItem->Flags |= OPTIF_CHANGED; - Action = CPSUICB_ACTION_OPTIF_CHANGED; - - // - // Fall through - // - - case DMPUB_TVOPT_DISABLED: - case DMPUB_EXT_DISABLED: - - pItem = FindOptItem(pCPSUICBParam->pOptItem, - pCPSUICBParam->cOptItem, - DMPUB_2STATES); - - if (pItem) { - - do { - - if ((pItem->DMPubID >= DMPUB_2STATES) && - (pItem->DMPubID <= DMPUB_CHKBOX)) { - - switch (DMPubID) { - - case DMPUB_TVOPT_OVERLAY_WARNING: - - if (Sel) { - - pItem->Flags |= OPTIF_OVERLAY_WARNING_ICON; - - } else { - - pItem->Flags &= ~OPTIF_OVERLAY_WARNING_ICON; - } - - break; - - case DMPUB_TVOPT_OVERLAY_STOP: - - if (Sel) { - - pItem->Flags |= OPTIF_OVERLAY_STOP_ICON; - - } else { - - pItem->Flags &= ~OPTIF_OVERLAY_STOP_ICON; - } - - break; - - case DMPUB_TVOPT_OVERLAY_NO: - - if (Sel) { - - pItem->Flags |= OPTIF_OVERLAY_NO_ICON; - - } else { - - pItem->Flags &= ~OPTIF_OVERLAY_NO_ICON; - } - - break; - - case DMPUB_TVOPT_DISABLED: - - if (Sel) { - - pItem->pOptType->Flags |= OPTTF_TYPE_DISABLED; - - } else { - - pItem->pOptType->Flags &= ~OPTTF_TYPE_DISABLED; - } - - break; - - case DMPUB_EXT_DISABLED: - - if (Sel) { - - pItem->Flags |= OPTIF_EXT_DISABLED; - - } else { - - pItem->Flags &= ~OPTIF_EXT_DISABLED; - } - - break; - - case DMPUB_TVOPT_ECB_EP: - - switch (Sel) { - - case 0: - - pItem->Flags |= OPTIF_EXT_HIDE; - break; - - case 1: - - pItem->Flags &= ~(OPTIF_EXT_HIDE | - OPTIF_EXT_IS_EXTPUSH); - pItem->pExtChkBox = &TV_ECB; - - break; - - case 2: - - pItem->Flags &= ~OPTIF_EXT_HIDE; - pItem->Flags |= OPTIF_EXT_IS_EXTPUSH; - pItem->pExtPush = &TV_EP; - break; - } - } - } - - pItem->Flags |= OPTIF_CHANGED; - - } while ((pItem++)->DMPubID != DMPUB_CHKBOX); - } - - break; - - default: - - break; - } - - break; - - case CPSUICB_REASON_PUSHBUTTON: - - CPSUIDBG(DBG_TVTESTCB, ("Got PUSH Button CallBack now")); - break; - - case CPSUICB_REASON_EXTPUSH: - - DialogBoxParam(hInstApp, - MAKEINTRESOURCE(EXTPUSH_DLG), - pCPSUICBParam->hDlg, - PushButtonProc, - (LPARAM)(pCPSUICBParam->pOldSel)); - break; - - default: - - break; - } - - return(Action); -} - - - -BOOL -SetupComPropSheetUI( - _In_ PCOMPROPSHEETUI pCPSUI - ) -{ - static BOOL UpdateEditBox = TRUE; - UINT i; - - - ZeroMemory(pCPSUI, sizeof(COMPROPSHEETUI)); - - pCPSUI->cbSize = sizeof(COMPROPSHEETUI); - pCPSUI->hInstCaller = hInstApp; - pCPSUI->pCallerName = (LPTSTR)TitleName; - pCPSUI->CallerVersion = 0x100; - pCPSUI->pOptItemName = (LPTSTR)OptItemName; - pCPSUI->OptItemVersion = 0x400; - pCPSUI->UserData = (ULONG_PTR)pCPSUI; - pCPSUI->pHelpFile = (LPTSTR)TEXT("CPSUISam.hlp"); - pCPSUI->pfnCallBack = TVTestCallBack; - pCPSUI->pOptItem = TVTestOptItems; - pCPSUI->cOptItem = COUNT_ARRAY(TVTestOptItems); - pCPSUI->Flags = 0; - pCPSUI->pDlgPage = CPSUI_PDLGPAGE_TREEVIWONLY; - pCPSUI->cDlgPage = 0; - - - if (UpdateEditBox) { - - // - // Fixup compiler warning for the LPSTR and LONG - // - - for (i = 0; i < COUNT_ARRAY(TVTestOptItems); i++) { - - if (TVTestOptItems[i].DMPubID == DMPUB_EDITBOX) { - - TVTestOptItems[i].pSel = (LPTSTR)TVOTEditBoxBuf; - UpdateEditBox = FALSE; - break; - } - } - } - - if (UpdatePermission) { - - pCPSUI->Flags |= CPSUIF_UPDATE_PERMISSION; - } - - if (!UseStdAbout) { - - pCPSUI->Flags |= CPSUIF_ABOUT_CALLBACK; - } - - return(TRUE); -} diff --git a/print/cpsuisam/CPSUIDAT.H b/print/cpsuisam/CPSUIDAT.H deleted file mode 100644 index 7043d9c2..00000000 --- a/print/cpsuisam/CPSUIDAT.H +++ /dev/null @@ -1,73 +0,0 @@ -/*++ - -Copyright (c) 1990-2003 Microsoft Corporation -All Rights Reserved - - -Module Name: - - cpsuidat.h - - -Abstract: - - This module - - -[Environment:] - - Windows 2000, Windows XP, Windows Server 2003 - Common Printer Driver UI DLL - - ---*/ - - -#define COUNT_ARRAY(a) (sizeof(a) / sizeof((a)[0])) - - -#define OPTIF_NONE 0 - -#define LEVEL_0 0 -#define LEVEL_1 1 -#define LEVEL_2 2 -#define LEVEL_3 3 -#define LEVEL_4 4 - - -#define DMPUB_TVTEST (DMPUB_USER + 1) -#define DMPUB_TVOPT (DMPUB_USER + 2) -#define DMPUB_TVOPT_ECB_EP (DMPUB_USER + 3) -#define DMPUB_TVOPT_ICONS (DMPUB_USER + 4) -#define DMPUB_TVOPT_DISABLED (DMPUB_USER + 5) -#define DMPUB_TVOPT_TEST (DMPUB_USER + 6) -#define DMPUB_2STATES (DMPUB_USER + 7) -#define DMPUB_3STATES (DMPUB_USER + 8) -#define DMPUB_UDARROW (DMPUB_USER + 9) -#define DMPUB_TRACKBAR (DMPUB_USER + 10) -#define DMPUB_SCROLLBAR (DMPUB_USER + 11) -#define DMPUB_LISTBOX (DMPUB_USER + 12) -#define DMPUB_COMBOBOX (DMPUB_USER + 13) -#define DMPUB_EDITBOX (DMPUB_USER + 14) -#define DMPUB_PUSHBUTTON (DMPUB_USER + 15) -#define DMPUB_CHKBOX (DMPUB_USER + 16) -#define DMPUB_CHKBOX_TYPE (DMPUB_USER + 17) -#define DMPUB_TVOPT_OVERLAY_WARNING (DMPUB_USER + 18) -#define DMPUB_TVOPT_OVERLAY_STOP (DMPUB_USER + 19) -#define DMPUB_TVOPT_OVERLAY_NO (DMPUB_USER + 20) -#define DMPUB_EXT_OVERLAY_WARNING (DMPUB_USER + 21) -#define DMPUB_EXT_OVERLAY_STOP (DMPUB_USER + 22) -#define DMPUB_EXT_OVERLAY_NO (DMPUB_USER + 23) -#define DMPUB_EXT_DISABLED (DMPUB_USER + 24) -#define DMPUB_MINRANGE (DMPUB_USER + 25) -#define DMPUB_MAXRANGE (DMPUB_USER + 26) - -#define MAX_INT 0x00007fff -#define MIN_INT 0xFFFF8000 - - - -BOOL -SetupComPropSheetUI -( - _In_ PCOMPROPSHEETUI pCPSUI -); diff --git a/print/cpsuisam/CPSUISAM.DEF b/print/cpsuisam/CPSUISAM.DEF deleted file mode 100644 index f254e960..00000000 --- a/print/cpsuisam/CPSUISAM.DEF +++ /dev/null @@ -1,6 +0,0 @@ -; module-definition file for SurPtrUI -- used by LINK.EXE - -NAME CPSUI ; application's module name - -DESCRIPTION 'Microsoft Windows 2000/Windows XP/Windows Server 2003 Common Property Sheet UI Sample Program' - diff --git a/print/cpsuisam/CPSUISAM.DLG b/print/cpsuisam/CPSUISAM.DLG deleted file mode 100644 index 29112c5d..00000000 --- a/print/cpsuisam/CPSUISAM.DLG +++ /dev/null @@ -1,35 +0,0 @@ -1 DLGINCLUDE "cpsuisam.h" - -PUSHBUTTON_DLG DIALOGEX 9, 18, 160, 100 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Push Button Dialog" -FONT 8, "MS Shell Dlg" -BEGIN - LTEXT "The TVOT_PUSHBUTTON's Button is Pushed. Press OK to Continue...", - -1, 10, 21, 141, 37 - DEFPUSHBUTTON "OK", IDOK, 88, 78, 63, 14 -END - -DLGABOUT DIALOGEX 5, 15, 200, 90 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "About" -FONT 8, "MS Shell Dlg" -BEGIN - LTEXT "About 1 Text", IDD_ABOUT1, 38, 12, 152, 20 - LTEXT "About 2 Text", IDD_ABOUT2, 38, 36, 152, 24 - DEFPUSHBUTTON "OK", IDOK, 126, 68, 59, 14 - ICON IDI_APPLE, IDD_ABOUTICON, 8, 20, 18, 20 -END - -EXTPUSH_DLG DIALOGEX 6, 18, 214, 78 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Extended Push Button DIALOG BOX" -FONT 8, "MS Shell Dlg" -BEGIN - LTEXT "You just push the 'Extended Push Test' push button. To Continue press OK button...", - -1, 12, 10, 187, 30 - DEFPUSHBUTTON "OK", IDOK, 129, 54, 69, 14 -END diff --git a/print/cpsuisam/CPSUISAM.H b/print/cpsuisam/CPSUISAM.H deleted file mode 100644 index bcddc730..00000000 --- a/print/cpsuisam/CPSUISAM.H +++ /dev/null @@ -1,37 +0,0 @@ -/*++ - -Copyright (c) 1990-2003 Microsoft Corporation -All Rights Reserved - - -Module Name: - - cpsuisam.h - - -Abstract: - - This module is the header file for the sample - - -[Environment:] - - ---*/ - - -#define IDM_PERMISSION 10 -#define IDM_USESTDABOUT 20 -#define IDM_DOCPROP 30 -#define IDM_TVTEST 40 -#define IDM_DOCPROP_TVTEST 50 - -#define IDI_CPSUISAMPLE 500 -#define IDI_APPLE 510 - -#define PUSHBUTTON_DLG 1000 -#define DLGABOUT 1010 -#define EXTPUSH_DLG 1020 -#define IDD_ABOUT1 201 -#define IDD_ABOUT2 202 -#define IDD_ABOUTICON 203 diff --git a/print/cpsuisam/DEBUG.C b/print/cpsuisam/DEBUG.C deleted file mode 100644 index 48853686..00000000 --- a/print/cpsuisam/DEBUG.C +++ /dev/null @@ -1,114 +0,0 @@ -/*++ - -Copyright (c) 1990-2003 Microsoft Corporation -All Rights Reserved - -Module Name: - - debug.c - -Abstract: - - This module contains all debugging routines - -[Environment:] - - NT Windows - Common Printer Driver UI DLL. - -[Notes:] - -Revision History: - ---*/ - -#include "precomp.h" -#pragma hdrstop - -#if DBG - -BOOL DoCPSUIWarn = TRUE; - -VOID -cdecl -CPSUIDbgPrint -( - LPCSTR pszFormat, - ... -) -/*++ - -Routine Description: - - This fucntion output the debug informat to the debugger - -Arguments: - - pszFormat - format string - - ... - variable data - -Return Value: - - VOID - ---*/ -{ - va_list vaList; - static TCHAR OutBuf[768]; -#ifdef UNICODE - static WCHAR FormatBuf[256]; -#endif - // - // We assume that UNICODE flag is turn on for the compilation, bug the - // format string passed to here is ASCII version, so we need to convert - // it to LPWSTR before the wvsprintf() - // - - va_start(vaList, pszFormat); - -#ifdef UNICODE - MultiByteToWideChar(CP_ACP, 0, pszFormat, -1, FormatBuf, COUNT_ARRAY(FormatBuf)); - StringCchVPrintf(OutBuf, COUNT_ARRAY(OutBuf), FormatBuf, vaList); -#else - StringCchVPrintf(OutBuf, COUNT_ARRAY(OutBuf), pszFormat, vaList); -#endif - va_end(vaList); - - OutputDebugString((LPTSTR)OutBuf); - OutputDebugString(TEXT("\n")); -} - -VOID -CPSUIDbgType -( - INT Type -) -/*++ - -Routine Description: - - this function output the ERROR/WARNING message - -Arguments: - - Type - -Return Value: - ---*/ -{ - static TCHAR DebugDLLName[] = TEXT("SurPtrUI"); - - if (Type < 0) - { - OutputDebugString(TEXT("ERROR) ")); - } - else if (Type > 0) - { - OutputDebugString(TEXT("WARNING: ")); - } - OutputDebugString(DebugDLLName); - OutputDebugString(TEXT("!")); -} - -#endif // DBG diff --git a/print/cpsuisam/DEBUG.H b/print/cpsuisam/DEBUG.H deleted file mode 100644 index 5d6b88a3..00000000 --- a/print/cpsuisam/DEBUG.H +++ /dev/null @@ -1,66 +0,0 @@ -/*++ - -Copyright (c) 1990-2003 Microsoft Corporation -All Rights Reserved - - -Module Name: - - debug.h - - -Abstract: - - This module contains all debugger definitions - - -[Environment:] - - NT Windows - Common Printer Driver UI DLL. - - ---*/ - - -#if DBG - -VOID -cdecl -CPSUIDbgPrint -( - LPCSTR pszFormat, - ... -); - -VOID -CPSUIDbgType -( - INT Type -); - -extern BOOL DoCPSUIWarn; - -#define DBGP(x) (CPSUIDbgPrint x) - -#define DEFINE_DBGVAR(x) DWORD DBG_CPSUIFILENAME=(x) - -#define CPSUIDBG(x,y) if((x)&DBG_CPSUIFILENAME){CPSUIDbgType(0);DBGP(y);} - -#define CPSUIDBGBLK(x) x; -#define CPSUIWARN(x) if(DoCPSUIWarn) { CPSUIDbgType(1);DBGP(x); } -#define CPSUIERR(x) CPSUIDbgType(-1);DBGP(x) -#define CPSUIRIP(x) CPSUIERR(x); DebugBreak() -#define CPSUIASSERT(b,x,e,i) \ - if (!(e)) { _CPSUIAssert(x,#e,__FILE__,(UINT)__LINE__,(DWORD)i,b); } - -#else // DBG - -#define CPSUIDBGBLK(x) -#define DEFINE_DBGVAR(x) -#define CPSUIDBG(x,y) -#define CPSUIWARN(x) -#define CPSUIERR(x) -#define CPSUIRIP(x) -#define CPSUIASSERT(b,x,e,i) - -#endif // DBG diff --git a/print/cpsuisam/PRECOMP.H b/print/cpsuisam/PRECOMP.H deleted file mode 100644 index 4e63995b..00000000 --- a/print/cpsuisam/PRECOMP.H +++ /dev/null @@ -1,17 +0,0 @@ -// -// Copyright (c) 1990-2003 Microsoft Corporation -// All Rights Reserved -// - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "debug.h" -#include "cpsuisam.h" -#include "cpsuidat.h" diff --git a/print/cpsuisam/README.md b/print/cpsuisam/README.md deleted file mode 100644 index f43a5020..00000000 --- a/print/cpsuisam/README.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -page_type: sample -description: "The CPSUISAM application causes the CPSUI to call the print spooler to create property sheet pages for the default printer." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# Common Property Sheet UI Sample - -The CPSUISAM application causes the Common Property Sheet User Interface (CPSUI) to call the Windows print spooler to create property sheet pages for the system's default printer. - -Printer interface DLLs must not perform this action and this sample shows how create property sheet pages for a printer. - -The application then creates an additional property sheet page to illustrate some of the techniques that you can use when you are using CPSUI to create a new page. - -CPSUI is a user-mode DLL that enables you to create property sheet pages that have a standard appearance. - -CPSUIAM causes CPSUI to call the Windows print spooler to create property sheet pages for the system's default printer. The application then creates an additional property sheet page to illustrate some of the techniques that you can use when you are using CPSUI to create a new page. For more information, see [Common Property Sheet User Interface](https://docs.microsoft.com/windows-hardware/drivers/print/common-property-sheet-user-interface). diff --git a/print/cpsuisam/cpsuisam.c b/print/cpsuisam/cpsuisam.c deleted file mode 100644 index d63b5844..00000000 --- a/print/cpsuisam/cpsuisam.c +++ /dev/null @@ -1,665 +0,0 @@ -/*++ - -Copyright (c) 1990-2003 Microsoft Corporation -All Rights Reserved - - -Module Name: - - cpsuisam.c - - -Abstract: - - This module contrains sample prototype for the - Windows 2000/Windows XP/Windows Server 2003 common Property - Sheet user interface - ---*/ - -#include "precomp.h" -#pragma hdrstop - -#define DBG_CPSUIFILENAME DbgCPSUISam - - - -#define DBG_WINMAINPROC 0x00000001 - -DEFINE_DBGVAR(0); - - - -#define HAS_TVTEST_PAGES 0x01 -#define HAS_DOCPROP_PAGES 0x02 - - - -extern HINSTANCE hInstApp; -extern TCHAR TitleName[]; -extern TCHAR ClassName[]; -extern TCHAR MenuName[]; -extern TCHAR szWinSpool[]; -extern CHAR szDocPropSheets[]; -extern BOOL UpdatePermission; -extern BOOL UseStdAbout; - - -HWND hWndApp = NULL; - - -typedef struct _CPSUISAMPLE -{ - HANDLE hParent; - HANDLE hCPSUI; - HANDLE hDocProp; - PFNCOMPROPSHEET pfnCPS; - COMPROPSHEETUI CPSUI; - DOCUMENTPROPERTYHEADER DPHdr; - HGLOBAL hDevMode; - HGLOBAL hDevNames; -} CPSUISAMPLE, *PCPSUISAMPLE; - -BOOL -GetDefPrinter -( - PCPSUISAMPLE pCPSUISample -) -{ - HGLOBAL hDevMode = NULL; - HGLOBAL hDevNames = NULL; - LPTSTR pszPrinterName = NULL; - DEVMODE *pDM = NULL; - DEVNAMES *pDN = NULL; - HANDLE hPrinter = NULL; - PAGESETUPDLG PSD = {0}; - BOOL Ok = FALSE; - - PSD.lStructSize = sizeof(PSD); - PSD.Flags = PSD_RETURNDEFAULT; - - if (PageSetupDlg(&PSD)) - { - hDevMode = PSD.hDevMode; - - if (NULL != hDevMode) - { - pDM = (DEVMODE *)GlobalLock(hDevMode); - if (NULL != pDM) - { - hDevNames = PSD.hDevNames; - if (hDevNames) - { - pDN = (DEVNAMES *)GlobalLock(hDevNames); - if (NULL != pDN) - { - pszPrinterName = (LPTSTR)pDN + pDN->wDeviceOffset; - if (pszPrinterName != NULL) - { - if (OpenPrinter(pszPrinterName, &hPrinter, NULL)) - { - Ok = TRUE; - } - } - } - } - } - } - - if (Ok) - { - HGLOBAL h = pCPSUISample->hDevMode; - - if (NULL != h) - { - GlobalUnlock(h); - GlobalFree(h); - } - - h = pCPSUISample->hDevNames; - - if (NULL != h) - { - GlobalUnlock(h); - GlobalFree(h); - } - - if (pCPSUISample->DPHdr.hPrinter) - { - ClosePrinter(pCPSUISample->DPHdr.hPrinter); - } - - pCPSUISample->hDevMode = PSD.hDevMode; - pCPSUISample->hDevNames = PSD.hDevNames; - - pCPSUISample->DPHdr.cbSize = sizeof(DOCUMENTPROPERTYHEADER); - pCPSUISample->DPHdr.hPrinter = hPrinter; - pCPSUISample->DPHdr.pszPrinterName = pszPrinterName; - pCPSUISample->DPHdr.pdmIn = - pCPSUISample->DPHdr.pdmOut = pDM; - pCPSUISample->DPHdr.fMode = (DM_IN_BUFFER | DM_IN_PROMPT | DM_OUT_BUFFER); - - if (!UpdatePermission) - { - pCPSUISample->DPHdr.fMode |= DM_NOPERMISSION; - } - } - else - { - hDevMode = PSD.hDevMode; - hDevNames = PSD.hDevNames; - - if (NULL != hDevMode) - { - GlobalUnlock(hDevMode); - GlobalFree(hDevMode); - } - - if (NULL != hDevNames) - { - GlobalUnlock(hDevNames); - GlobalFree(hDevNames); - } - - if (hPrinter) - { - ClosePrinter(hPrinter); - } - } - } - - return Ok; -} - - -LONG -CALLBACK -CPSUIFunc -( - _In_ PPROPSHEETUI_INFO pPSUIInfo, - LPARAM lParam -) -{ - PPROPSHEETUI_INFO_HEADER pPSUIInfoHdr; - PCPSUISAMPLE pCPSUISample; - HANDLE h; - INSERTPSUIPAGE_INFO InsPI; - - if (!pPSUIInfo) - { - return FALSE; - } - - switch (pPSUIInfo->Reason) - { - case PROPSHEETUI_REASON_INIT: - - pCPSUISample = (PCPSUISAMPLE)LocalAlloc(LPTR, sizeof(CPSUISAMPLE)); - if (NULL == pCPSUISample) - { - return(-1); - } - - pPSUIInfo->UserData = (ULONG_PTR)pCPSUISample; - pCPSUISample->hParent = pPSUIInfo->hComPropSheet; - pCPSUISample->pfnCPS = pPSUIInfo->pfnComPropSheet; - - // - // Add Document Property Sheet for current default Printer - // - - switch (pPSUIInfo->lParamInit) - { - case IDM_DOCPROP: - case IDM_DOCPROP_TVTEST: - - if (GetDefPrinter(pCPSUISample)) - { - InsPI.cbSize = sizeof(INSERTPSUIPAGE_INFO); - InsPI.Type = PSUIPAGEINSERT_DLL; - InsPI.Mode = INSPSUIPAGE_MODE_FIRST_CHILD; - InsPI.dwData1 = (ULONG_PTR)szWinSpool; - InsPI.dwData2 = (ULONG_PTR)szDocPropSheets; - InsPI.dwData3 = (ULONG_PTR)&(pCPSUISample->DPHdr); - - pCPSUISample->hDocProp = - (HANDLE)pCPSUISample->pfnCPS( pCPSUISample->hParent, - CPSFUNC_INSERT_PSUIPAGE, - (LPARAM)0, - (LPARAM)&InsPI - ); - } - break; - } - - // - // Add TreeView Page - // - - switch (pPSUIInfo->lParamInit) - { - case IDM_TVTEST: - case IDM_DOCPROP_TVTEST: - - if (SetupComPropSheetUI(&(pCPSUISample->CPSUI))) - { - InsPI.cbSize = sizeof(INSERTPSUIPAGE_INFO); - InsPI.Type = PSUIPAGEINSERT_PCOMPROPSHEETUI; - InsPI.Mode = INSPSUIPAGE_MODE_FIRST_CHILD; - InsPI.dwData1 = (ULONG_PTR)&(pCPSUISample->CPSUI); - InsPI.dwData2 = - InsPI.dwData3 = 0; - - pCPSUISample->hCPSUI = - (HANDLE)pCPSUISample->pfnCPS( pCPSUISample->hParent, - CPSFUNC_INSERT_PSUIPAGE, - (LPARAM)0, - (LPARAM)&InsPI - ); - } - break; - } - - if ( (pCPSUISample->hCPSUI) - || (pCPSUISample->hDocProp) - ) - { - return 1; - } - - break; - - case PROPSHEETUI_REASON_GET_INFO_HEADER: - - pPSUIInfoHdr = (PPROPSHEETUI_INFO_HEADER)lParam; - if (NULL != pPSUIInfoHdr) - { - pPSUIInfoHdr->pTitle = (LPTSTR)TitleName; - - switch (pPSUIInfo->lParamInit) - { - case IDM_DOCPROP: - - pPSUIInfoHdr->IconID = IDI_CPSUI_PRINTER2; - break; - - case IDM_TVTEST: - - pPSUIInfoHdr->IconID = IDI_CPSUI_OPTION2; - break; - - case IDM_DOCPROP_TVTEST: - - pPSUIInfoHdr->IconID = IDI_CPSUI_RUN_DIALOG; - break; - } - - pPSUIInfoHdr->Flags = PSUIHDRF_PROPTITLE | PSUIHDRF_NOAPPLYNOW; - pPSUIInfoHdr->hWndParent = hWndApp; - pPSUIInfoHdr->hInst = hInstApp; - - return 1; - } - - break; - - case PROPSHEETUI_REASON_SET_RESULT: - - pCPSUISample = (PCPSUISAMPLE)pPSUIInfo->UserData; - if ( (NULL != pCPSUISample) - && (pCPSUISample->hCPSUI == ((PSETRESULT_INFO)lParam)->hSetResult) - ) - { - // - // Save the result and propagate to its owner - // - pPSUIInfo->Result = ((PSETRESULT_INFO)lParam)->Result; - return 1; - } - - break; - - case PROPSHEETUI_REASON_DESTROY: - - pCPSUISample = (PCPSUISAMPLE)pPSUIInfo->UserData; - if (NULL != pCPSUISample) - { - h = pCPSUISample->hDevMode; - if (NULL != h) - { - GlobalUnlock(h); - GlobalFree(h); - } - - h = pCPSUISample->hDevNames; - if (NULL != h) - { - GlobalUnlock(h); - GlobalFree(h); - } - - if (pCPSUISample->DPHdr.hPrinter) - { - ClosePrinter(pCPSUISample->DPHdr.hPrinter); - } - - LocalFree((HLOCAL)pCPSUISample); - pPSUIInfo->UserData = 0; - } - return 1; - } - return -1; -} - -LRESULT -CALLBACK -MainWndProc -( - HWND hWnd, - UINT Msg, - WPARAM wParam, - LPARAM lParam -) -/*++ - -Routine Description: - - This is the main window procedure to the testing program - - -Arguments: - - See SDK - - -Return Value: - - See SDK - ---*/ -{ - DWORD Result; - LONG Ret; - - switch (Msg) - { - case WM_INITMENUPOPUP: - - if (!HIWORD(lParam)) - { - CheckMenuItem( (HMENU)UIntToPtr((UINT)wParam), - IDM_PERMISSION, - MF_BYCOMMAND | ((UpdatePermission) ? MF_CHECKED : MF_UNCHECKED) - ); - - CheckMenuItem( (HMENU)UIntToPtr((UINT)wParam), - IDM_USESTDABOUT, - MF_BYCOMMAND | ((UseStdAbout) ? MF_CHECKED : MF_UNCHECKED) - ); - } - break; - - case WM_COMMAND: - - switch (wParam) - { - case IDM_USESTDABOUT: - - UseStdAbout = !UseStdAbout; - break; - - case IDM_PERMISSION: - - UpdatePermission = !UpdatePermission; - break; - - case IDM_DOCPROP: - case IDM_TVTEST: - case IDM_DOCPROP_TVTEST: - - Ret = CommonPropertySheetUI( hWnd, - (PFNPROPSHEETUI)CPSUIFunc, - (LPARAM)LOWORD(wParam), - &Result - ); - - CPSUIDBG( DBG_WINMAINPROC, - ("CommonPropertySheetUI()=%ld, Result=%ld", Ret, Result) - ); - - break; - - default: - - break; - } - break; - - case WM_DESTROY: - - PostQuitMessage(0); - break; - - default: - - return (DefWindowProc(hWnd, Msg, wParam, lParam)); - } - - return 0L; -} - -BOOL -InitInstance -( - HANDLE hInstance, - INT nCmdShow -) -/*++ - -Routine Description: - - Saves instance handle and creates main window - - This function is called at initialization time for every instance of - this application. This function performs initialization tasks that - cannot be shared by multiple instances. - - In this case, we save the instance handle in a static variable and - create and display the main program window. - - -Arguments: - - hInstance - Current instance identifier - - nComShow - Param for first ShowWindow() call. - - - -Return Value: - - TRUE/FALSE - - ---*/ -{ - // - // Save the instance handle in static variable, which will be used in - // many subsequence calls from this application to Windows. - // - - hInstApp = hInstance; - - // - // Create a main window for this application instance. - // - - hWndApp = CreateWindow( ClassName, - TitleName, - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - NULL, - NULL, - hInstance, - NULL - ); - if (NULL != hWndApp) - { - // - // Make the window visible; update its client area; - // and send WM_PAINT message - // - - ShowWindow(hWndApp, nCmdShow); - UpdateWindow(hWndApp); - } - - return ((hWndApp) ? TRUE : FALSE); -} - - -BOOL -InitApplication -( - HANDLE hInstance -) -/*++ - -Routine Description: - - Initializes window data and registers window class - - This function is called at initialization time only if no other - instances of the application are running. This function performs - initialization tasks that can be done once for any number of running - instances. - - In this case, we initialize a window class by filling out a data - structure of type WNDCLASS and calling the Windows RegisterClass() - function. Since all instances of this application use the same window - class, we only need to do this when the first instance is initialized. - - -Arguments: - - hInstance - current instance - - -Return Value: - - BOOLEAN - ---*/ -{ - WNDCLASS wc; - - // - // Fill in window class structure with parameters that describe the - // main window. - // - - wc.style = 0L; - wc.lpfnWndProc = MainWndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_CPSUISAMPLE); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = GetStockObject(WHITE_BRUSH); - wc.lpszMenuName = MenuName; - wc.lpszClassName = ClassName; - - // - // Register the window class and return success/failure code. - // - return RegisterClass(&wc); -} - - -INT -APIENTRY -WinMain -( - _In_ HINSTANCE hInstance, - _In_opt_ HINSTANCE hPrevInstance, - _In_ LPSTR lpCmdLine, - _In_ INT nCmdShow -) -/*++ - -Routine Description: - - calls initialization function, processes message loop - - Windows recognizes this function by name as the initial entry point - for the program. This function calls the application initialization - routine, if no other instance of the program is running, and always - calls the instance initialization routine. It then executes a message - retrieval and dispatch loop that is the top-level control structure - for the remainder of execution. The loop is terminated when a WM_QUIT - message is received, at which time this function exits the application - instance by returning the value passed by PostQuitMessage(). - - If this function must abort before entering the message loop, it - returns the conventional value NULL. - - -Arguments: - - - -Return Value: - - Integer - - ---*/ -{ - MSG Msg; - - UNREFERENCED_PARAMETER(lpCmdLine); - - // - // Other instances of app running? - // - - if (!hPrevInstance) - { - if (!InitApplication(hInstance)) - { - // - // Initialize shared things, Exits if unable to initialize - // - return FALSE; - } - } - - // - // Perform initializations that apply to a specific instance - // - if (!InitInstance(hInstance, nCmdShow)) - { - return FALSE; - } - - // - // Acquire and dispatch messages until a WM_QUIT message is received. - // - while (GetMessage(&Msg, NULL, 0L, 0L)) - { - // - // Translates virtual key codes and Dispatches message to window - // - TranslateMessage(&Msg); - DispatchMessage(&Msg); - } - - // - // Returns the value from PostQuitMessage - // - return((INT)Msg.wParam); -} - diff --git a/print/cpsuisam/cpsuisam.sln b/print/cpsuisam/cpsuisam.sln deleted file mode 100644 index 252f1c33..00000000 --- a/print/cpsuisam/cpsuisam.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 12.0 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpsuisam", "cpsuisam.vcxproj", "{96055373-96CC-491C-916C-0BC49C225094}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {96055373-96CC-491C-916C-0BC49C225094}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {96055373-96CC-491C-916C-0BC49C225094}.Debug|ARM64.Build.0 = Debug|ARM64 - {96055373-96CC-491C-916C-0BC49C225094}.Debug|Win32.ActiveCfg = Debug|Win32 - {96055373-96CC-491C-916C-0BC49C225094}.Debug|Win32.Build.0 = Debug|Win32 - {96055373-96CC-491C-916C-0BC49C225094}.Debug|x64.ActiveCfg = Debug|x64 - {96055373-96CC-491C-916C-0BC49C225094}.Debug|x64.Build.0 = Debug|x64 - {96055373-96CC-491C-916C-0BC49C225094}.Release|ARM64.ActiveCfg = Release|ARM64 - {96055373-96CC-491C-916C-0BC49C225094}.Release|ARM64.Build.0 = Release|ARM64 - {96055373-96CC-491C-916C-0BC49C225094}.Release|Win32.ActiveCfg = Release|Win32 - {96055373-96CC-491C-916C-0BC49C225094}.Release|Win32.Build.0 = Release|Win32 - {96055373-96CC-491C-916C-0BC49C225094}.Release|x64.ActiveCfg = Release|x64 - {96055373-96CC-491C-916C-0BC49C225094}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/print/cpsuisam/cpsuisam.vcxproj b/print/cpsuisam/cpsuisam.vcxproj deleted file mode 100644 index 8315bee6..00000000 --- a/print/cpsuisam/cpsuisam.vcxproj +++ /dev/null @@ -1,352 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - Win32 - - - Release - ARM64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {96055373-96CC-491C-916C-0BC49C225094} - $(MSBuildProjectName) - Debug - Win32 - {2AE5A388-1218-47C7-9334-DCB816C78A26} - - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - Application - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - Application - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - Application - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - Application - - - Windows10 - False - Desktop - - WindowsApplicationForDrivers10.0 - Application - - - Windows10 - True - Desktop - - WindowsApplicationForDrivers10.0 - Application - - - - $(IntDir) - - - - - - - - - - - - - - - - - - - - - - cpsuisam - - - cpsuisam - - - cpsuisam - - - cpsuisam - - - cpsuisam - - - cpsuisam - - - - %(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - - - %(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - - - %(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - - - %(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - - - %(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - - - %(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - %(AdditionalIncludeDirectories);. - - - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - %(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Use - $(IntDir)\precomp.h.pch - - - ;%(AdditionalIncludeDirectories) - precomp.h - Create - $(IntDir)\precomp.h.pch - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/print/cpsuisam/cpsuisam.vcxproj.Filters b/print/cpsuisam/cpsuisam.vcxproj.Filters deleted file mode 100644 index d51cba0d..00000000 --- a/print/cpsuisam/cpsuisam.vcxproj.Filters +++ /dev/null @@ -1,70 +0,0 @@ - - - - - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;* - {52F472A8-2EE4-424B-9AFD-A0F409B178F1} - - - h;hpp;hxx;hm;inl;inc;xsd - {9E6BB288-E0CD-460B-A75D-5C898E94AE2F} - - - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml - {2059241C-22E9-454A-81F8-B21673B3877D} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - - - Header Files - - - - - - Header Files - - - - - - Header Files - - - - - - Header Files - - - - - - - - Resource Files - - - Source Files - - - \ No newline at end of file diff --git a/print/cpsuisam/icons/apple.ico b/print/cpsuisam/icons/apple.ico deleted file mode 100644 index dd2f44f0..00000000 Binary files a/print/cpsuisam/icons/apple.ico and /dev/null differ diff --git a/print/cpsuisam/icons/cpsuisam.ico b/print/cpsuisam/icons/cpsuisam.ico deleted file mode 100644 index 33df6ef4..00000000 Binary files a/print/cpsuisam/icons/cpsuisam.ico and /dev/null differ diff --git a/print/cpsuisam/precompsrc.c b/print/cpsuisam/precompsrc.c deleted file mode 100644 index 5944cf51..00000000 --- a/print/cpsuisam/precompsrc.c +++ /dev/null @@ -1 +0,0 @@ -#include "precomp.h" \ No newline at end of file diff --git a/print/cpsuisam/res.rc b/print/cpsuisam/res.rc deleted file mode 100644 index f1e52605..00000000 --- a/print/cpsuisam/res.rc +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (c) 1990-2003 Microsoft Corporation -// All Rights Reserved -// - - -#include "windows.h" -#include "compstui.h" -#include "cpsuisam.h" - - - - -IDI_APPLE ICON PRELOAD icons\Apple.ico -IDI_CPSUISAMPLE ICON PRELOAD icons\cpsuisam.ico - - - -CPSUISampleMenu MENU -BEGIN - POPUP "&Test Options" - BEGIN - MENUITEM "&Default Printer Properties", IDM_DOCPROP - MENUITEM "CPSUI &TreeView Test", IDM_TVTEST - - MENUITEM SEPARATOR - - MENUITEM "&CPSUI Test All", IDM_DOCPROP_TVTEST - - MENUITEM SEPARATOR - - MENUITEM "&Permission", IDM_PERMISSION - MENUITEM "&Use Standard About" IDM_USESTDABOUT - - - END -END - - -#include "cpsuisam.dlg" - - -#include - -#define VER_FILETYPE VFT_APP -#define VER_FILESUBTYPE VFT2_UNKNOWN -#define VER_FILEDESCRIPTION_STR "Common Property Sheet UI Sample Applet" -#define VER_INTERNALNAME_STR "cpsuisam.exe" -#define VER_ORIGINALFILENAME_STR "cpsuisam.exe" - -#include "common.ver" diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml deleted file mode 100644 index f97fc473..00000000 --- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs deleted file mode 100644 index d37585c4..00000000 --- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs +++ /dev/null @@ -1,146 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// -// Abstract: -// -// This file contains the entry point to the application. - -using System; -using System.Windows; -using System.Runtime; - -using Microsoft.Samples.Printing.PrinterExtension.Types; -using Microsoft.Samples.Printing.PrinterExtension.Helpers; - -using System.Windows.Interop; - -namespace Microsoft.Samples.Printing.PrinterExtension -{ - /// - /// Interaction logic for App.xaml. - /// - public partial class App : Application - { - /// - /// This is the event handler invoked on various driver events. - /// - /// - /// - private static void OnDriverEvent(object sender, PrinterExtensionEventArgs eventArgs) - { - // - // Display the print preferences window. - // - - if (eventArgs.ReasonId.Equals(PrinterExtensionReason.PrintPreferences)) - { - PrintPreferenceWindow printPreferenceWindow = new PrintPreferenceWindow(); - printPreferenceWindow.Initialize(eventArgs); - - // - // Set the caller application's window as parent/owner of the newly created printing preferences window. - // - - WindowInteropHelper wih = new WindowInteropHelper(printPreferenceWindow); - wih.Owner = eventArgs.WindowParent; - - // - // Display a modal/non-modal window based on the 'WindowModal' parameter. - // - - if (eventArgs.WindowModal) - { - printPreferenceWindow.ShowDialog(); - } - else - { - printPreferenceWindow.Show(); - - // Flash the window to draw the user's attention. This is required - // because the printer extension may be drawn behind the parent window. - // The return value of FlashWindow can be safely ignored if there is no need - // to know if the window has focus or not. - WindowHelper.FlashWindow(wih.Handle); - } - } - else if (eventArgs.ReasonId.Equals(PrinterExtensionReason.DriverEvent)) - { - // - // Handle driver events here. - // - } - } - - /// - /// Perform initialization tasks for the printer extension in this event handler. - /// - /// - /// - private void Application_Startup(object sender, StartupEventArgs e) - { - // - // It is recommended that exactly one instance of the PrinterExtensionManager be created per instance of - // the printer extension. - // - - if (manager != null) - { - return; - } - manager = new PrinterExtensionManager(); - - // - // Enable events to be received on one printer driver id. - // - // Note: The order of adding the delegate to PrinterExtensionManager.OnDriverEvent - // and invoking PrinterExtensionManager::EnableEvents is important. - // Adding the delegate should be done first. - // - - manager.OnDriverEvent += OnDriverEvent; - - // - // It is recommended that an instance of a printer extension invoke PrinterExtensionManager::EnableEvents - // for exactly one printer driver id. The printer driver id could come in from a command line argument, - // thereby allowing one application binary to dynamically invoke PrinterExtensionManager::EnableEvents against - // the appropriate printer driver id. - // - - manager.EnableEvents(Guid.Parse(PrinterDriverID)); - } - - /// - /// Perform uninitialization tasks for the printer extension in this event handler. - /// - /// - /// - private void Application_Exit(object sender, ExitEventArgs e) - { - manager.OnDriverEvent -= OnDriverEvent; - manager.DisableEvents(); - - manager = null; - } - - /// - /// This is the printer driver id, as defined in the printer driver manifest file. - /// Please replace this GUID with the printer driver id from your manifest file. - /// - /// It is recommended that you invoke PrinterExtensionManager::EnableEvents() on exactly - /// one printer driver id. The id could come in from a command line argument, thereby enabling - /// one application binary to work with multiple printer driver ids. - /// - private const string PrinterDriverID = "{E0691E8D-F7CC-456E-A7B5-D1FC19BA2279}"; - - /// - /// Instance of the PrinterExtensionManager. It is recommended that you have only instance - /// of the PrinterExtensionManager per application instance. - /// - private static PrinterExtensionManager manager = null; - } -} diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs deleted file mode 100644 index c975ee7c..00000000 --- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs +++ /dev/null @@ -1,154 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// -// Abstract: -// -// This file contains helper methods that provide a data-binding friendly way to access and parse bidi response data. - -using System; -using System.Collections.Generic; -using System.Windows.Media; -using System.Xml; - -namespace Microsoft.Samples.Printing.PrinterExtension.Helpers -{ - /// - /// Provide a data-binding friendly way to access and parse bidi response data. - /// - public class BidiHelper - { - /// - /// Parse the bidi response. - /// - /// Bidi response XML data. - public BidiHelper(string bidiResponse) - { - BidiResponseParser parser = new BidiResponseParser(bidiResponse); - InkLevelC = parser.GetInkLevel(Colors.Cyan); - InkLevelM = parser.GetInkLevel(Colors.Magenta); - InkLevelY = parser.GetInkLevel(Colors.Yellow); - InkLevelK = parser.GetInkLevel(Colors.Black); - } - - /// - /// Get the Cyan ink level. - /// - public double InkLevelC - { - get; - private set; - } - - /// - /// Get the Magenta ink level. - /// - public double InkLevelM - { - get; - private set; - } - - /// - /// Get the Yellow ink level. - /// - public double InkLevelY - { - get; - private set; - } - - /// - /// Get the Black ink level. - /// - public double InkLevelK - { - get; - private set; - } - } - - /// - /// This class parses bidi response xml data and provides wrapper methods that operate upon the xml. - /// - internal class BidiResponseParser - { - /// - /// Parse the bidi response. - /// - /// Bidi response XML data. - internal BidiResponseParser(string bidiResponse) - { - bidiData = new XmlDocument(); - bidiData.LoadXml(bidiResponse); - - namespaceManager = new XmlNamespaceManager(bidiData.NameTable); - namespaceManager.AddNamespace("bidi", "http://schemas.microsoft.com/windows/2005/03/printing/bidi"); - } - - /// - /// Get the ink level for a given color. - /// - /// Color - /// Ink level percentage - internal double GetInkLevel(Color color) - { - XmlElement root = bidiData.DocumentElement; - XmlNode inkNode = root.SelectSingleNode(CreateInkXPathQuery(color), namespaceManager); - return double.Parse(inkNode.FirstChild.Value) / 100; - } - - /// - /// Create an XPath query that retrieves the ink level from a standard bidi response. - /// - /// - /// - private static string CreateInkXPathQuery(Color color) - { - string colorName = null; - - if (color.Equals(Colors.Black)) - { - colorName = "Black"; - } - else if (color.Equals(Colors.Red)) - { - colorName = "Red"; - } - else if (color.Equals(Colors.Green)) - { - colorName = "Green"; - } - else if (color.Equals(Colors.Blue)) - { - colorName = "Blue"; - } - else if (color.Equals(Colors.Cyan)) - { - colorName = "Cyan"; - } - else if (color.Equals(Colors.Magenta)) - { - colorName = "Magenta"; - } - else if (color.Equals(Colors.Yellow)) - { - colorName = "Yellow"; - } - else - { - throw new ArgumentException("Unsupported color"); - } - - return "/bidi:Get/Query/Schema[@name='\\Printer.Consumables." + colorName + "Ink" + ":Level']/BIDI_INT"; - } - - private XmlDocument bidiData; - private XmlNamespaceManager namespaceManager; - } - -} diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png deleted file mode 100644 index 196cd5f6..00000000 Binary files a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png and /dev/null differ diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml deleted file mode 100644 index 924efc21..00000000 --- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -