Common/devmode.cpp File Reference

Implementation of Devmode functions shared with OEM UI and OEM rendering modules. Based on: Devmode.cpp Printer Driver Plugin Sample by Microsoft Corporation. More...

#include "precomp.h"
#include "debug.h"
#include "devmode.h"
#include "CCCommon.h"
#include "CCPrintLicenseInfo.h"
#include "CCPrintRegistry.h"
#include "Helpers.h"
Include dependency graph for devmode.cpp:

Go to the source code of this file.

Functions

void InitToDefault (POEMDEV pOEMDevOut, HANDLE hPrinter)
HRESULT hrOEMDevMode (DWORD dwMode, POEMDMPARAM pOemDMParam)
 Handler for plugin data structure creation and initialization.
BOOL ConvertOEMDevmode (PCOEMDEV pOEMDevIn, POEMDEV pOEMDevOut, HANDLE hPrinter)
 Handler for copy/initialization of plugin data.
BOOL MakeOEMDevmodeValid (POEMDEV pOEMDevmode)
 Handler for validation of plugin data.
void Dump (PCOEMDEV pOEMDevmode)
 This function dumps the plugin data structure for testing purpuses.
void ReadOEMDevFromRegistry (POEMDEV pDev, HANDLE hPrinter)
 Reads the plugin data from the registry.
bool WriteOEMDevToRegistry (const POEMDEV pDev, HANDLE hPrinter)
 Writes the plugin data to the registry.

Detailed Description

Implementation of Devmode functions shared with OEM UI and OEM rendering modules. Based on: Devmode.cpp Printer Driver Plugin Sample by Microsoft Corporation.

Definition in file devmode.cpp.


Function Documentation

BOOL ConvertOEMDevmode ( PCOEMDEV  pOEMDevIn,
POEMDEV  pOEMDevOut,
HANDLE  hPrinter 
)

Handler for copy/initialization of plugin data.

Parameters:
pOEMDevIn Pointer to the structure to read data from
pOEMDevOut Pointer to the structure to write data into
hPrinter Handle to the printer
Returns:
TRUE if all went well, FALSE if there's a problem

Definition at line 251 of file devmode.cpp.

References tagOEMDEV::dmOEMExtra, and InitToDefault().

Referenced by hrOEMDevMode().

void Dump ( PCOEMDEV  pOEMDevmode  ) 

This function dumps the plugin data structure for testing purpuses.

Parameters:
pOEMDevmode Pointer to the printer data structure to dump

Definition at line 347 of file devmode.cpp.

References tagOEMDEV::bAutoOpen, tagOEMDEV::bAutoURLs, tagOEMDEV::bSetProperties, CCPRINT_SIGNATURE, tagOEMDEV::cFilename, tagOEMDEV::dmOEMExtra, LicenseLocationInfo::eFirstPage, LicenseLocationInfo::eOtherPages, tagOEMDEV::info, tagOEMDEV::location, and LicenseInfo::m_eLicense.

HRESULT hrOEMDevMode ( DWORD  dwMode,
POEMDMPARAM  pOemDMParam 
)

Handler for plugin data structure creation and initialization.

Parameters:
dwMode Initialization mode information (see IPrintOemPS::DevMode function in the DDK)
pOemDMParam Pointer to an OEMDMPARAM structure containing printer data
Returns:
S_OK if successful, E_FAIL if failed

Definition at line 184 of file devmode.cpp.

References ConvertOEMDevmode(), InitToDefault(), and MakeOEMDevmodeValid().

void InitToDefault ( POEMDEV  pOEMDevOut,
HANDLE  hPrinter 
)
Parameters:
pOEMDevOut Pointer to the structure to write data into
hPrinter Handle to the printer

Definition at line 170 of file devmode.cpp.

References CCPRINT_SIGNATURE, tagOEMDEV::cFilename, tagOEMDEV::dmOEMExtra, and ReadOEMDevFromRegistry().

Referenced by ConvertOEMDevmode(), and hrOEMDevMode().

BOOL MakeOEMDevmodeValid ( POEMDEV  pOEMDevmode  ) 

Handler for validation of plugin data.

Parameters:
pOEMDevmode Pointer to the printer data structure to initialize
Returns:
TRUE if initialized successfully, FALSE if failed

Definition at line 317 of file devmode.cpp.

References CCPRINT_SIGNATURE, tagOEMDEV::cFilename, and tagOEMDEV::dmOEMExtra.

Referenced by hrOEMDevMode().

void ReadOEMDevFromRegistry ( POEMDEV  pDev,
HANDLE  hPrinter 
)

Reads the plugin data from the registry.

Parameters:
pDev Pointer to the plugin data
hPrinter Handle to the printer

Definition at line 380 of file devmode.cpp.

References tagOEMDEV::bAutoOpen, tagOEMDEV::bAutoURLs, tagOEMDEV::bCreateAsTemp, tagOEMDEV::bSetProperties, CanOpenPDFFiles(), CCPrintRegistry::GetRegistryBool(), tagOEMDEV::info, tagOEMDEV::location, CCPrintLicenseInfo::ReadFromRegistry(), and SETTINGS_AUTOOPEN.

Referenced by InitToDefault().

bool WriteOEMDevToRegistry ( const POEMDEV  pDev,
HANDLE  hPrinter 
)

Writes the plugin data to the registry.

Parameters:
pDev Pointer to the plugin data
hPrinter Handle to the printer
Returns:
true if written successfully, false if failed

Definition at line 398 of file devmode.cpp.

References tagOEMDEV::bAutoOpen, tagOEMDEV::bAutoURLs, tagOEMDEV::bCreateAsTemp, tagOEMDEV::bSetProperties, tagOEMDEV::info, tagOEMDEV::location, CCPrintRegistry::SetRegistryBool(), SETTINGS_AUTOOPEN, and CCPrintLicenseInfo::WriteToRegistry().

Referenced by hrOEMDocumentPropertySheets(), and OEMDocUICallBack().


Generated on Mon Jun 18 12:40:25 2012 for CC PDF Converter by doxygen 1.6.1