ReactOS  0.4.14-dev-583-g2a1ba2c
nb30.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ACTION_HEADER
 
struct  _ADAPTER_STATUS
 
struct  _FIND_NAME_BUFFER
 
struct  _FIND_NAME_HEADER
 
struct  _LANA_ENUM
 
struct  _NAME_BUFFER
 
struct  _NCB
 
struct  _SESSION_BUFFER
 
struct  _SESSION_HEADER
 

Macros

#define NCBNAMSZ   16
 
#define MAX_LANA   254
 
#define NAME_FLAGS_MASK   0x87
 
#define GROUP_NAME   0x80
 
#define UNIQUE_NAME   0x00
 
#define REGISTERING   0x00
 
#define REGISTERED   0x04
 
#define DEREGISTERED   0x05
 
#define DUPLICATE   0x06
 
#define DUPLICATE_DEREG   0x07
 
#define LISTEN_OUTSTANDING   0x01
 
#define CALL_PENDING   0x02
 
#define SESSION_ESTABLISHED   0x03
 
#define HANGUP_PENDING   0x04
 
#define HANGUP_COMPLETE   0x05
 
#define SESSION_ABORTED   0x06
 
#define ALL_TRANSPORTS   "M\0\0\0"
 
#define MS_NBF   "MNBF"
 
#define NCBCALL   0x10
 
#define NCBLISTEN   0x11
 
#define NCBHANGUP   0x12
 
#define NCBSEND   0x14
 
#define NCBRECV   0x15
 
#define NCBRECVANY   0x16
 
#define NCBCHAINSEND   0x17
 
#define NCBDGSEND   0x20
 
#define NCBDGRECV   0x21
 
#define NCBDGSENDBC   0x22
 
#define NCBDGRECVBC   0x23
 
#define NCBADDNAME   0x30
 
#define NCBDELNAME   0x31
 
#define NCBRESET   0x32
 
#define NCBASTAT   0x33
 
#define NCBSSTAT   0x34
 
#define NCBCANCEL   0x35
 
#define NCBADDGRNAME   0x36
 
#define NCBENUM   0x37
 
#define NCBUNLINK   0x70
 
#define NCBSENDNA   0x71
 
#define NCBCHAINSENDNA   0x72
 
#define NCBLANSTALERT   0x73
 
#define NCBACTION   0x77
 
#define NCBFINDNAME   0x78
 
#define NCBTRACE   0x79
 
#define ASYNCH   0x80
 
#define NRC_GOODRET   0x00
 
#define NRC_BUFLEN   0x01
 
#define NRC_ILLCMD   0x03
 
#define NRC_CMDTMO   0x05
 
#define NRC_INCOMP   0x06
 
#define NRC_BADDR   0x07
 
#define NRC_SNUMOUT   0x08
 
#define NRC_NORES   0x09
 
#define NRC_SCLOSED   0x0a
 
#define NRC_CMDCAN   0x0b
 
#define NRC_DUPNAME   0x0d
 
#define NRC_NAMTFUL   0x0e
 
#define NRC_ACTSES   0x0f
 
#define NRC_LOCTFUL   0x11
 
#define NRC_REMTFUL   0x12
 
#define NRC_ILLNN   0x13
 
#define NRC_NOCALL   0x14
 
#define NRC_NOWILD   0x15
 
#define NRC_INUSE   0x16
 
#define NRC_NAMERR   0x17
 
#define NRC_SABORT   0x18
 
#define NRC_NAMCONF   0x19
 
#define NRC_IFBUSY   0x21
 
#define NRC_TOOMANY   0x22
 
#define NRC_BRIDGE   0x23
 
#define NRC_CANOCCR   0x24
 
#define NRC_CANCEL   0x26
 
#define NRC_DUPENV   0x30
 
#define NRC_ENVNOTDEF   0x34
 
#define NRC_OSRESNOTAV   0x35
 
#define NRC_MAXAPPS   0x36
 
#define NRC_NOSAPS   0x37
 
#define NRC_NORESOURCES   0x38
 
#define NRC_INVADDRESS   0x39
 
#define NRC_INVDDID   0x3B
 
#define NRC_LOCKFAIL   0x3C
 
#define NRC_OPENERR   0x3f
 
#define NRC_SYSTEM   0x40
 
