Author: arkurth
Date: Tue Nov  2 18:30:20 2010
New Revision: 1030163

URL: http://svn.apache.org/viewvc?rev=1030163&view=rev
Log:
VCL-373
Added Windows.pm::enable_rdp_audio subroutine and added call to pre_capture.  
Audio redirection is disabled by default for RDP sessions under Windows Server 
2008.  This should allow audio to work as expected.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm?rev=1030163&r1=1030162&r2=1030163&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Tue Nov  2 
18:30:20 2010
@@ -423,6 +423,16 @@ sub pre_capture {
 
 =item *
 
+ Enable audio redirection for RDP sessions
+
+=cut
+
+       if (!$self->enable_rdp_audio()) {
+               notify($ERRORS{'WARNING'}, 0, "unable to enable RDP audio 
redirection");
+       }
+
+=item *
+
  Clean up the hard drive
 
 =cut
@@ -7073,6 +7083,59 @@ EOF
 
 #/////////////////////////////////////////////////////////////////////////////
 
+=head2 enable_rdp_audio
+
+ Parameters  : None.
+ Returns     : If successful: true
+               If failed: false
+ Description : Sets the registry keys to allow audio redirection via RDP
+               sessions. This is disabled by default under Windows Server 2008
+               and possibly other versions of Windows. Also sets the Windows
+               Audio service to start automatically.
+
+=cut
+
+sub enable_rdp_audio {
+       my $self = shift;
+       unless (ref($self) && $self->isa('VCL::Module')) {
+               notify($ERRORS{'CRITICAL'}, 0, "subroutine can only be called 
as a VCL::Module module object method");
+               return; 
+       }
+       
+       my $registry_string .= <<"EOF";
+Windows Registry Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal 
Server\\WinStations\\RDP-Tcp]
+"fDisableCam"=dword:00000000
+
+[HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal 
Services]
+"fDisableCam"=dword:00000000
+
+EOF
+
+       # Import the string into the registry
+       if ($self->import_registry_string($registry_string)) {
+               notify($ERRORS{'OK'}, 0, "set the registry keys to enable RDP 
audio");
+       }
+       else {
+               notify($ERRORS{'WARNING'}, 0, "failed to set the registry key 
to enable RDP audio");
+               return 0;
+       }
+       
+       # Configure the Windows Audio service to start automatically
+       if ($self->set_service_startup_mode('AudioSrv', 'auto')) {
+               notify($ERRORS{'DEBUG'}, 0, "set the Windows Audio service 
startup mode to auto");
+       }
+       else {
+               notify($ERRORS{'WARNING'}, 0, "failed to set the Windows Audio 
service startup mode to auto");
+               return 0;
+       }
+
+       return 1;
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
 =head2 get_node_configuration_directory
 
  Parameters  : None.


Reply via email to