diff options
| -rw-r--r-- | common/os_calls.c | 18 | ||||
| -rw-r--r-- | common/os_calls.h | 6 | ||||
| -rw-r--r-- | configure.ac | 11 | ||||
| -rw-r--r-- | sesman/chansrv/Makefile.am | 5 | ||||
| -rw-r--r-- | sesman/chansrv/chansrv_fuse.c | 5 | ||||
| -rw-r--r-- | sesman/chansrv/clipboard_file.c | 6 | ||||
| -rw-r--r-- | sesman/chansrv/sound.c | 219 | ||||
| -rw-r--r-- | sesman/chansrv/wave-format-server.txt | 467 | ||||
| -rw-r--r-- | sesman/env.c | 49 | ||||
| -rw-r--r-- | sesman/env.h | 2 | ||||
| -rw-r--r-- | sesman/session.c | 51 | ||||
| -rw-r--r-- | xorg/X11R7.6/rdp/rdprandr.c | 2 | ||||
| -rw-r--r-- | xorg/X11R7.6/xkeyboard-config-2.0.patch | 88 | ||||
| -rw-r--r-- | xrdp/xrdp_keyboard.ini | 2 |
14 files changed, 855 insertions, 76 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 6ad7a78d..234e01c7 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -207,14 +207,17 @@ g_sprintf(char *dest, const char *format, ...) } /*****************************************************************************/ -void DEFAULT_CC +int DEFAULT_CC g_snprintf(char *dest, int len, const char *format, ...) { + int err; va_list ap; va_start(ap, format); - vsnprintf(dest, len, format, ap); + err = vsnprintf(dest, len, format, ap); va_end(ap); + + return err; } /*****************************************************************************/ @@ -2993,10 +2996,11 @@ g_sigterm(int pid) /*****************************************************************************/ /* returns 0 if ok */ +/* the caller is responsible to free the buffs */ /* does not work in win32 */ int APP_CC -g_getuser_info(const char *username, int *gid, int *uid, char *shell, - char *dir, char *gecos) +g_getuser_info(const char *username, int *gid, int *uid, char **shell, + char **dir, char **gecos) { #if defined(_WIN32) return 1; @@ -3019,17 +3023,17 @@ g_getuser_info(const char *username, int *gid, int *uid, char *shell, if (dir != 0) { - g_strcpy(dir, pwd_1->pw_dir); + *dir = g_strdup(pwd_1->pw_dir); } if (shell != 0) { - g_strcpy(shell, pwd_1->pw_shell); + *shell = g_strdup(pwd_1->pw_shell); } if (gecos != 0) { - g_strcpy(gecos, pwd_1->pw_gecos); + *gecos = g_strdup(pwd_1->pw_gecos); } return 0; diff --git a/common/os_calls.h b/common/os_calls.h index a843b2e7..c103e144 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -51,7 +51,7 @@ void APP_CC g_free(void* ptr); void DEFAULT_CC g_printf(const char *format, ...) printflike(1, 2); void DEFAULT_CC g_sprintf(char* dest, const char* format, ...) \ printflike(2, 3); -void DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...) \ +int DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...) \ printflike(3, 4); void DEFAULT_CC g_writeln(const char* format, ...) printflike(1, 2); void DEFAULT_CC g_write(const char* format, ...) printflike(1, 2); @@ -169,8 +169,8 @@ char* APP_CC g_getenv(const char* name); int APP_CC g_exit(int exit_code); int APP_CC g_getpid(void); int APP_CC g_sigterm(int pid); -int APP_CC g_getuser_info(const char* username, int* gid, int* uid, char* shell, - char* dir, char* gecos); +int APP_CC g_getuser_info(const char* username, int* gid, int* uid, char** shell, + char** dir, char** gecos); int APP_CC g_getgroup_info(const char* groupname, int* gid); int APP_CC g_check_user_in_group(const char* username, int gid, int* ok); int APP_CC g_time1(void); diff --git a/configure.ac b/configure.ac index 63a82d57..5dee6d52 100644 --- a/configure.ac +++ b/configure.ac @@ -108,6 +108,10 @@ AC_ARG_ENABLE(opus, AS_HELP_STRING([--enable-opus], [Build opus(audio codec) (default: no)]), [], [enable_opus=no]) AM_CONDITIONAL(XRDP_OPUS, [test x$enable_opus = xyes]) +AC_ARG_ENABLE(mp3lame, AS_HELP_STRING([--enable-mp3lame], + [Build lame mp3(audio codec) (default: no)]), + [], [enable_mp3lame=no]) +AM_CONDITIONAL(XRDP_MP3LAME, [test x$enable_mp3lame = xyes]) # checking for openssl AC_CHECK_HEADER([openssl/rc4.h], [], @@ -180,6 +184,13 @@ then [AC_MSG_ERROR([please install libopus-dev or opus-devel])]) fi +# checking for lame mp3 +if test "x$enable_mp3lame" = "xyes" +then + AC_CHECK_HEADER([lame/lame.h], [], + [AC_MSG_ERROR([please install libmp3lame-dev or lamemp3-devel])]) +fi + # checking for TurboJPEG if test "x$enable_tjpeg" = "xyes" then diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am index 45597e12..c4cd1a3f 100644 --- a/sesman/chansrv/Makefile.am +++ b/sesman/chansrv/Makefile.am @@ -13,6 +13,11 @@ EXTRA_DEFINES += -DXRDP_OPUS EXTRA_LIBS += -lopus endif +if XRDP_MP3LAME +EXTRA_DEFINES += -DXRDP_MP3LAME +EXTRA_LIBS += -lmp3lame +endif + AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c index 143b7d6c..6e0583bd 100644 --- a/sesman/chansrv/chansrv_fuse.c +++ b/sesman/chansrv/chansrv_fuse.c @@ -780,6 +780,11 @@ int xfuse_add_clip_dir_item(char *filename, int flags, int size, int lindex) 2, /* parent inode */ filename, S_IFREG); + if (xinode == NULL) + { + log_debug("failed to create file in xrdp filesystem"); + return -1; + } xinode->size = size; xinode->lindex = lindex; xinode->is_loc_resource = 1; diff --git a/sesman/chansrv/clipboard_file.c b/sesman/chansrv/clipboard_file.c index 562ee82d..8c2f2189 100644 --- a/sesman/chansrv/clipboard_file.c +++ b/sesman/chansrv/clipboard_file.c @@ -660,7 +660,11 @@ clipboard_c2s_in_files(struct stream *s, char *file_list) "supported [%s]", cfd->cFileName); continue; } - xfuse_add_clip_dir_item(cfd->cFileName, 0, cfd->fileSizeLow, lindex); + if (xfuse_add_clip_dir_item(cfd->cFileName, 0, cfd->fileSizeLow, lindex) == -1) + { + log_error("clipboard_c2s_in_files: failed to add clip dir item"); + continue; + } if (file_count > 0) { diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c index 66108651..e2b6f53b 100644 --- a/sesman/chansrv/sound.c +++ b/sesman/chansrv/sound.c @@ -35,6 +35,11 @@ static OpusEncoder *g_opus_encoder = 0; #endif +#if defined(XRDP_MP3LAME) +#include <lame/lame.h> +static lame_global_flags *g_lame_encoder = 0; +#endif + extern int g_rdpsnd_chan_id; /* in chansrv.c */ extern int g_display_num; /* in chansrv.c */ @@ -72,12 +77,12 @@ struct xr_wave_format_ex int nBlockAlign; int wBitsPerSample; int cbSize; - char *data; + tui8 *data; }; /* output formats */ -static char g_pcm_22050_data[] = { 0 }; +static tui8 g_pcm_22050_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_22050 = { 1, /* wFormatTag - WAVE_FORMAT_PCM */ @@ -90,7 +95,7 @@ static struct xr_wave_format_ex g_pcm_22050 = g_pcm_22050_data /* data */ }; -static char g_pcm_44100_data[] = { 0 }; +static tui8 g_pcm_44100_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_44100 = { 1, /* wFormatTag - WAVE_FORMAT_PCM */ @@ -104,7 +109,7 @@ static struct xr_wave_format_ex g_pcm_44100 = }; #if defined(XRDP_OPUS) -static char g_opus_44100_data[] = { 0 }; +static tui8 g_opus_44100_data[] = { 0 }; static struct xr_wave_format_ex g_opus_44100 = { 0x0069, /* wFormatTag - WAVE_FORMAT_OPUS */ @@ -118,27 +123,40 @@ static struct xr_wave_format_ex g_opus_44100 = }; #endif - -#if defined(XRDP_OPUS) -#define SND_NUM_OUTP_FORMATS 3 -static struct xr_wave_format_ex *g_wave_outp_formats[SND_NUM_OUTP_FORMATS] = +#if defined(XRDP_MP3LAME) +static tui8 g_mp3lame_44100_data[] = { 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x71, 0x05 }; +static struct xr_wave_format_ex g_mp3lame_44100 = { - &g_pcm_44100, - &g_pcm_22050, - &g_opus_44100 + 0x0055, /* wFormatTag - WAVE_FORMAT_MPEGLAYER3 */ + 2, /* num of channels */ + 44100, /* samples per sec */ + 176400, /* avg bytes per sec */ + 4, /* block align */ + 0, /* bits per sample */ + 12, /* data size */ + g_mp3lame_44100_data /* data */ }; -#else -#define SND_NUM_OUTP_FORMATS 2 -static struct xr_wave_format_ex *g_wave_outp_formats[SND_NUM_OUTP_FORMATS] = +#endif + +static struct xr_wave_format_ex *g_wave_outp_formats[] = { &g_pcm_44100, - &g_pcm_22050 -}; + &g_pcm_22050, +#if defined(XRDP_OPUS) + &g_opus_44100, +#endif +#if defined(XRDP_MP3LAME) + &g_mp3lame_44100, #endif + 0 +}; static int g_client_does_opus = 0; static int g_client_opus_index = 0; +static int g_client_does_mp3lame = 0; +static int g_client_mp3lame_index = 0; + /* index into list from client */ static int g_current_client_format_index = 0; @@ -147,7 +165,7 @@ static int g_current_server_format_index = 0; /* input formats */ -static char g_pcm_inp_22050_data[] = { 0 }; +static tui8 g_pcm_inp_22050_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_inp_22050 = { 1, /* wFormatTag - WAVE_FORMAT_PCM */ @@ -160,7 +178,7 @@ static struct xr_wave_format_ex g_pcm_inp_22050 = g_pcm_inp_22050_data /* data */ }; -static char g_pcm_inp_44100_data[] = { 0 }; +static tui8 g_pcm_inp_44100_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_inp_44100 = { 1, /* wFormatTag - WAVE_FORMAT_PCM */ @@ -173,11 +191,11 @@ static struct xr_wave_format_ex g_pcm_inp_44100 = g_pcm_inp_44100_data /* data */ }; -#define SND_NUM_INP_FORMATS 2 -static struct xr_wave_format_ex *g_wave_inp_formats[SND_NUM_INP_FORMATS] = +static struct xr_wave_format_ex *g_wave_inp_formats[] = { &g_pcm_inp_44100, - &g_pcm_inp_22050 + &g_pcm_inp_22050, + 0 }; static int g_client_input_format_index = 0; @@ -204,8 +222,13 @@ sound_send_server_output_formats(void) struct stream *s; int bytes; int index; + int num_formats; char *size_ptr; + num_formats = sizeof(g_wave_outp_formats) / + sizeof(g_wave_outp_formats[0]) - 1; + LOG(10, ("sound_send_server_output_formats: num_formats %d", num_formats)); + make_stream(s); init_stream(s, 8182); out_uint16_le(s, SNDC_FORMATS); @@ -215,9 +238,9 @@ sound_send_server_output_formats(void) out_uint32_le(s, 0); /* dwVolume */ out_uint32_le(s, 0); /* dwPitch */ out_uint16_le(s, 0); /* wDGramPort */ - out_uint16_le(s, SND_NUM_OUTP_FORMATS); /* wNumberOfFormats */ + out_uint16_le(s, num_formats); /* wNumberOfFormats */ out_uint8(s, g_cBlockNo); /* cLastBlockConfirmed */ - out_uint16_le(s, 2); /* wVersion */ + out_uint16_le(s, 5); /* wVersion */ out_uint8(s, 0); /* bPad */ /* sndFormats */ @@ -239,7 +262,7 @@ sound_send_server_output_formats(void) 00 00 */ - for (index = 0; index < SND_NUM_OUTP_FORMATS; index++) + for (index = 0; index < num_formats; index++) { out_uint16_le(s, g_wave_outp_formats[index]->wFormatTag); out_uint16_le(s, g_wave_outp_formats[index]->nChannels); @@ -341,10 +364,18 @@ sound_process_output_format(int aindex, int wFormatTag, int nChannels, if (wFormatTag == 0x0069) { + LOG(0, ("wFormatTag, opus")); g_client_does_opus = 1; g_client_opus_index = aindex; g_bbuf_size = 11520; } + else if (wFormatTag == 0x0055) + { + LOG(0, ("wFormatTag, mp3")); + g_client_does_mp3lame = 1; + g_client_mp3lame_index = aindex; + g_bbuf_size = 11520; + } return 0; } @@ -403,7 +434,7 @@ sound_process_output_formats(struct stream *s, int size) /*****************************************************************************/ static int -sound_wave_compress(char *data, int data_bytes, int *format_index) +sound_wave_compress_opus(char *data, int data_bytes, int *format_index) { unsigned char *cdata; int cdata_bytes; @@ -428,7 +459,7 @@ sound_wave_compress(char *data, int data_bytes, int *format_index) &error); if (g_opus_encoder == 0) { - LOG(0, ("sound_wave_compress: opus_encoder_create failed")); + LOG(0, ("sound_wave_compress_opus: opus_encoder_create failed")); return data_bytes; } } @@ -465,7 +496,95 @@ sound_wave_compress(char *data, int data_bytes, int *format_index) /*****************************************************************************/ static int -sound_wave_compress(char *data, int data_bytes, int *format_index) +sound_wave_compress_opus(char *data, int data_bytes, int *format_index) +{ + return data_bytes; +} + +#endif + +#if defined(XRDP_MP3LAME) + +/*****************************************************************************/ +static int +sound_wave_compress_mp3lame(char *data, int data_bytes, int *format_index) +{ + int rv; + int cdata_bytes; + int odata_bytes; + unsigned char *cdata; + + cdata = NULL; + rv = data_bytes; + + if (g_client_does_mp3lame == 0) + { + return rv; + } + + if (g_lame_encoder == 0) + { + /* init mp3 lame encoder */ + LOG(0, ("sound_wave_compress_mp3lame: using mp3lame")); + + g_lame_encoder = lame_init(); + if (g_lame_encoder == 0) + { + LOG(0, ("sound_wave_compress_mp3lame: lame_init() failed")); + return rv; + } + lame_set_num_channels(g_lame_encoder, g_mp3lame_44100.nChannels); + lame_set_in_samplerate(g_lame_encoder, g_mp3lame_44100.nSamplesPerSec); + if (lame_init_params(g_lame_encoder) == -1) + { + LOG(0, ("sound_wave_compress_mp3lame: lame_init_params() failed")); + return rv; + } + + LOG(0, ("sound_wave_compress_mp3lame: lame config:")); + LOG(0, (" brate : %d", lame_get_brate(g_lame_encoder))); + LOG(0, (" compression ratio: %f", lame_get_compression_ratio(g_lame_encoder))); + LOG(0, (" encoder delay : %d", lame_get_encoder_delay(g_lame_encoder))); + LOG(0, (" frame size : %d", lame_get_framesize(g_lame_encoder))); + LOG(0, (" encoder padding : %d", lame_get_encoder_padding(g_lame_encoder))); + LOG(0, (" mode : %d", lame_get_mode(g_lame_encoder))); + } + + odata_bytes = data_bytes; + cdata_bytes = data_bytes; + cdata = (unsigned char *) g_malloc(cdata_bytes, 0); + if (data_bytes < g_bbuf_size) + { + g_memset(data + data_bytes, 0, g_bbuf_size - data_bytes); + data_bytes = g_bbuf_size; + } + cdata_bytes = lame_encode_buffer_interleaved(g_lame_encoder, + (short int *) data, + data_bytes / 4, + cdata, + cdata_bytes); + if (cdata_bytes < 0) + { + LOG(0, ("sound_wave_compress: lame_encode_buffer_interleaved() " + "failed, error %d", cdata_bytes)); + return rv; + } + if ((cdata_bytes > 0) && (cdata_bytes < odata_bytes)) + { + *format_index = g_client_mp3lame_index; + g_memcpy(data, cdata, cdata_bytes); + rv = cdata_bytes; + } + + g_free(cdata); + return rv; +} + +#else + +/*****************************************************************************/ +static int +sound_wave_compress_mp3lame(char *data, int data_bytes, int *format_index) { return data_bytes; } @@ -473,6 +592,21 @@ sound_wave_compress(char *data, int data_bytes, int *format_index) #endif /*****************************************************************************/ +static int +sound_wave_compress(char *data, int data_bytes, int *format_index) +{ + if (g_client_does_opus) + { + return sound_wave_compress_opus(data, data_bytes, format_index); + } + else if (g_client_does_mp3lame) + { + return sound_wave_compress_mp3lame(data, data_bytes, format_index); + } + return data_bytes; +} + +/*****************************************************************************/ /* send wave message to client */ static int sound_send_wave_data_chunk(char *data, int data_bytes) @@ -820,6 +954,9 @@ sound_init(void) g_client_does_opus = 0; g_client_opus_index = 0; + g_client_does_mp3lame = 0; + g_client_mp3lame_index = 0; + return 0; } @@ -852,6 +989,15 @@ sound_deinit(void) g_audio_c_trans_in = 0; } +#if defined(XRDP_MP3LAME) + if (g_lame_encoder) + { + lame_close(g_lame_encoder); + g_lame_encoder = 0; + g_client_does_mp3lame = 0; + } +#endif + fifo_deinit(&g_in_fifo); return 0; @@ -1014,10 +1160,15 @@ sound_check_wait_objs(void) static int APP_CC sound_send_server_input_formats(void) { - struct stream* s; - int bytes; - int index; - char* size_ptr; + struct stream *s; + int bytes; + int index; + int num_formats; + char *size_ptr; + + num_formats = sizeof(g_wave_inp_formats) / + sizeof(g_wave_inp_formats[0]) - 1; + LOG(10, ("sound_send_server_input_formats: num_formats %d", num_formats)); make_stream(s); init_stream(s, 8182); @@ -1026,8 +1177,8 @@ sound_send_server_input_formats(void) out_uint16_le(s, 0); /* size, set later */ out_uint32_le(s, 0); /* unused */ out_uint32_le(s, 0); /* unused */ - out_uint16_le(s, SND_NUM_INP_FORMATS); /* wNumberOfFormats */ - out_uint16_le(s, 2); /* wVersion */ + out_uint16_le(s, num_formats); /* wNumberOfFormats */ + out_uint16_le(s, 5); /* wVersion */ /* wFormatTag 2 byte offset 0 @@ -1040,7 +1191,7 @@ sound_send_server_input_formats(void) data variable offset 18 */ - for (index = 0; index < SND_NUM_INP_FORMATS; index++) + for (index = 0; index < num_formats; index++) { out_uint16_le(s, g_wave_inp_formats[index]->wFormatTag); out_uint16_le(s, g_wave_inp_formats[index]->nChannels); diff --git a/sesman/chansrv/wave-format-server.txt b/sesman/chansrv/wave-format-server.txt index 1d0bb91e..3a197a71 100644 --- a/sesman/chansrv/wave-format-server.txt +++ b/sesman/chansrv/wave-format-server.txt @@ -464,3 +464,470 @@ wFormatTag=353 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=750 nBlockAlign=4 ? wFormatTag=66 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=666 nBlockAlign=20 wBitsPerSample=0 cbSize=10 0000 03 00 ce 9a 32 f7 a2 ae de ac ....2..... + + + +//*************************************************************** +// Windows 7 SP1 x64 Server Formats +WAVE_FORMAT_PCM: +wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 176400 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44359 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44251 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22179 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22125 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 8957 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + + +//*************************************************************** +// Windows 10 10586 x64 Server Formats +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 24000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 20000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 16000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 12000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_PCM: +wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 176400 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44359 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44251 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22179 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22125 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 8957 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + + +//*************************************************************** +// Windows Server 2016 TP4 x64 Server Formats +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 24000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 20000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 16000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_AAC_MS: +wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 12000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_PCM: +wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 176400 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44359 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44251 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22179 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22125 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 8957 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + + + + + +//*************************************************************** +// Windows XP SP3 x86 Server Formats +WAVE_FORMAT_PCM: +wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 88200 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_MULAW: +wFormatTag: 0x0007 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 22050 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 22050 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_MULAW: +wFormatTag: 0x0007 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 22050 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_MULAW: +wFormatTag: 0x0007 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 22050 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 16000 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_MULAW: +wFormatTag: 0x0007 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 16000 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 11025 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_MULAW: +wFormatTag: 0x0007 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 11025 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_ALAW: +wFormatTag: 0x0006 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 8000 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_MULAW: +wFormatTag: 0x0007 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 8000 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 7000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 7000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 6000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 6000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 5000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 5000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_ADPCM: +wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 + +WAVE_FORMAT_DVI_ADPCM: +wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 4005 nBlockAlign: 186 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 2519 nBlockAlign: 117 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 2519 nBlockAlign: 117 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2000 nBlockAlign: 64 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_GSM610: +wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 1500 nBlockAlign: 96 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 1249 nBlockAlign: 58 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_DSPGROUP_TRUESPEECH : +wFormatTag: 0x0022 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1067 nBlockAlign: 32 wBitsPerSample: 1 cbSize: 32 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 1012 nBlockAlign: 47 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1000 nBlockAlign: 64 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 1000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 1000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MPEGLAYER3: +wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 + +WAVE_FORMAT_MSG723: +wFormatTag: 0x0042 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 800 nBlockAlign: 24 wBitsPerSample: 0 cbSize: 10 + +WAVE_FORMAT_WMAUDIO2: +wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 750 nBlockAlign: 48 wBitsPerSample: 16 cbSize: 47 + +WAVE_FORMAT_MSG723: +wFormatTag: 0x0042 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 666 nBlockAlign: 20 wBitsPerSample: 0 cbSize: 10 + diff --git a/sesman/env.c b/sesman/env.c index 39e020fd..d8bb1e98 100644 --- a/sesman/env.c +++ b/sesman/env.c @@ -81,8 +81,9 @@ env_check_password_file(char *filename, char *passwd) } /******************************************************************************/ +/* its the responsibility of the caller to free passwd_file */ int DEFAULT_CC -env_set_user(char *username, char *passwd_file, int display, +env_set_user(char *username, char **passwd_file, int display, struct list *env_names, struct list* env_values) { int error; @@ -90,15 +91,17 @@ env_set_user(char *username, char *passwd_file, int display, int pw_gid; int uid; int index; + int len; char *name; char *value; - char pw_shell[256]; - char pw_dir[256]; - char pw_gecos[256]; + char *pw_shell; + char *pw_dir; char text[256]; - error = g_getuser_info(username, &pw_gid, &pw_uid, pw_shell, pw_dir, - pw_gecos); + pw_shell = 0; + pw_dir = 0; + + error = g_getuser_info(username, &pw_gid, &pw_uid, &pw_shell, &pw_dir, 0); if (error == 0) { @@ -122,7 +125,7 @@ env_set_user(char *username, char *passwd_file, int display, { g_clearenv(); g_setenv("SHELL", pw_shell, 1); - g_setenv("PATH", "/bin:/usr/bin:/usr/local/bin", 1); + g_setenv("PATH", "/sbin:/bin:/usr/bin:/usr/local/bin", 1); g_setenv("USER", username, 1); g_sprintf(text, "%d", uid); g_setenv("UID", text, 1); @@ -147,28 +150,48 @@ env_set_user(char *username, char *passwd_file, int display, if (0 == g_cfg->auth_file_path) { /* if no auth_file_path is set, then we go for - $HOME/.vnc/sesman_username_passwd */ + $HOME/.vnc/sesman_username_passwd */ if (g_mkdir(".vnc") < 0) { log_message(LOG_LEVEL_ERROR, - "env_set_user: error creating .vnc dir"); + "env_set_user: error creating .vnc dir"); + } + + len = g_snprintf(NULL, 0, "%s/.vnc/sesman_%s_passwd", pw_dir, username); + + *passwd_file = (char *) g_malloc(len + 1, 1); + if (*passwd_file != NULL) + { + g_sprintf(*passwd_file, "%s/.vnc/sesman_%s_passwd", pw_dir, username); } - g_sprintf(passwd_file, "%s/.vnc/sesman_%s_passwd", pw_dir, username); } else { /* we use auth_file_path as requested */ - g_sprintf(passwd_file, g_cfg->auth_file_path, username); + len = g_snprintf(NULL, 0, g_cfg->auth_file_path, username); + + *passwd_file = (char *) g_malloc(len + 1, 1); + if (*passwd_file != NULL) + { + g_sprintf(*passwd_file, g_cfg->auth_file_path, username); + } } - LOG_DBG("pass file: %s", passwd_file); + if (*passwd_file != NULL) + { + LOG_DBG("pass file: %s", *passwd_file); + } } + + g_free(pw_dir); + g_free(pw_shell); } } else { log_message(LOG_LEVEL_ERROR, - "error getting user info for user %s", username); + "error getting user info for user %s", + username); } return error; diff --git a/sesman/env.h b/sesman/env.h index 378e7fd1..23828080 100644 --- a/sesman/env.h +++ b/sesman/env.h @@ -50,7 +50,7 @@ env_check_password_file(char* filename, char* password); * */ int DEFAULT_CC -env_set_user(char* username, char* passwd_file, int display, +env_set_user(char* username, char** passwd_file, int display, struct list *env_names, struct list* env_values); #endif diff --git a/sesman/session.c b/sesman/session.c index 64079a8f..298a5867 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -286,8 +286,11 @@ session_start_sessvc(int xpid, int wmpid, long data, char *username, int display list_add_item(sessvc_params, (tintptr)g_strdup(wmpid_str)); list_add_item(sessvc_params, 0); /* mandatory */ - env_set_user(username, 0, display, - g_cfg->session_variables1, g_cfg->session_variables2); + env_set_user(username, + 0, + display, + g_cfg->session_variables1, + g_cfg->session_variables2); /* executing sessvc */ g_execvp(exe_path, ((char **)sessvc_params->items)); @@ -414,19 +417,18 @@ session_start_fork(int width, int height, int bpp, char *username, int pampid = 0; int xpid = 0; int i = 0; - char *xserver; /* absolute/relative path to Xorg/X11rdp/Xvnc */ char geometry[32]; char depth[32]; char screen[32]; /* display number */ char text[256]; - char passwd_file[256]; - char *pfile; + char execvpparams[2048]; + char *xserver; /* absolute/relative path to Xorg/X11rdp/Xvnc */ + char *passwd_file; char **pp1 = (char **)NULL; struct session_chain *temp = (struct session_chain *)NULL; struct list *xserver_params = (struct list *)NULL; - time_t ltime; struct tm stime; - char execvpparams[2048]; + time_t ltime; /* initialize (zero out) local variables: */ g_memset(<ime, 0, sizeof(time_t)); @@ -435,7 +437,8 @@ session_start_fork(int width, int height, int bpp, char *username, g_memset(depth, 0, sizeof(char) * 32); g_memset(screen, 0, sizeof(char) * 32); g_memset(text, 0, sizeof(char) * 256); - g_memset(passwd_file, 0, sizeof(char) * 256); + + passwd_file = 0; /* check to limit concurrent sessions */ if (g_session_count >= g_cfg->sess.max_sessions) @@ -539,7 +542,9 @@ session_start_fork(int width, int height, int bpp, char *username, } else if (pampid == 0) { - env_set_user(username, 0, display, + env_set_user(username, + 0, + display, g_cfg->session_variables1, g_cfg->session_variables2); if (x_server_running(display)) @@ -634,14 +639,23 @@ session_start_fork(int width, int height, int bpp, char *username, } else if (xpid == 0) /* child */ { - pfile = 0; if (type == SESMAN_SESSION_TYPE_XVNC) { - pfile = passwd_file; + env_set_user(username, + &passwd_file, + display, + g_cfg->session_variables1, + g_cfg->session_variables2); } - env_set_user(username, pfile, display, - g_cfg->session_variables1, - g_cfg->session_variables2); + else + { + env_set_user(username, + 0, + display, + g_cfg->session_variables1, + g_cfg->session_variables2); + } + g_snprintf(text, 255, "%d", g_cfg->sess.max_idle_time); g_setenv("XRDP_SESMAN_MAX_IDLE_TIME", text, 1); @@ -703,6 +717,8 @@ session_start_fork(int width, int height, int bpp, char *username, list_add_item(xserver_params, (tintptr)g_strdup("-rfbauth")); list_add_item(xserver_params, (tintptr)g_strdup(passwd_file)); + g_free(passwd_file); + /* additional parameters from sesman.ini file */ //config_read_xserver_params(SESMAN_SESSION_TYPE_XVNC, // xserver_params); @@ -831,8 +847,11 @@ session_reconnect_fork(int display, char *username) } else if (pid == 0) { - env_set_user(username, 0, display, - g_cfg->session_variables1, g_cfg->session_variables2); + env_set_user(username, + 0, + display, + g_cfg->session_variables1, + g_cfg->session_variables2); g_snprintf(text, 255, "%s/%s", XRDP_CFG_PATH, "reconnectwm.sh"); if (g_file_exist(text)) diff --git a/xorg/X11R7.6/rdp/rdprandr.c b/xorg/X11R7.6/rdp/rdprandr.c index 46c4908d..2a040a9b 100644 --- a/xorg/X11R7.6/rdp/rdprandr.c +++ b/xorg/X11R7.6/rdp/rdprandr.c @@ -439,11 +439,13 @@ rdpRRSetRdpOutputs(void) } } +#if 0 for (index = 0; index < pRRScrPriv->numOutputs; index++) { RROutputSetCrtcs(pRRScrPriv->outputs[index], pRRScrPriv->crtcs, pRRScrPriv->numCrtcs); } +#endif return 0; } diff --git a/xorg/X11R7.6/xkeyboard-config-2.0.patch b/xorg/X11R7.6/xkeyboard-config-2.0.patch new file mode 100644 index 00000000..a77f117a --- /dev/null +++ b/xorg/X11R7.6/xkeyboard-config-2.0.patch @@ -0,0 +1,88 @@ +diff -rupP xkeyboard-config-2.0.orig/rules/HDR xkeyboard-config-2.0/rules/HDR +--- xkeyboard-config-2.0.orig/rules/HDR 2016-06-28 19:31:02.814647638 +0900 ++++ xkeyboard-config-2.0/rules/HDR 2016-06-28 19:33:58.251517616 +0900 +@@ -15,6 +15,7 @@ + ! model layout[3] variant[3] = symbols + ! model layout[4] variant[4] = symbols + ! model = symbols ++! model layout = symbols + ! layout variant = compat + ! layout[1] variant[1] = compat + ! layout[2] variant[2] = compat +diff -rupP xkeyboard-config-2.0.orig/rules/Makefile.am xkeyboard-config-2.0/rules/Makefile.am +--- xkeyboard-config-2.0.orig/rules/Makefile.am 2016-06-28 19:31:02.814647638 +0900 ++++ xkeyboard-config-2.0/rules/Makefile.am 2016-06-28 20:58:22.276629031 +0900 +@@ -41,6 +41,7 @@ HDR compat/base.ml2v2_s.part extras/bas + HDR compat/base.ml3v3_s.part extras/base.ml3v3_s.part \ + HDR compat/base.ml4v4_s.part extras/base.ml4v4_s.part \ + HDR base.m_s.part \ ++HDR base.ml_s1.part \ + HDR compat/base.lv_c.part \ + HDR compat/base.l1v1_c.part \ + HDR compat/base.l2v2_c.part \ +@@ -114,6 +115,7 @@ HDR extras/base.ml2v2_s.part \ + HDR extras/base.ml3v3_s.part \ + HDR extras/base.ml4v4_s.part \ + HDR base.m_s.part \ ++HDR base.ml_s1.part \ + HDR \ + HDR \ + HDR \ +@@ -183,6 +185,7 @@ base.ml2_s.part \ + base.ml3_s.part \ + base.ml4_s.part \ + base.m_s.part \ ++base.ml_s1.part \ + base.ml_c.part \ + base.ml1_c.part \ + base.m_t.part \ +diff -rupP xkeyboard-config-2.0.orig/rules/Makefile.in xkeyboard-config-2.0/rules/Makefile.in +--- xkeyboard-config-2.0.orig/rules/Makefile.in 2016-06-28 19:31:02.850647811 +0900 ++++ xkeyboard-config-2.0/rules/Makefile.in 2016-06-28 21:00:57.569398853 +0900 +@@ -239,6 +239,7 @@ SUBDIRS = bin compat extras + @USE_COMPAT_RULES_FALSE@HDR extras/base.ml3v3_s.part \ + @USE_COMPAT_RULES_FALSE@HDR extras/base.ml4v4_s.part \ + @USE_COMPAT_RULES_FALSE@HDR base.m_s.part \ ++@USE_COMPAT_RULES_FALSE@HDR base.ml_s1.part \ + @USE_COMPAT_RULES_FALSE@HDR \ + @USE_COMPAT_RULES_FALSE@HDR \ + @USE_COMPAT_RULES_FALSE@HDR \ +@@ -275,6 +276,7 @@ SUBDIRS = bin compat extras + @USE_COMPAT_RULES_TRUE@HDR compat/base.ml3v3_s.part extras/base.ml3v3_s.part \ + @USE_COMPAT_RULES_TRUE@HDR compat/base.ml4v4_s.part extras/base.ml4v4_s.part \ + @USE_COMPAT_RULES_TRUE@HDR base.m_s.part \ ++@USE_COMPAT_RULES_TRUE@HDR base.ml_s1.part \ + @USE_COMPAT_RULES_TRUE@HDR compat/base.lv_c.part \ + @USE_COMPAT_RULES_TRUE@HDR compat/base.l1v1_c.part \ + @USE_COMPAT_RULES_TRUE@HDR compat/base.l2v2_c.part \ +@@ -378,6 +380,7 @@ base.ml2_s.part \ + base.ml3_s.part \ + base.ml4_s.part \ + base.m_s.part \ ++base.ml_s1.part \ + base.ml_c.part \ + base.ml1_c.part \ + base.m_t.part \ +diff -rupP xkeyboard-config-2.0.orig/rules/base.ml_s1.part xkeyboard-config-2.0/rules/base.ml_s1.part +--- xkeyboard-config-2.0.orig/rules/base.ml_s1.part 1970-01-01 09:00:00.000000000 +0900 ++++ xkeyboard-config-2.0/rules/base.ml_s1.part 2016-06-28 19:59:05.238990192 +0900 +@@ -0,0 +1 @@ ++ $inetkbds jp = +jp(henkan) +diff -rupP xkeyboard-config-2.0.orig/symbols/jp xkeyboard-config-2.0/symbols/jp +--- xkeyboard-config-2.0.orig/symbols/jp 2016-06-28 19:31:03.046648788 +0900 ++++ xkeyboard-config-2.0/symbols/jp 2016-06-28 19:32:57.367215702 +0900 +@@ -105,6 +105,14 @@ xkb_symbols "common" { + }; + }; + ++partial alphanumeric_keys ++xkb_symbols "henkan" { ++ key <XFER> { ++ type[Group1]= "PC_ALT_LEVEL2", ++ symbols[Group1]= [ Henkan, Mode_switch ] ++ }; ++}; ++ + // OADG109A map + partial alphanumeric_keys + xkb_symbols "OADG109A" { diff --git a/xrdp/xrdp_keyboard.ini b/xrdp/xrdp_keyboard.ini index 0f1a28cb..21e27f1c 100644 --- a/xrdp/xrdp_keyboard.ini +++ b/xrdp/xrdp_keyboard.ini @@ -100,7 +100,7 @@ layouts_map=rdp_layouts_map_mac [rdp_keyboard_jp] keyboard_type=7 keyboard_subtype=2 -model=jp106 +model=pc105 rdp_layouts=default_rdp_layouts layouts_map=default_layouts_map |