#define NRC_PENDING   0xff
 
#define NCB_POST   void CALLBACK
 

Typedefs

typedef struct _ACTION_HEADER ACTION_HEADER
 
typedef struct _ACTION_HEADERPACTION_HEADER
 
typedef struct _ADAPTER_STATUS ADAPTER_STATUS
 
typedef struct _ADAPTER_STATUSPADAPTER_STATUS
 
typedef struct _FIND_NAME_BUFFER FIND_NAME_BUFFER
 
typedef struct _FIND_NAME_BUFFERPFIND_NAME_BUFFER
 
typedef struct _FIND_NAME_HEADER FIND_NAME_HEADER
 
typedef struct _FIND_NAME_HEADERPFIND_NAME_HEADER
 
typedef struct _LANA_ENUM LANA_ENUM
 
typedef struct _LANA_ENUMPLANA_ENUM
 
typedef struct _NAME_BUFFER NAME_BUFFER
 
typedef struct _NAME_BUFFERPNAME_BUFFER
 
typedef struct _NCB NCB
 
typedef struct _NCBPNCB
 
typedef struct _SESSION_BUFFER SESSION_BUFFER
 
typedef struct _SESSION_BUFFERPSESSION_BUFFER
 
typedef struct _SESSION_HEADER SESSION_HEADER
 
typedef struct _SESSION_HEADERPSESSION_HEADER
 

Functions

UCHAR WINAPI Netbios (PNCB)
 

Macro Definition Documentation

◆ ALL_TRANSPORTS

#define ALL_TRANSPORTS   "M\0\0\0"

Definition at line 23 of file nb30.h.

◆ ASYNCH

#define ASYNCH   0x80

Definition at line 51 of file nb30.h.

◆ CALL_PENDING

#define CALL_PENDING   0x02

Definition at line 18 of file nb30.h.

◆ DEREGISTERED

#define DEREGISTERED   0x05

Definition at line 14 of file nb30.h.

◆ DUPLICATE

#define DUPLICATE   0x06

Definition at line 15 of file nb30.h.

◆ DUPLICATE_DEREG

#define DUPLICATE_DEREG   0x07

Definition at line 16 of file nb30.h.

◆ GROUP_NAME

#define GROUP_NAME   0x80

Definition at line 10 of file nb30.h.

◆ HANGUP_COMPLETE

#define HANGUP_COMPLETE   0x05

Definition at line 21 of file nb30.h.

◆ HANGUP_PENDING

#define HANGUP_PENDING   0x04

Definition at line 20 of file nb30.h.

◆ LISTEN_OUTSTANDING

#define LISTEN_OUTSTANDING   0x01

Definition at line 17 of file nb30.h.

◆ MAX_LANA

#define MAX_LANA   254

Definition at line 8 of file nb30.h.

◆ MS_NBF

#define MS_NBF   "MNBF"

Definition at line 24 of file nb30.h.

◆ NAME_FLAGS_MASK

#define NAME_FLAGS_MASK   0x87

Definition at line 9 of file nb30.h.

◆ NCB_POST

#define NCB_POST   void CALLBACK

Definition at line 91 of file nb30.h.

◆ NCBACTION

#define NCBACTION   0x77

Definition at line 48 of file nb30.h.

◆ NCBADDGRNAME

#define NCBADDGRNAME   0x36

Definition at line 42 of file nb30.h.

◆ NCBADDNAME

#define NCBADDNAME   0x30

Definition at line 36 of file nb30.h.

◆ NCBASTAT

#define NCBASTAT   0x33

Definition at line 39 of file nb30.h.

◆ NCBCALL

#define NCBCALL   0x10

Definition at line 25 of file nb30.h.

◆ NCBCANCEL

#define NCBCANCEL   0x35

Definition at line 41 of file nb30.h.

◆ NCBCHAINSEND

#define NCBCHAINSEND   0x17

Definition at line 31 of file nb30.h.

◆ NCBCHAINSENDNA

#define NCBCHAINSENDNA   0x72

Definition at line 46 of file nb30.h.

◆ NCBDELNAME

#define NCBDELNAME   0x31

Definition at line 37 of file nb30.h.

◆ NCBDGRECV

#define NCBDGRECV   0x21

