From 6d63bda2e74282cc01c8407d8518d15e4e34c55f Mon Sep 17 00:00:00 2001 From: Peter Kallden Date: Thu, 4 Mar 2004 12:43:10 +0000 Subject: [PATCH] leave sound on server -r sound:remote thanks to cbquillen for finding out. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@627 423420c4-83ab-492f-b58f-81f9feb106b5 --- constants.h | 13 +++++++------ doc/rdesktop.1 | 2 +- rdesktop.c | 26 ++++++++++++++++++++++---- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/constants.h b/constants.h index db03f9d..3821443 100644 --- a/constants.h +++ b/constants.h @@ -12,7 +12,7 @@ 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -237,10 +237,11 @@ enum RDP_INPUT_DEVICE #define RDP_SOURCE "MSTSC" /* Logon flags */ -#define RDP_LOGON_NORMAL 0x33 -#define RDP_LOGON_AUTO 0x8 -#define RDP_LOGON_BLOB 0x100 -#define RDP_COMPRESSION 0x80 +#define RDP_LOGON_AUTO 0x0008 +#define RDP_LOGON_NORMAL 0x0033 +#define RDP_COMPRESSION 0x0080 +#define RDP_LOGON_BLOB 0x0100 +#define RDP_LOGON_LEAVE_AUDIO 0x2000 /* Keymap flags */ #define MapRightShiftMask (1<<0) @@ -328,12 +329,12 @@ enum RDP_INPUT_DEVICE #define STATUS_NO_SUCH_FILE 0xc000000f #define STATUS_INVALID_DEVICE_REQUEST 0xc0000010 #define STATUS_ACCESS_DENIED 0xc0000022 +#define STATUS_OBJECT_NAME_COLLISION 0xc0000035 #define STATUS_DISK_FULL 0xc000007f #define STATUS_FILE_IS_A_DIRECTORY 0xc00000ba #define STATUS_NOT_SUPPORTED 0xc00000bb #define STATUS_TIMEOUT 0xc0000102 #define STATUS_CANCELLED 0xc0000120 -#define STATUS_OBJECT_NAME_COLLISION 0xc0000035 /* RDPDR constants */ diff --git a/doc/rdesktop.1 b/doc/rdesktop.1 index 0c33f79..e042a37 100644 --- a/doc/rdesktop.1 +++ b/doc/rdesktop.1 @@ -135,7 +135,7 @@ simple PS-driver unless you specify one. Keep in mind that you need a 100% match in the server environment, or the driver will fail. The first printer on the command line will be set as your default printer. .TP -.BR "-r sound" +.BR "-r sound:[on|off|remote]" Redirects sound generated on the server to the client ( Requires Windows XP or newer). .TP diff --git a/rdesktop.c b/rdesktop.c index 0a6a5db..dd629ca 100644 --- a/rdesktop.c +++ b/rdesktop.c @@ -131,8 +131,9 @@ usage(char *program) fprintf(stderr, " or LPT1=/dev/lp0,LPT2=/dev/lp1\n"); fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); fprintf(stderr, - " or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n"); - fprintf(stderr, " '-r sound': enable sound redirection\n"); + " or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n"); + fprintf(stderr, " '-r sound:[on|off|remote]': enable sound redirection\n"); + fprintf(stderr, " remote would leave sound on server\n"); fprintf(stderr, " -0: attach to console\n"); fprintf(stderr, " -4: use RDP version 4\n"); fprintf(stderr, " -5: use RDP version 5 (default)\n"); @@ -414,11 +415,28 @@ main(int argc, char *argv[]) if (strncmp("sound", optarg, 5) == 0) { + if (*(optarg + 6) == ':') + { + + if (strncmp("remote", optarg + 7, 6) == 0) + flags |= RDP_LOGON_LEAVE_AUDIO; + else if (strncmp("on", optarg + 7, 2) == 0) + { #ifdef WITH_RDPSND - g_rdpsnd = True; + g_rdpsnd = True; #else - warning("Not compiled with sound support"); + warning("Not compiled with sound support"); #endif + } + } + else + { +#ifdef WITH_RDPSND + g_rdpsnd = True; +#else + warning("Not compiled with sound support"); +#endif + } } else if (strncmp("disk", optarg, 4) == 0) {