This section describes how to write rendering plug-ins.
This plug-in is a COM component and needs to provide the system with a COM component of ipr1_emuni2 interface.
The important functions are:
1. enabledriver
2. disabledriver
Register an array of function pointers in enabledriver. These functions are used to hook the corresponding DDI Interpretation Section. In this way, the default universal printer driver behavior can be changed.
3.
Enablepdev creates a Data Structure customized by the printer vendor, and then initializes the data structure.
4.
Disablepdev is responsible for recycling the memory occupied by this data structure.
Important Data Structure
Typedef struct _ javasbj {
DWORD dwsize; // the size of the Data Structure
P0000em p0000em; // pointer to the custom OEM Data Structure
Handle hengine; // handle of the physical device
Handle hprinter; // printer handle
Handle hoem;
Pdevmode ppublicdm;
Pvoid poemdm;
Pdrvprocs;
} Mongobj;
5.
The getinfo function is used to obtain some printer information.
6. publishdriverinterface
This function can be used to obtain
Iprintoemdriveruni interface pointer, which is very useful and can call some functions provided by the universal printer driver.
For example, output a command to the printer, drvwritespoolbuf.