Definition at line 33 of file nb30.h.

◆ NCBDGRECVBC

#define NCBDGRECVBC   0x23

Definition at line 35 of file nb30.h.

◆ NCBDGSEND

#define NCBDGSEND   0x20

Definition at line 32 of file nb30.h.

◆ NCBDGSENDBC

#define NCBDGSENDBC   0x22

Definition at line 34 of file nb30.h.

◆ NCBENUM

#define NCBENUM   0x37

Definition at line 43 of file nb30.h.

◆ NCBFINDNAME

#define NCBFINDNAME   0x78

Definition at line 49 of file nb30.h.

◆ NCBHANGUP

#define NCBHANGUP   0x12

Definition at line 27 of file nb30.h.

◆ NCBLANSTALERT

#define NCBLANSTALERT   0x73

Definition at line 47 of file nb30.h.

◆ NCBLISTEN

#define NCBLISTEN   0x11

Definition at line 26 of file nb30.h.

◆ NCBNAMSZ

#define NCBNAMSZ   16

Definition at line 7 of file nb30.h.

◆ NCBRECV

#define NCBRECV   0x15

Definition at line 29 of file nb30.h.

◆ NCBRECVANY

#define NCBRECVANY   0x16

Definition at line 30 of file nb30.h.

◆ NCBRESET

#define NCBRESET   0x32

Definition at line 38 of file nb30.h.

◆ NCBSEND

#define NCBSEND   0x14

Definition at line 28 of file nb30.h.

◆ NCBSENDNA

#define NCBSENDNA   0x71

Definition at line 45 of file nb30.h.

◆ NCBSSTAT

#define NCBSSTAT   0x34

Definition at line 40 of file nb30.h.

◆ NCBTRACE

#define NCBTRACE   0x79

Definition at line 50 of file nb30.h.

◆ NCBUNLINK

#define NCBUNLINK   0x70

Definition at line 44 of file nb30.h.

◆ NRC_ACTSES

#define NRC_ACTSES   0x0f

Definition at line 64 of file nb30.h.

◆ NRC_BADDR

#define NRC_BADDR   0x07

Definition at line 57 of file nb30.h.

◆ NRC_BRIDGE

#define NRC_BRIDGE   0x23

Definition at line 76 of file nb30.h.

◆ NRC_BUFLEN

#define NRC_BUFLEN   0x01

Definition at line 53 of file nb30.h.

◆ NRC_CANCEL

#define NRC_CANCEL   0x26

Definition at line 78 of file nb30.h.

◆ NRC_CANOCCR

#define NRC_CANOCCR   0x24

Definition at line 77 of file nb30.h.

◆ NRC_CMDCAN

#define NRC_CMDCAN   0x0b

Definition at line 61 of file nb30.h.

◆ NRC_CMDTMO

#define NRC_CMDTMO   0x05

Definition at line 55 of file nb30.h.

◆ NRC_DUPENV

#define NRC_DUPENV   0x30

Definition at line 79 of file nb30.h.

◆ NRC_DUPNAME

#define NRC_DUPNAME   0x0d

Definition at line 62 of file nb30.h.

◆ NRC_ENVNOTDEF

#define NRC_ENVNOTDEF   0x34

Definition at line 80 of file nb30.h.

◆ NRC_GOODRET

#define NRC_GOODRET   0x00

Definition at line 52 of file nb30.h.

◆ NRC_IFBUSY

#define NRC_IFBUSY   0x21

Definition at line 74 of file nb30.h.

◆ NRC_ILLCMD

#define NRC_ILLCMD   0x03

Definition at line 54 of file nb30.h.

◆ NRC_ILLNN

#define NRC_ILLNN   0x13

Definition at line 67 of file nb30.h.

◆ NRC_INCOMP

#define NRC_INCOMP   0x06

Definition at line 56 of file nb30.h.

◆ NRC_INUSE

#define NRC_INUSE   0x16

Definition at line 70 of file nb30.h.

◆ NRC_INVADDRESS

#define NRC_INVADDRESS   0x39

Definition at line 85 of file nb30.h.

◆ NRC_INVDDID

#define NRC_INVDDID   0x3B

Definition at line 86 of file nb30.h.

◆ NRC_LOCKFAIL

#define NRC_LOCKFAIL   0x3C

