FreeRDP icon indicating copy to clipboard operation
FreeRDP copied to clipboard

ConvertToUnicode failed

Open codemusings opened this issue 9 years ago • 7 comments

Since the update yesterday or the day before I can't connect to any remote server anymore. Most notably it says ConvertToUnicode failed. I suspect pull request #3695 might be the culprit. Is there anything I can provide to track this down?

codemusings avatar May 24 '17 06:05 codemusings

@codemusings A little bit more of information would be appreciated. https://github.com/FreeRDP/FreeRDP/wiki/BugReporting

As for your suspiciton, does it work when not redirecting drives? The pull you reference is for the drive redirection only.

akallabeth avatar May 24 '17 07:05 akallabeth

You're right, I'm sorry. That was careless.

I'm using the nightly debian package to pull in updates. I'm on Debian Testing. Unfortunately the git version isn't included in the version string. All it says is:

This is FreeRDP version 2.0.0-dev (git n/a)

The output I'm seeing is:

[09:28:48:839] [12141:12142] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[09:28:48:839] [12141:12142] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
[09:28:48:839] [12141:12142] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[09:28:48:839] [12141:12142] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rail
[09:29:31:919] [12141:12142] [INFO][com.freerdp.gdi] - Local framebuffer format  PIXEL_FORMAT_BGRX32
[09:29:31:919] [12141:12142] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16
[09:29:31:925] [12141:12153] [INFO][com.freerdp.channels.rdpdr.client] - Loading device service drive [media] (static)
[09:29:31:925] [12141:12153] [ERROR][com.freerdp.channels.drive.client] - ConvertToUnicode failed!
[09:29:31:925] [12141:12153] [ERROR][com.freerdp.channels.rdpdr.client] - devman_load_device_service failed with error 12!
[09:29:31:925] [12141:12153] [ERROR][com.freerdp.channels.rdpdr.client] - rdpdr_process_connect failed with error 12!
[09:29:31:925] [12141:12142] [ERROR][com.freerdp.core] - rdpdr_virtual_channel_client_thread reported an error. Error was 12
[09:29:31:925] [12141:12142] [INFO][com.freerdp.client.x11] - Network disconnect!
[09:29:31:925] [12141:12142] [ERROR][com.freerdp.client.x11] - Failed to check FreeRDP file descriptor

Discarding the drive argument didn't help. So I guess it's not necessarily the pull request I mentioned. I used the following command to produce the above output:

xfreerdp <server-name>.rdp /u:<username> /d: /p:<password>

I think it's Windows Server 2012 R2. That's what it says on the customers' portal where I get the rdp files from.

codemusings avatar May 24 '17 07:05 codemusings

well, it still maps drives, so it may be related. what does the rdp file look like?

akallabeth avatar May 25 '17 08:05 akallabeth

I'm seeing this same error and it seems to be related to host drive redirection.

Using the latest nightly build, the following command line works:

me@mybox:~$ /opt/freerdp-nightly/bin/xfreerdp /u:<username> /d: /v:<host ip>
Password: 
[13:18:26:140] [18573:18574] [INFO][com.freerdp.gdi] - Local framebuffer format  PIXEL_FORMAT_BGRX32
[13:18:26:140] [18573:18574] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16

but adding +drives fails with the error @codemusings posted:

me@mybox:~$ /opt/freerdp-nightly/bin/xfreerdp /u:<username> /d: /v:<host ip> +drives
[13:19:50:425] [18625:18626] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[13:19:50:425] [18625:18626] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
Password: 
[13:19:53:853] [18625:18626] [INFO][com.freerdp.gdi] - Local framebuffer format  PIXEL_FORMAT_BGRX32
[13:19:53:853] [18625:18626] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16
[13:19:53:862] [18625:18635] [INFO][com.freerdp.channels.rdpdr.client] - Loading device service drive [media] (static)
[13:19:53:862] [18625:18635] [ERROR][com.freerdp.channels.drive.client] - ConvertToUnicode failed!
[13:19:53:862] [18625:18635] [ERROR][com.freerdp.channels.rdpdr.client] - devman_load_device_service failed with error 12!
[13:19:53:862] [18625:18635] [ERROR][com.freerdp.channels.rdpdr.client] - rdpdr_process_connect failed with error 12!
[13:19:53:863] [18625:18626] [ERROR][com.freerdp.core] - rdpdr_virtual_channel_client_thread reported an error. Error was 12
[13:19:53:863] [18625:18626] [INFO][com.freerdp.client.x11] - Network disconnect!
[13:19:53:863] [18625:18626] [ERROR][com.freerdp.client.x11] - Failed to check FreeRDP file descriptor

