Solved

netbios(NCB)

Posted on 1999-01-26
3
482 Views
Last Modified: 2013-12-03
Calling netbios(NCB) in Win98 to send a broadcast over the
LAN using NETBEUI returns without error but doesn't send
the broadcast.
The same program runs properly under DOS 6.22 by using
int 5Ch. In Win98 I call netbios(NCB) instead.
Is there something to pay attention to ?
Thanks
 
0
Comment
Question by:mimicrosoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
stefanr earned 200 total points
ID: 1419278
By experience from Windows NT I suspect that you are using a LANA number that is not connected to the proper protocol on the other machine(s). There is one LANA number for each one of the installed network cards AND each protocol. There is no simple way of knowing which LANA number that corresponds to which card and protocol (at least programatically). Therefore you have to test all available LANA numbers, and then use the one(s) that works, or simply broadcast on all LANA numbers in turn (the 'ncb_lana_num' member in the NCB struct).
0
 

Author Comment

by:mimicrosoft
ID: 1419279
Thank you very much for your hint. I've found the right ncb_lana_num experimentally and my test-program runs properly now.
Do you mean retrieving the wanted ncb_lana_num by using the adapter-status-command could be the right way ?

Remark:
I've found a difference to DOS, because adding the same local
name to the name-table again returns a new ncb_num  and doesn't return a duplicate-name-error as expected.

Regards,

Gerhard
0
 
LVL 3

Expert Comment

by:stefanr
ID: 1419280
It is hard to know programatically which LANA number to use when communication with different machines, so the best way is to enumerate all possible LANA numbers using the NCBENUM command, and then send to all of them in turn. I'm not sure if it works on Windows 98 though.
If not, maybe sending to the numbers 0 to 16 or some other maximum value would work. You could perhaps test which numbers works by checking the return code. If it is NRC_BRIDGE it would mean that the LANA number is invalid. I think that the numbers are consecutive, so the first invalid number would exclude all higher numbers too.
I do not think that the NCBSSTAT command would be so useful in this case, since it is used when the LANA number is known already.
If you were using a stream connection instead of a broadcast, the method above could be refined further. After having found the valid LANA numbers, you can test which LANA number(s) that is actually connected to the remote application by doing some custom handshaking. Send a custom message to each one of the valid LANA numbers, and let the remote application send back a custom ACK message on the LANA number(s) on that machine where the message were received. Then you could select a single LANA number on each machine (the LANA numbers are most likely different on each one) to communicate between them.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Duplicates in Aggregate Query 3 50
Nest Related files not working in Visual Studio 4 82
SignTool Error with Windows 10 5 220
Mobile apps - web/native or hybrid? 1 73
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question