Definition at line 87 of file nb30.h.

◆ NRC_LOCTFUL

#define NRC_LOCTFUL   0x11

Definition at line 65 of file nb30.h.

◆ NRC_MAXAPPS

#define NRC_MAXAPPS   0x36

Definition at line 82 of file nb30.h.

◆ NRC_NAMCONF

#define NRC_NAMCONF   0x19

Definition at line 73 of file nb30.h.

◆ NRC_NAMERR

#define NRC_NAMERR   0x17

Definition at line 71 of file nb30.h.

◆ NRC_NAMTFUL

#define NRC_NAMTFUL   0x0e

Definition at line 63 of file nb30.h.

◆ NRC_NOCALL

#define NRC_NOCALL   0x14

Definition at line 68 of file nb30.h.

◆ NRC_NORES

#define NRC_NORES   0x09

Definition at line 59 of file nb30.h.

◆ NRC_NORESOURCES

#define NRC_NORESOURCES   0x38

Definition at line 84 of file nb30.h.

◆ NRC_NOSAPS

#define NRC_NOSAPS   0x37

Definition at line 83 of file nb30.h.

◆ NRC_NOWILD

#define NRC_NOWILD   0x15

Definition at line 69 of file nb30.h.

◆ NRC_OPENERR

#define NRC_OPENERR   0x3f

Definition at line 88 of file nb30.h.

◆ NRC_OSRESNOTAV

#define NRC_OSRESNOTAV   0x35

Definition at line 81 of file nb30.h.

◆ NRC_PENDING

#define NRC_PENDING   0xff

Definition at line 90 of file nb30.h.

◆ NRC_REMTFUL

#define NRC_REMTFUL   0x12

Definition at line 66 of file nb30.h.

◆ NRC_SABORT

#define NRC_SABORT   0x18

Definition at line 72 of file nb30.h.

◆ NRC_SCLOSED

#define NRC_SCLOSED   0x0a

Definition at line 60 of file nb30.h.

◆ NRC_SNUMOUT

#define NRC_SNUMOUT   0x08

Definition at line 58 of file nb30.h.

◆ NRC_SYSTEM

#define NRC_SYSTEM   0x40

Definition at line 89 of file nb30.h.

◆ NRC_TOOMANY

#define NRC_TOOMANY   0x22

Definition at line 75 of file nb30.h.

◆ REGISTERED

#define REGISTERED   0x04

Definition at line 13 of file nb30.h.

◆ REGISTERING

#define REGISTERING   0x00

Definition at line 12 of file nb30.h.

◆ SESSION_ABORTED

#define SESSION_ABORTED   0x06

Definition at line 22 of file nb30.h.

◆ SESSION_ESTABLISHED

#define SESSION_ESTABLISHED   0x03

Definition at line 19 of file nb30.h.

◆ UNIQUE_NAME

#define UNIQUE_NAME   0x00

Definition at line 11 of file nb30.h.

Typedef Documentation

◆ ACTION_HEADER

◆ ADAPTER_STATUS

◆ FIND_NAME_BUFFER

◆ FIND_NAME_HEADER

◆ LANA_ENUM

◆ NAME_BUFFER

◆ NCB

typedef struct _NCB NCB

◆ PACTION_HEADER

◆ PADAPTER_STATUS

◆ PFIND_NAME_BUFFER

◆ PFIND_NAME_HEADER

◆ PLANA_ENUM

◆ PNAME_BUFFER

◆ PNCB

typedef struct _NCB* PNCB

◆ PSESSION_BUFFER

◆ PSESSION_HEADER

◆ SESSION_BUFFER

◆ SESSION_HEADER

Function Documentation

◆ Netbios()

UCHAR WINAPI Netbios ( PNCB  )

Definition at line 785 of file netbios.c.

