if (count < 3)
return -1;
+ settings->RedirectDrives = TRUE;
+ settings->DeviceRedirection = TRUE;
+
drive = (RDPDR_DRIVE*) calloc(1, sizeof(RDPDR_DRIVE));
if (!drive)
drive->Path = _strdup(params[2]);
freerdp_device_collection_add(settings, (RDPDR_DEVICE*) drive);
- settings->DeviceRedirection = TRUE;
return 1;
}
if (count < 1)
return -1;
- printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER));
+ settings->RedirectPrinters = TRUE;
+ settings->DeviceRedirection = TRUE;
- if (!printer)
- return -1;
+ if (count > 1)
+ {
+ printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER));
- printer->Type = RDPDR_DTYP_PRINT;
+ if (!printer)
+ return -1;
- if (count > 1)
- printer->Name = _strdup(params[1]);
+ printer->Type = RDPDR_DTYP_PRINT;
- if (count > 2)
- printer->DriverName = _strdup(params[2]);
+ if (count > 1)
+ printer->Name = _strdup(params[1]);
- freerdp_device_collection_add(settings, (RDPDR_DEVICE*) printer);
- settings->DeviceRedirection = TRUE;
+ if (count > 2)
+ printer->DriverName = _strdup(params[2]);
+
+ freerdp_device_collection_add(settings, (RDPDR_DEVICE*) printer);
+ }
return 1;
}
if (count < 1)
return -1;
- smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD));
+ settings->RedirectSmartCards = TRUE;
+ settings->DeviceRedirection = TRUE;
- if (!smartcard)
- return -1;
+ if (count > 1)
+ {
+ smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD));
- smartcard->Type = RDPDR_DTYP_SMARTCARD;
+ if (!smartcard)
+ return -1;
- if (count > 1)
- smartcard->Name = _strdup(params[1]);
+ smartcard->Type = RDPDR_DTYP_SMARTCARD;
- if (count > 2)
- smartcard->Path = _strdup(params[2]);
+ if (count > 1)
+ smartcard->Name = _strdup(params[1]);
- freerdp_device_collection_add(settings, (RDPDR_DEVICE*) smartcard);
- settings->DeviceRedirection = TRUE;
+ if (count > 2)
+ smartcard->Path = _strdup(params[2]);
+
+ freerdp_device_collection_add(settings, (RDPDR_DEVICE*) smartcard);
+ }
return 1;
}
if (count < 1)
return -1;
+ settings->RedirectSerialPorts = TRUE;
+ settings->DeviceRedirection = TRUE;
+
serial = (RDPDR_SERIAL*) calloc(1, sizeof(RDPDR_SERIAL));
if (!serial)
serial->Path = _strdup(params[2]);
freerdp_device_collection_add(settings, (RDPDR_DEVICE*) serial);
- settings->DeviceRedirection = TRUE;
return 1;
}
if (count < 1)
return -1;
+ settings->RedirectParallelPorts = TRUE;
+ settings->DeviceRedirection = TRUE;
+
parallel = (RDPDR_PARALLEL*) calloc(1, sizeof(RDPDR_PARALLEL));
if (!parallel)
parallel->Path = _strdup(params[2]);
freerdp_device_collection_add(settings, (RDPDR_DEVICE*) parallel);
- settings->DeviceRedirection = TRUE;
return 1;
}
settings->SupportHeartbeatPdu ||
settings->SupportMultitransport)
{
- settings->DeviceRedirection = TRUE; /* these RDP 8 features require rdpdr to be registered */
+ settings->DeviceRedirection = TRUE; /* these RDP8 features require rdpdr to be registered */
}
- if (settings->RedirectDrives)
+ if (settings->RedirectDrives || settings->RedirectHomeDrive || settings->RedirectSerialPorts
+ || settings->RedirectSmartCards || settings->RedirectPrinters)
{
- settings->DeviceRedirection = TRUE;
+ settings->DeviceRedirection = TRUE; /* All of these features require rdpdr */
+ }
+ if (settings->RedirectDrives)
+ {
if (!freerdp_device_collection_find(settings, "drive"))
{
char* params[3];
if (settings->RedirectHomeDrive)
{
- settings->DeviceRedirection = TRUE;
-
if (!freerdp_device_collection_find(settings, "drive"))
{
char* params[3];
}
}
+ if (settings->RedirectSmartCards)
+ {
+ RDPDR_SMARTCARD* smartcard;
+
+ smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD));
+
+ if (!smartcard)
+ return -1;
+
+ smartcard->Type = RDPDR_DTYP_SMARTCARD;
+ freerdp_device_collection_add(settings, (RDPDR_DEVICE*) smartcard);
+ }
+
+ if (settings->RedirectPrinters)
+ {
+ RDPDR_PRINTER* printer;
+
+ printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER));
+
+ if (!printer)
+ return -1;
+
+ printer->Type = RDPDR_DTYP_PRINT;
+ freerdp_device_collection_add(settings, (RDPDR_DEVICE*) printer);
+ }
+
if (settings->RedirectClipboard)
{
if (!freerdp_static_channel_collection_find(settings, "cliprdr"))