## Printer Device Driver

[prev][next][parent][TOC]

### Device Handle Section

The device handle is a data structure that is unique to a specific plug-in module. A pointer to this data area can be given to the core Omni driver, and this sample pointer will be passed as an input parameter to all functions the plug-in module will subclass. This is an efficient place to put state data and variables that are re-used by the plug-in module while rendering a print job.

It is standard practice to put the count of bytes for the entire structure in the first field of the structure, and a 4 character signature that uniquely identifies the structure in the second field of the structure, as follows:

     #define SAMPLE_SIG   0x5350434C      // 'SAMP'

     typedef struct _SampleHandle {
        ULONG         cb;        // Count of bytes
        ULONG         ulSig;     // Signature
        // Place more variables here as desired
     } SAMPHANDLE, *PSAMPHANDLE;