Aureon
Aureon

Reputation: 387

Sharing a folder fails due to WINS name resolution

I am trying to set up a shared folder with an old Win CE 5.0 device I am using to learn and improve my C# skills.

Possible options to do this can be done via console: net use sharedfolder \\mypc /user:foo /password:bar, to start an extra process from my C# application which then runs the console with the previous parameters or by using the function WNetAddConnection3.

However, I receive every time Error 53, ERROR_BAD_NETWORK_PATH. I have checked the connection, as well as the path - always error 53.

A connection between another PC and \\mypc works fine without any problems. By comparison of my PC's network connection with the Win CE 5.0 device I have found out that there is only one difference: the Win CE 5.0 device has one WINS-server less. After setting the IP profile manually (IP Address, Subnet Mask, Default Gateway, DHCP, WINS), as well as adding the missing WINS-server, the problem disappears and the folder has been mounted successfully.

How can I fix this problem without changing the IP profile by hand?

Upvotes: 0

Views: 1584

Answers (1)

josef
josef

Reputation: 5959

In a normal network the WINS will be set by the DHCP server. The WINS entry of a network connection can also be set manually.

The problem with network sharing on Windows Mobile (WM) and Windows CE (WCE) is that it does not allow IP addresses, it only accepts windows network names. If you do not have WINS, a netbios network name can be resolved by the network card using a hosts entry, a broadcast or a WINS server.

As you do not have access to the DHCP settings of ActiveSync, you can either set WINS manually or by code or simply add a host entry for the connected PC. The activesync connected PC will can act as WINS server or , when you enter the netbios name for the netbios share server, the device can simply translate the netbios name to an IP. So either use the activesynced PC or the netbios server IP address as a WINS entry or add the name and IP of the sharing PC to the WCE/WM hosts table (registry: http://windowsmobilepro.blogspot.de/2006/04/etchosts-file-equivalent-in-windows.html).

[HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\hello]
"ipaddr"=hex:a1,a3,a5,a9
"ExpireTime"=hex:99,99,99,99,99,99,99

I recommend to use the hosts entry solution and enter the name to use and the IP of the server you want to use.

Upvotes: 0

Related Questions