locked
Setting "WinRTEncryptedPassword" property on Remote Desktop Client doesn't work on Microsoft Surface (Windows RT environment)

    Question

  • Hi,



    I'm developing a Windows Store app that makes use of the Remote Desktop Client.

    The Remote Desktop Client is an ActiveX control, and as stated in its documentation, is "...designed for use by Windows Store apps using JavaScript."



    I'm trying to connect to the remote PC without having the user provide credentials, by passing the credentials in the code as RDP properties.

    In order to set various properties for the RDP connection, I'm using the "SetRdpProperty" method.



    I'm experiencing an issue with the following (2) properties:

    rdpControl.Settings.SetRdpProperty("WinRTEncryptedPassword", encryptedPassword);

    rdpControl.Settings.SetRdpProperty("WinRTPasswordEncoding", 1);



    The above lines of code works properly on my development machine (running Windows 8 Professional 64-bit), but when the application is deployed onto my Surface tablet (running Windows RT), this error is thrown:


    0x800a0005 - JavaScript runtime error: Invalid procedure call or argument

    I was able to reproduce the same error by trying to set another property with a typo, such as "userna_me" instead of "username".

    Does this mean that the version of the ActiveX control that ends up being loaded on the Windows RT environment does not support the "WinRTEncryptedPassword" property?

    Or perhaps it uses different property names? (I wasn't able to find documentation)



    What can be done to work around this problem?


    Thanks!

    NOTE: I was going to include links to relevant documentation on MSDN, but the system won't allow me to do so, "until we are able to verify your account"



    • Edited by paulkore Tuesday, October 22, 2013 11:42 PM
    Tuesday, October 22, 2013 11:40 PM

Answers

  • Hello,

    These properties were not available on the RTM release of Windows 8 (x86, x64 or RT). The properties were included as part of the cumulative updates of: http://support.microsoft.com/kb/2811660 that were released in March 2013. To use the properties on Windows RT you need to ensure that you have the above cumulative update installed.

    Can you check the last modified date and version of: C:\windows\system32\mstscax.dll on your Windows RT machine?

    Btw, you MUST set the value of the WinRTPasswordEncoding BEFORE WinRTEncyrptedPassword not AFTER it.

    The correct logic to implement this functionality looks something like this:

            var clearPassword = "your_RDP_Clear_Text_Password";
            var dataProtectionProvider = new Windows.Security.Cryptography.DataProtection.DataProtectionProvider("LOCAL=user");        
            var cryptographicBuffer = Windows.Security.Cryptography.CryptographicBuffer;
            var passwordBuffer = cryptographicBuffer.convertStringToBinary(clearPassword, 0|1|2); // integer value based on step 2b above
            dataProtectionProvider.protectAsync(passwordBuffer).done(function (result) {
                    myClientControlObject.Settings.SetRdpProperty("WinRTPasswordEncoding", 0|1|2);  // integer value based on step 2b above
                    myClientControlObject.Settings.SetRdpProperty("WinRTEncryptedPassword", cryptographicBuffer.encodeToBase64String(result));
                    ... remainder of your code
    

    Thanks,

    Prashant


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    • Marked as answer by paulkore Wednesday, October 23, 2013 8:25 PM
    Wednesday, October 23, 2013 12:27 AM
    Moderator

All replies

  • Hello,

    These properties were not available on the RTM release of Windows 8 (x86, x64 or RT). The properties were included as part of the cumulative updates of: http://support.microsoft.com/kb/2811660 that were released in March 2013. To use the properties on Windows RT you need to ensure that you have the above cumulative update installed.

    Can you check the last modified date and version of: C:\windows\system32\mstscax.dll on your Windows RT machine?

    Btw, you MUST set the value of the WinRTPasswordEncoding BEFORE WinRTEncyrptedPassword not AFTER it.

    The correct logic to implement this functionality looks something like this:

            var clearPassword = "your_RDP_Clear_Text_Password";
            var dataProtectionProvider = new Windows.Security.Cryptography.DataProtection.DataProtectionProvider("LOCAL=user");        
            var cryptographicBuffer = Windows.Security.Cryptography.CryptographicBuffer;
            var passwordBuffer = cryptographicBuffer.convertStringToBinary(clearPassword, 0|1|2); // integer value based on step 2b above
            dataProtectionProvider.protectAsync(passwordBuffer).done(function (result) {
                    myClientControlObject.Settings.SetRdpProperty("WinRTPasswordEncoding", 0|1|2);  // integer value based on step 2b above
                    myClientControlObject.Settings.SetRdpProperty("WinRTEncryptedPassword", cryptographicBuffer.encodeToBase64String(result));
                    ... remainder of your code
    

    Thanks,

    Prashant


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    • Marked as answer by paulkore Wednesday, October 23, 2013 8:25 PM
    Wednesday, October 23, 2013 12:27 AM
    Moderator
  • Hi Prashant,

    Thanks for the prompt reply.

    I examined the situation on both machines, and the results are:

    Windows 8 x64 machine: 
    "mstscax.dll" date modified: Mar 1, 2013
    Update "KB2811660" is installed

    Windows RT machine: 
    "mstscax.dll" date modified: Nov 5, 2012
    Update "KB2811660" is NOT installed
    According to Windows Update, the machine is up to date and there are no available updates to install

    Moreover, according to the documentation, article "2811660" applies to:
    Windows 8
    Windows 8 Enterprise
    Windows 8 Pro
    Windows Server 2012 Datacenter
    Windows Server 2012 Essentials
    Windows Server 2012 Foundation
    Windows Server 2012 Standard 

    ...which doesn't quite include Windows RT.

    Is there a way to install this update manually?

    Or to obtain the latest version of "mstscax.dll" for ARM ?


    Thanks,


    -Paul




    Wednesday, October 23, 2013 3:53 PM
  • Hi Paul,

    The fix is also available for Windows RT systems as I see it internally. I also had my teammate confirm that he has the version from March on a Surface RT with Windows 8.

    On your Surface RT, when you go to Programs and Features -> View Installed updates and then check for the Microsoft updates, what "Install date" do you see the latest updates as?

    If you still can't get the fix, I would recommend you open a case with our Platforms team to know why your Surface RT cannot get that specific update.

    But to answer your question, the fix is released for all operating systems in the March updates - x86, x64 as well as RT.

    Thanks,

    Prashant.


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Wednesday, October 23, 2013 7:24 PM
    Moderator
  • Hi Prashant,

    I checked with another Surface RT device that I have here at the office, and it has the correct update, just like you describe. This one is brand-new, it was shipped to us 2 weeks ago.

    I learned that the original Surface that I was doing work on is an older device (from the first batch), and was left without power for a very long time, which may have caused the "missing updates" symptom when it was finally powered on.


    I'm going to restore the device to factory spec, and pull all updates again. Hopefully this will resolve the issue.

    -Paul


    Wednesday, October 23, 2013 8:04 PM
  • Update:

    I went ahead with restoring the problematic Windows RT device to factory spec, and then proceeded to install all available updates in Windows Update (went through several cycles of "check for updates" + "install and reboot" until there were no more updates discovered).

    Unfortunately, the issue persists: "mstscax.dll" date modified is in 2012

    As mentioned before, this particular device is an old one, from the first batch that was released to the market (I was told this by my colleague... it's not verified information).

    I have 3 other Windows RT devices available for my work, which were shipped to us several weeks ago. These devices don't have this issue, and I'm going to use them going forward.

    Ideally we'd like to have the problematic device 'fixed', but at the time it's low on the priority list.

    I'm not sure how Microsoft Support would go about this, and whether it'd be considered under warranty?

    -Paul

    Thursday, October 24, 2013 5:43 PM
  • Update2:

    The Windows RT 8.1 upgrade fixes this issue. 

    Wednesday, November 13, 2013 5:51 PM