printercache.c revision a180a41bba1d50822df23fff0099e90b86638b89
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
Entrypoint and utility functions
Copyright (C) Matthew Chapman <matthewc.unsw.edu.au> 1999-2008
Copyright (C) Jeroen Meijer <jeroen@oldambt7.com> 2003-2008
Copyright (C) Henrik Andersson <hean01@cendio.com> 2013
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* According to the W2K RDP Printer Redirection WhitePaper, a data
* blob is sent to the client after the configuration of the printer
* is changed at the server.
*
* This data blob is saved to the registry. The client returns this
* data blob in a new session with the printer announce data.
* The data is not interpreted by the client.
*/
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include "rdesktop.h"
static RD_BOOL
{
char *path;
{
return False;
}
{
return False;
}
{
return False;
}
return True;
}
static RD_BOOL
printercache_unlink_blob(char *printer)
{
char *path;
char *home;
return False;
return False;
sizeof("/AutoPrinterCacheData") + 1);
{
return False;
}
{
return False;
}
return True;
}
static RD_BOOL
{
char *printer_path;
char *new_printer_path;
int printer_maxlen;
char *home;
return False;
return False;
{
return False;
}
return True;
}
int
{
if (printer_name == NULL)
return 0;
return 0;
sizeof("/AutoPrinterCacheData") + 1);
if (fd == -1)
{
return 0;
}
{
return 0;
}
return length;
}
static void
{
int fd;
if (printer_name == NULL)
return;
return;
return;
sizeof("/AutoPrinterCacheData") + 1);
if (fd == -1)
{
return;
}
{
}
}
void
{
in_uint32_le(s, type);
switch (type)
{
case 4: /* rename item */
in_uint8(s, printer_length);
in_uint8(s, driver_length);
/* NOTE - 'driver' doesn't contain driver, it contains the new printer name */
break;
case 3: /* delete item */
if (printer)
break;
case 2: /* save printer data */
in_uint32_le(s, blob_length);
{
if (printer)
}
break;
case 1: /* save device data */
/* need to fetch this data so that we can get the length of the packet to store. */
/* next is driver in unicode */
/* next is printer in unicode */
/* TODO: figure out how to use this information when reconnecting */
/* actually - all we need to store is the driver and printer */
/* and figure out what the first word is. */
/* rewind stream so that we can save this blob */
/* length is driver_length + printer_length + 19 */
/* rewind stream */
s->p = s->p - 19;
break;
default:
break;
}
}