FreeRDP
printer_main.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/stream.h>
#include <winpr/interlocked.h>
#include <winpr/path.h>
#include <freerdp/channels/rdpdr.h>
#include <freerdp/crypto/crypto.h>
#include "../printer.h"
#include <freerdp/client/printer.h>
#include <freerdp/channels/log.h>

Macros

#define TAG   CHANNELS_TAG("printer.client")
 

Enumerations

enum  prn_conf_t { PRN_CONF_PORT = 0, PRN_CONF_PNP = 1, PRN_CONF_DRIVER = 2, PRN_CONF_DATA = 3 }
 

Functions

static char * get_printer_config_path (const rdpSettings *settings, const WCHAR *name, size_t length)
 
static BOOL printer_write_setting (const char *path, prn_conf_t type, const void *data, size_t length)
 
static BOOL printer_config_valid (const char *path)
 
static BOOL printer_read_setting (const char *path, prn_conf_t type, void **data, UINT32 *length)
 
static BOOL printer_save_to_config (const rdpSettings *settings, const char *PortDosName, size_t PortDosNameLen, const WCHAR *PnPName, size_t PnPNameLen, const WCHAR *DriverName, size_t DriverNameLen, const WCHAR *PrinterName, size_t PrintNameLen, const BYTE *CachedPrinterConfigData, size_t CacheFieldsLen)
 
static BOOL printer_update_to_config (const rdpSettings *settings, const WCHAR *name, size_t length, const BYTE *data, size_t datalen)
 
static BOOL printer_remove_config (const rdpSettings *settings, const WCHAR *name, size_t length)
 
static BOOL printer_move_config (const rdpSettings *settings, const WCHAR *oldName, size_t oldLength, const WCHAR *newName, size_t newLength)
 
static BOOL printer_load_from_config (const rdpSettings *settings, rdpPrinter *printer, PRINTER_DEVICE *printer_dev)
 
static BOOL printer_save_default_config (const rdpSettings *settings, rdpPrinter *printer)
 
static UINT printer_process_irp_create (PRINTER_DEVICE *printer_dev, IRP *irp)
 
static UINT printer_process_irp_close (PRINTER_DEVICE *printer_dev, IRP *irp)
 
static UINT printer_process_irp_write (PRINTER_DEVICE *printer_dev, IRP *irp)
 
static UINT printer_process_irp_device_control (PRINTER_DEVICE *printer_dev, IRP *irp)
 
static UINT printer_process_irp (PRINTER_DEVICE *printer_dev, IRP *irp)
 
static DWORD WINAPI printer_thread_func (LPVOID arg)
 
static UINT printer_irp_request (DEVICE *device, IRP *irp)
 
static UINT printer_custom_component (DEVICE *device, UINT16 component, UINT16 packetId, wStream *s)
 
static UINT printer_free (DEVICE *device)
 
static UINT printer_register (PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinter *printer)
 
static rdpPrinterDriver * printer_load_backend (const char *backend)
 
UINT FREERDP_API DeviceServiceEntry (PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
 

Variables

static const char * filemap []
 

Macro Definition Documentation

#define TAG   CHANNELS_TAG("printer.client")

FreeRDP: A Remote Desktop Protocol Implementation Print Virtual Channel

Copyright 2010-2011 Vic Lee Copyright 2015 Thincast Technologies GmbH Copyright 2015 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com Copyright 2016 Armin Novak armin.nosp@m..nov.nosp@m.ak@gm.nosp@m.ail..nosp@m.com Copyright 2016 David PHAM-VAN d.pha.nosp@m.mvan.nosp@m.@inuv.nosp@m.ika..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Enumeration Type Documentation

enum prn_conf_t
Enumerator
PRN_CONF_PORT 
PRN_CONF_PNP 
PRN_CONF_DRIVER 
PRN_CONF_DATA 

Function Documentation

UINT FREERDP_API DeviceServiceEntry ( PDEVICE_SERVICE_ENTRY_POINTS  pEntryPoints)

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static char* get_printer_config_path ( const rdpSettings *  settings,
const WCHAR *  name,
size_t  length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_config_valid ( const char *  path)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_custom_component ( DEVICE *  device,
UINT16  component,
UINT16  packetId,
wStream *  s 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_free ( DEVICE *  device)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_irp_request ( DEVICE *  device,
IRP *  irp 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static rdpPrinterDriver* printer_load_backend ( const char *  backend)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_load_from_config ( const rdpSettings *  settings,
rdpPrinter *  printer,
PRINTER_DEVICE *  printer_dev 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_move_config ( const rdpSettings *  settings,
const WCHAR *  oldName,
size_t  oldLength,
const WCHAR *  newName,
size_t  newLength 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_process_irp ( PRINTER_DEVICE *  printer_dev,
IRP *  irp 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_process_irp_close ( PRINTER_DEVICE *  printer_dev,
IRP *  irp 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_process_irp_create ( PRINTER_DEVICE *  printer_dev,
IRP *  irp 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_process_irp_device_control ( PRINTER_DEVICE *  printer_dev,
IRP *  irp 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_process_irp_write ( PRINTER_DEVICE *  printer_dev,
IRP *  irp 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_read_setting ( const char *  path,
prn_conf_t  type,
void **  data,
UINT32 length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT printer_register ( PDEVICE_SERVICE_ENTRY_POINTS  pEntryPoints,
rdpPrinter *  printer 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_remove_config ( const rdpSettings *  settings,
const WCHAR *  name,
size_t  length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_save_default_config ( const rdpSettings *  settings,
rdpPrinter *  printer 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_save_to_config ( const rdpSettings *  settings,
const char *  PortDosName,
size_t  PortDosNameLen,
const WCHAR *  PnPName,
size_t  PnPNameLen,
const WCHAR *  DriverName,
size_t  DriverNameLen,
const WCHAR *  PrinterName,
size_t  PrintNameLen,
const BYTE CachedPrinterConfigData,
size_t  CacheFieldsLen 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD WINAPI printer_thread_func ( LPVOID  arg)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_update_to_config ( const rdpSettings *  settings,
const WCHAR *  name,
size_t  length,
const BYTE data,
size_t  datalen 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL printer_write_setting ( const char *  path,
prn_conf_t  type,
const void data,
size_t  length 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char* filemap[]
static
Initial value:
=
{
"PortDosName",
"PnPName",
"DriverName",
"CachedPrinterConfigData"
}