786 {
787  UCHAR ret, cmd;
788 
789  TRACE("ncb = %p\n", ncb);
790 
791  if (!ncb) return NRC_INVADDRESS;
792 
793  TRACE("ncb_command 0x%02x, ncb_lana_num %d, ncb_buffer %p, ncb_length %d\n",
794  ncb->ncb_command, ncb->ncb_lana_num, ncb->ncb_buffer, ncb->ncb_length);
795  cmd = ncb->ncb_command & 0x7f;
796 
797  if (cmd == NCBENUM)
798  ncb->ncb_retcode = ncb->ncb_cmd_cplt = ret = nbEnum(ncb);
799  else if (cmd == NCBADDNAME)
800  {
801  FIXME("NCBADDNAME: stub, returning success\n");
802  ncb->ncb_retcode = ncb->ncb_cmd_cplt = ret = NRC_GOODRET;
803  }
804  else
805  {
806  NetBIOSAdapter *adapter;
807 
808  /* Apps not specifically written for WinNT won't do an NCBENUM first,
809  * so make sure the table has been enumerated at least once
810  */
811  if (!gNBTable.enumerated)
812  nbInternalEnum();
813  adapter = nbGetAdapter(ncb->ncb_lana_num);
814  if (!adapter)
815  ret = NRC_BRIDGE;
816  else
817  {
818  if (adapter->shuttingDown)
819  ret = NRC_IFBUSY;
820  else if (adapter->resetting)
821  ret = NRC_TOOMANY;
822  else
823  {
824  /* non-asynch commands first */
825  if (cmd == NCBCANCEL)
826  ncb->ncb_retcode = ncb->ncb_cmd_cplt = ret =
827  nbCancel(adapter, ncb);
828  else if (cmd == NCBSSTAT)
829  ncb->ncb_retcode = ncb->ncb_cmd_cplt = ret =
830  nbSStat(adapter, ncb);
831  else
832  {
833  if (ncb->ncb_command & ASYNCH)
834  {
837 
838  if (thread != NULL)
839  {
840  ncb->ncb_retcode = ncb->ncb_cmd_cplt = NRC_PENDING;
841  if (ncb->ncb_event)
842  ResetEvent(ncb->ncb_event);
845  ret = NRC_GOODRET;
846  }
847  else
848  ncb->ncb_retcode = ncb->ncb_cmd_cplt = ret =
850  }
851  else
852  ncb->ncb_retcode = ncb->ncb_cmd_cplt = ret =
853  nbDispatch(adapter, ncb);
854  }
855  }
856  }
857  }
858  TRACE("returning 0x%02x\n", ret);
859  return ret;
860 }
#define NRC_IFBUSY
Definition: nb30.h:74
#define CloseHandle
Definition: compat.h:406
static UCHAR nbSStat(NetBIOSAdapter *adapter, PNCB ncb)
Definition: netbios.c:492
#define NRC_GOODRET
Definition: nb30.h:52
#define NCBENUM
Definition: nb30.h:43
Definition: ftp_var.h:139
static NetBIOSAdapter * nbGetAdapter(UCHAR lana)
Definition: netbios.c:330
char * cmd
Definition: vfdcmd.c:85
#define NCBCANCEL
Definition: nb30.h:41
#define NCBADDNAME
Definition: nb30.h:36
#define CREATE_SUSPENDED
Definition: winbase.h:178
#define NCBSSTAT
Definition: nb30.h:40
static void nbInternalEnum(void)
Definition: netbios.c:258
#define FIXME(fmt,...)
Definition: debug.h:110
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
BOOL shuttingDown
Definition: netbios.c:58
#define ASYNCH
Definition: nb30.h:51
#define NRC_PENDING
Definition: nb30.h:90
#define NRC_TOOMANY
Definition: nb30.h:75
static NetBIOSAdapterTable gNBTable
Definition: netbios.c:80
static DWORD WINAPI nbCmdThread(LPVOID lpVoid)
Definition: netbios.c:763
static HANDLE thread
Definition: service.c:33
unsigned char UCHAR
Definition: xmlstorage.h:181
int ret
static UCHAR nbDispatch(NetBIOSAdapter *adapter, PNCB ncb)
Definition: netbios.c:699
#define NRC_BRIDGE
Definition: nb30.h:76
LONG resetting
Definition: netbios.c:59
static UCHAR nbEnum(PNCB ncb)
Definition: netbios.c:342
static UCHAR nbCancel(NetBIOSAdapter *adapter, PNCB ncb)
Definition: netbios.c:371
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
#define NRC_INVADDRESS
Definition: nb30.h:85
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:566
#define NRC_OSRESNOTAV
Definition: nb30.h:81

Referenced by SvcNetBiosReset().