mbudnek avatar May 25 '17 17:05 mbudnek

Drive redirection was broken on linux. It seems that this build was only tested on windows :(.

'ConvertToUnicode failed' can be fixed with:


diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c
index b979b4b..5bb089b 100644
--- a/channels/drive/client/drive_main.c
+++ b/channels/drive/client/drive_main.c
@@ -817,7 +817,7 @@ UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints,
                for (i = 0; i <= length; i++)
                        Stream_Write_UINT8(drive->device.data, name[i] < 0 ? '_' : name[i]);
 
-               if ((pathLength > 0) && (path[pathLength-1] == '/'))
+               if ((pathLength > 1) && (path[pathLength-1] == '/'))
                        pathLength --;

uplusplus avatar May 26 '17 08:05 uplusplus

I'm facing the very same problem as the OP. Applying the patch indeed fixes the 'ConvertToUnicode failed' issue, but still does not connect

xfreerdp Consola-Aplicacions_virt.rdp /u:user /d:domain /p:password [12:57:31:961] [56393:56397] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr [12:57:31:961] [56393:56397] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd [12:57:31:961] [56393:56397] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr [12:57:31:961] [56393:56397] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rail

[12:57:41:620] [56393:56397] [INFO][com.freerdp.gdi] - Local framebuffer format PIXEL_FORMAT_BGRX32 [12:57:41:620] [56393:56397] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16 [12:57:41:657] [56393:56439] [INFO][com.freerdp.channels.rdpdr.client] - Loading device service drive [media] (static) [12:57:41:657] [56393:56439] [INFO][com.freerdp.channels.rdpdr.client] - Loading device service smartcard (static) [12:57:41:657] [56393:56439] [INFO][com.freerdp.channels.rdpdr.client] - Loading device service printer (static) [12:57:41:657] [56393:56439] [ERROR][com.winpr.library] - LoadLibraryA: /usr/local/lib/freerdp2/libprinter-client.so: cannot open shared object: File not found [12:57:41:657] [56393:56439] [WARN][com.freerdp.addin] - Failed to load channel printer [(nil)] [12:57:41:657] [56393:56439] [INFO][com.freerdp.channels.rdpdr.client] - freerdp_load_channel_addin_entry failed! [12:57:41:657] [56393:56439] [ERROR][com.freerdp.channels.rdpdr.client] - devman_load_device_service failed with error 1359! [12:57:41:657] [56393:56439] [ERROR][com.freerdp.channels.rdpdr.client] - rdpdr_process_connect failed with error 1359! [12:57:41:658] [56393:56397] [ERROR][com.freerdp.core] - rdpdr_virtual_channel_client_thread reported an error. Error was 1359 [12:57:41:658] [56393:56397] [INFO][com.freerdp.client.x11] - Network disconnect! [12:57:41:658] [56393:56397] [ERROR][com.freerdp.client.x11] - Failed to check FreeRDP file descriptor

Is curious the not found /usr/local/lib/freerdp2/libprinter-client.so error. On older commits, this file was present.

EDITED: it seems that compiling with -DWITH_CUPS=ON creates the libprinter-client shared object.

Once the libprinter-client error disappear, it connects as expected :D

adocampo avatar May 26 '17 11:05 adocampo

Fix merged, closing.

akallabeth avatar Jun 06 '17 08:06 akallabeth