69 |
2 xpos neg, |
2 xpos neg, |
70 |
4 ypos neg */ |
4 ypos neg */ |
71 |
extern int g_tcp_port_rdp; |
extern int g_tcp_port_rdp; |
72 |
int g_server_depth = 8; |
int g_server_depth = -1; |
73 |
int g_win_button_size = 0; /* If zero, disable single app mode */ |
int g_win_button_size = 0; /* If zero, disable single app mode */ |
74 |
BOOL g_bitmap_compression = True; |
BOOL g_bitmap_compression = True; |
75 |
BOOL g_sendmotion = True; |
BOOL g_sendmotion = True; |
84 |
BOOL g_grab_keyboard = True; |
BOOL g_grab_keyboard = True; |
85 |
BOOL g_hide_decorations = False; |
BOOL g_hide_decorations = False; |
86 |
BOOL g_use_rdp5 = True; |
BOOL g_use_rdp5 = True; |
87 |
|
BOOL g_rdpclip = True; |
88 |
BOOL g_console_session = False; |
BOOL g_console_session = False; |
89 |
BOOL g_numlock_sync = False; |
BOOL g_numlock_sync = False; |
90 |
BOOL lspci_enabled = False; |
BOOL lspci_enabled = False; |
179 |
fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); |
fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); |
180 |
fprintf(stderr, |
fprintf(stderr, |
181 |
" or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n"); |
" or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n"); |
182 |
fprintf(stderr, " '-r sound:[local|off|remote]': enable sound redirection\n"); |
#ifdef WITH_RDPSND |
183 |
|
fprintf(stderr, |
184 |
|
" '-r sound:[local[:driver[:device]]|off|remote]': enable sound redirection\n"); |
185 |
fprintf(stderr, " remote would leave sound on server\n"); |
fprintf(stderr, " remote would leave sound on server\n"); |
186 |
|
fprintf(stderr, " available drivers for 'local':\n"); |
187 |
|
rdpsnd_show_help(); |
188 |
|
#endif |
189 |
|
fprintf(stderr, |
190 |
|
" '-r clipboard:[off|PRIMARYCLIPBOARD|CLIPBOARD]': enable clipboard\n"); |
191 |
|
fprintf(stderr, " redirection.\n"); |
192 |
|
fprintf(stderr, |
193 |
|
" 'PRIMARYCLIPBOARD' looks at both PRIMARY and CLIPBOARD\n"); |
194 |
|
fprintf(stderr, " when sending data to server.\n"); |
195 |
|
fprintf(stderr, " 'CLIPBOARD' looks at only CLIPBOARD.\n"); |
196 |
|
#ifdef WITH_SCARD |
197 |
|
fprintf(stderr, " '-r scard[:\"Scard Name\"=\"Alias Name[;Vendor Name]\"[,...]]\n"); |
198 |
|
fprintf(stderr, " example: -r scard:\"eToken PRO 00 00\"=\"AKS ifdh 0\"\n"); |
199 |
|
fprintf(stderr, |
200 |
|
" \"eToken PRO 00 00\" -> Device in Linux/Unix enviroment\n"); |
201 |
|
fprintf(stderr, |
202 |
|
" \"AKS ifdh 0\" -> Device shown in Windows enviroment \n"); |
203 |
|
fprintf(stderr, " example: -r scard:\"eToken PRO 00 00\"=\"AKS ifdh 0;AKS\"\n"); |
204 |
|
fprintf(stderr, |
205 |
|
" \"eToken PRO 00 00\" -> Device in Linux/Unix enviroment\n"); |
206 |
|
fprintf(stderr, |
207 |
|
" \"AKS ifdh 0\" -> Device shown in Windows enviroment \n"); |
208 |
|
fprintf(stderr, |
209 |
|
" \"AKS\" -> Device vendor name \n"); |
210 |
|
#endif |
211 |
fprintf(stderr, " -0: attach to console\n"); |
fprintf(stderr, " -0: attach to console\n"); |
212 |
fprintf(stderr, " -4: use RDP version 4\n"); |
fprintf(stderr, " -4: use RDP version 4\n"); |
213 |
fprintf(stderr, " -5: use RDP version 5 (default)\n"); |
fprintf(stderr, " -5: use RDP version 5 (default)\n"); |
423 |
BOOL geometry_option = False; |
BOOL geometry_option = False; |
424 |
int run_count = 0; /* Session Directory support */ |
int run_count = 0; /* Session Directory support */ |
425 |
BOOL continue_connect = True; /* Session Directory support */ |
BOOL continue_connect = True; /* Session Directory support */ |
426 |
|
#ifdef WITH_RDPSND |
427 |
|
char *rdpsnd_optarg = NULL; |
428 |
|
#endif |
429 |
|
|
430 |
#ifdef HAVE_LOCALE_H |
#ifdef HAVE_LOCALE_H |
431 |
/* Set locale according to environment */ |
/* Set locale according to environment */ |
678 |
|
|
679 |
if (*optarg == ':') |
if (*optarg == ':') |
680 |
{ |
{ |
681 |
*optarg++; |
optarg++; |
682 |
while ((p = next_arg(optarg, ','))) |
while ((p = next_arg(optarg, ','))) |
683 |
{ |
{ |
684 |
if (str_startswith(optarg, "remote")) |
if (str_startswith(optarg, "remote")) |
686 |
|
|
687 |
if (str_startswith(optarg, "local")) |
if (str_startswith(optarg, "local")) |
688 |
#ifdef WITH_RDPSND |
#ifdef WITH_RDPSND |
689 |
|
{ |
690 |
|
rdpsnd_optarg = |
691 |
|
next_arg(optarg, ':'); |
692 |
g_rdpsnd = True; |
g_rdpsnd = True; |
693 |
|
} |
694 |
|
|
695 |
#else |
#else |
696 |
warning("Not compiled with sound support\n"); |
warning("Not compiled with sound support\n"); |
697 |
#endif |
#endif |
741 |
g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); |
g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); |
742 |
strcpy(g_rdpdr_clientname, optarg + 11); |
strcpy(g_rdpdr_clientname, optarg + 11); |
743 |
} |
} |
744 |
|
else if (str_startswith(optarg, "clipboard")) |
745 |
|
{ |
746 |
|
optarg += 9; |
747 |
|
|
748 |
|
if (*optarg == ':') |
749 |
|
{ |
750 |
|
optarg++; |
751 |
|
|
752 |
|
if (str_startswith(optarg, "off")) |
753 |
|
g_rdpclip = False; |
754 |
|
else |
755 |
|
cliprdr_set_mode(optarg); |
756 |
|
} |
757 |
|
else |
758 |
|
g_rdpclip = True; |
759 |
|
} |
760 |
|
else if (strncmp("scard", optarg, 5) == 0) |
761 |
|
{ |
762 |
|
#ifdef WITH_SCARD |
763 |
|
scard_enum_devices(&g_num_devices, optarg + 5); |
764 |
|
#else |
765 |
|
warning("Not compiled with smartcard support\n"); |
766 |
|
#endif |
767 |
|
} |
768 |
else |
else |
769 |
{ |
{ |
770 |
warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound\n"); |
warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound, clipboard, scard\n"); |
771 |
} |
} |
772 |
break; |
break; |
773 |
|
|
912 |
|
|
913 |
#ifdef WITH_RDPSND |
#ifdef WITH_RDPSND |
914 |
if (g_rdpsnd) |
if (g_rdpsnd) |
915 |
rdpsnd_init(); |
{ |
916 |
|
if (!rdpsnd_init(rdpsnd_optarg)) |
917 |
|
{ |
918 |
|
warning("Initializing sound-support failed!\n"); |
919 |
|
} |
920 |
|
} |
921 |
#endif |
#endif |
922 |
|
|
923 |
if (lspci_enabled) |
if (lspci_enabled) |
1104 |
return mem; |
return mem; |
1105 |
} |
} |
1106 |
|
|
1107 |
|
/* Exit on NULL pointer. Use to verify result from XGetImage etc */ |
1108 |
|
void |
1109 |
|
exit_if_null(void *ptr) |
1110 |
|
{ |
1111 |
|
if (ptr == NULL) |
1112 |
|
{ |
1113 |
|
error("unexpected null pointer. Out of memory?\n"); |
1114 |
|
exit(1); |
1115 |
|
} |
1116 |
|
} |
1117 |
|
|
1118 |
/* strdup */ |
/* strdup */ |
1119 |
char * |
char * |
1120 |
xstrdup(const char *s) |
xstrdup(const char *s) |
1263 |
while (*(mvp + 1) != (char) 0x00) |
while (*(mvp + 1) != (char) 0x00) |
1264 |
{ |
{ |
1265 |
*mvp = *(mvp + 1); |
*mvp = *(mvp + 1); |
1266 |
*mvp++; |
mvp++; |
1267 |
} |
} |
1268 |
*mvp = (char) 0x00; |
*mvp = (char) 0x00; |
1269 |
p = nextval; |
p = nextval; |