[comp.windows.ms] NetBios and MS Windows

lau@kings.wharton.upenn.edu (Yan K. Lau) (06/01/89)

Has anyone written applications using NetBios calls in Windows?
I have an application that works most of the time but it sometimes
crashes.  It seems to be sensitive to when network messages are
received.  The usual symtoms of failure is either a FatalExit or
unresponsive mouse.  Sometime the mouse cursor is gone.  Other
times mouse movement is okay but selecting any of menu options
doesn't display a pull-down menu but rather gives a beep.

Yan.
==============================================================================
      Yan K. Lau                    + the last message of a newgroup will be:
   )~                               +   a) longer than one screen &
 ~/~  lau@scrolls.wharton.upenn.edu +   b) something you're not interested in.
 /\_                                + your decision, 'n' key or space bar?
==============================================================================

jjb@sequent.UUCP (Jeff Berkowitz) (06/05/89)

In article <11567@netnews.upenn.edu> lau@kings.wharton.upenn.edu (Yan K. Lau) writes:
>Has anyone written applications using NetBios calls in Windows?
>I have an application that works most of the time but it sometimes
>crashes.  It seems to be sensitive to when network messages are
>received...

Unfortunately you haven't detailed the NetBIOS implementation (true blue
or clone, like Excelan?  Ancient IBM PC LAN product or Token Ring?)
Some NetBIOS implementations are "non-reentrant": you are not permitted
to issue a NetBIOS (int 5C) command while running in a postback routine.
Other implementations allow this.

You also haven't detailed the scheme you're using with the NetBIOS:
postbacks or polling?  It's quite possible to post back into Windows
code, so long as the relevant code and data segments are locked (the
various Windows gurus out there will no doubt mention the evils of
global locking, and their warnings should be heeded).  I am not aware
of any scheme that allows postback code (which is actually interrupt
code) to issue Windows calls; about all it can do is set a flag, which
is checked by a Windows timer routine.  (Anyone know how to synchronize
real interrupt code with the Windows kernel?).

Finally, we found that some of the clone NetBIOS implementations just
don't work very well.  Try to find another user of the same software
and compare experiences.  Call the vendor and keep calling.

Good Luck!
Disclaimer: these experiences have nothing to do with my present employer.
-- 
Jeff Berkowitz N6QOM			uunet!sequent!jjb
Sequent Computer Systems		Custom Systems Group

michaelt@microsoft.UUCP (Michael Thurlkill 1/1029) (06/05/89)

In article <11567@netnews.upenn.edu> lau@kings.wharton.upenn.edu (Yan K. Lau) writes:
>Has anyone written applications using NetBios calls in Windows?
>I have an application that works most of the time but it sometimes
>crashes.  It seems to be sensitive to when network messages are
>received.  The usual symtoms of failure is either a FatalExit or
>unresponsive mouse.  Sometime the mouse cursor is gone.  Other
>times mouse movement is okay but selecting any of menu options
>doesn't display a pull-down menu but rather gives a beep.
>
There are a couple common things that will cause this:
1. If you have an asynchronous notification routine, it is being moved
   or banked out. It must be in a fixed code segment DLL. Also, memory
   associated with the notification routine should be fixed and non-
   bankable (see #2).
2. If you are polling the NCB, the NCB is being moved or banked out.
   It must be GlobalAlloced with GMEM_NOT_BANKED, and must be either
   GMEM_FIXED, or locked prior to the asynchronous netbios call.

Basically, something is moving, and memory is getting walked on.
That's my best guess.

Mike Thurlkill