Slobodan,
Hi Tony,
I have been battling with NETBIOS for almost last two months but from much different level and for different purpose. (Unfortunately
I must do much more settings that you need from "Limited user account" :-( What I'm trying to accomplish is on scale next to
impossible).
XPE-DEVICE is some NetBIOS name. What that name mean is not certain.
"XPE-DEVICE " This would be for instance NetBIOS name of SMB server.
NetBIOS names are 15 ASCII characters long. 16th byte is value (0-255) that describe service that NetBIOS name describe. There
is
a
table of these values defined.
0x20 (Space character) represent for instance SMB server representation per that table.
MSDN says: "The NetBIOS name is derived from the host name, but the two names might not be identical. The NetBIOS name is a 16-byte
string that uniquely identifies a computer or service for network communication. It is used by all the Windows 2000 network services
to uniquely identify themselves. If the DNS host name is 15 or fewer bytes, the NetBIOS name is the host name plus enough spaces to
form a 15-byte name, followed by a unique identifier, the sixteenth byte, that specifies the network service. If the DNS host name
is longer than 15 bytes, then by default, the NetBIOS name is the host name, truncated to 15 bytes, plus the service identifier. If
you try to create two DNS host names and the first 15 bytes are the same, you are prompted to enter a new name for NetBIOS."
It also says: "The NetBIOS name is used to uniquely identify the NetBIOS services listening on the first IP address that is bound to
an adapter. This unique NetBIOS name is resolved to the IP address of the server through broadcast, WINS, or the LMHosts file. By
default, it is the same as the host name up to 15 bytes, plus any spaces necessary to make the name 15 bytes long, plus the service
identifier.
The NetBIOS name is also known as a NetBIOS computer name.
For example, a NetBIOS name might be Client1."
This is just to confirm the point.
Regards,
Konstantin
If you want to specify certain IP addresses to NetBT driver then you will have to use undocumented IOCTL values on
\Device\NetBT_Tcpip_{GUID} to set remove NetBIOS/service names to IP addresses.
IOCTL code for netbt driver used for adding new name to cache for selected adapter is 0x2100d0.
I have no idea if this can help you, but you have a better start then I had.
Regards,
Slobodan
KM,
I made sure that the EnableLMHOSTS vaule was set to 1.
I then tried adding the computer name to the lmhosts
file as follows:
192.168.100.101 XPE-DEVICE
(Note: "XPE-DEVICE" is the name of my computer - the
name returned when you type "hostname" at a command
prompt)
This still does not work. I have tried this in the
hosts file as well with the same results. From my
own experiments, it seems that the hosts file can be
used to resolve any name _except_ the computer's own
name. I have seen this on full blown Windows PCs
as well. Is this true?
Also, I did not see a RandomAdapter parameter.
Should it have been there?
Thanks.
- Tony H.
KM wrote:
Tony,
I read your message. What was not clear to me why changing lmhosts on
the machine with the 3rd party software running did not help?
I mean if you set it in lmhosts that particular name is bound to a
particular IP address, then you will have more predictable
behavior from the 3rd party software that calls to gethostbyname.
Just make sure that "EnableLMHOSTS" value set to dword:1 under
[HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters].
Also look at the "RandomAdapter" parameter of NetBT
([HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters]).
--
Regards,
KM, BSquare Corp.
Hi Slobodan,
That answer was almost there, but not exactly what I am looking
for. I
can already add IP Addresses to network connectors using "netsh
interface ip add ..." in a predictable manner.
But when my 3rd party application goes to bind its Windows sockets,
which network connector will it use to retrieve the binding IP
Address
from? I need it to always bind to "Local Area Connection," but I
have
seen it bind to "Local Area Connection 2" on other identical
targets.
I posted this question on the XP networking newsgroup as well and
have
not received any responses. Perhaps I am trying to do something
that
can not be done, or someething that is not commonly done in
embedded
systems.
Thanks again.
- Tony H.