#include "netapi32.h"
#include "nbcmdqueue.h"
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (netbios) |
|
static UCHAR | nbResizeAdapterTable (UCHAR newSize) |
|
void | NetBIOSInit (void) |
|
void | NetBIOSShutdown (void) |
|
BOOL | NetBIOSRegisterTransport (ULONG id, NetBIOSTransport *transport) |
|
BOOL | NetBIOSRegisterAdapter (ULONG transport, DWORD ifIndex, void *data) |
|
void | NetBIOSEnableAdapter (UCHAR lana) |
|
static void | nbShutdownAdapter (NetBIOSAdapter *adapter) |
|
static void | nbInternalEnum (void) |
|
UCHAR | NetBIOSNumAdapters (void) |
|
void | NetBIOSEnumAdapters (ULONG transport, NetBIOSEnumAdaptersCallback cb, void *closure) |
|
static NetBIOSAdapter * | nbGetAdapter (UCHAR lana) |
|
static UCHAR | nbEnum (PNCB ncb) |
|
static UCHAR | nbInternalHangup (NetBIOSAdapter *adapter, NetBIOSSession *session) |
|
static UCHAR | nbCancel (NetBIOSAdapter *adapter, PNCB ncb) |
|
static UCHAR | nbResizeAdapter (NetBIOSAdapter *adapter, UCHAR sessionsLen) |
|
static UCHAR | nbReset (NetBIOSAdapter *adapter, PNCB ncb) |
|
static UCHAR | nbSStat (NetBIOSAdapter *adapter, PNCB ncb) |
|
static UCHAR | nbCall (NetBIOSAdapter *adapter, PNCB ncb) |
|
static UCHAR | nbSend (NetBIOSAdapter *adapter, PNCB ncb) |
|
static UCHAR | nbRecv (NetBIOSAdapter *adapter, PNCB ncb) |
|
static UCHAR | nbHangup (NetBIOSAdapter *adapter, const NCB *ncb) |
|
void | NetBIOSHangupSession (const NCB *ncb) |
|
static UCHAR | nbAStat (NetBIOSAdapter *adapter, PNCB ncb) |
|
static UCHAR | nbDispatch (NetBIOSAdapter *adapter, PNCB ncb) |
|
static DWORD WINAPI | nbCmdThread (LPVOID lpVoid) |
|
UCHAR WINAPI | Netbios (PNCB ncb) |
|
DWORD WINAPI | NetpNetBiosStatusToApiStatus (DWORD nrc) |
|
◆ ADAPTERS_INCR
◆ DEFAULT_NUM_SESSIONS
#define DEFAULT_NUM_SESSIONS 16 |
◆ NetBIOSAdapter
◆ NetBIOSAdapterTable
◆ NetBIOSSession
◆ NetBIOSTransportTableEntry
◆ nbAStat()
Definition at line 679 of file netbios.c.
680{
682
688
691 {
693
695 }
697}
struct _ADAPTER_STATUS * PADAPTER_STATUS
UCHAR ncb_callname[NCBNAMSZ]
Referenced by nbDispatch().
◆ nbCall()
Definition at line 541 of file netbios.c.
542{
544
546
551
554 ;
555 if (i < adapter->sessionsLen)
556 {
562 }
563 else
566
568 {
572 {
575 }
576 else
577 {
580 }
581 }
584}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define SESSION_ESTABLISHED
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
Referenced by nbDispatch().
◆ nbCancel()
Definition at line 371 of file netbios.c.
372{
374
376
379
381 {
389 break;
390
391
392
399 {
404 else
405 {
409 }
410 break;
411 }
412
413 default:
415 }
418}
static UCHAR nbInternalHangup(NetBIOSAdapter *adapter, NetBIOSSession *session)
UCHAR NBCmdQueueCancel(struct NBCmdQueue *queue, PNCB ncb)
Referenced by Netbios().
◆ nbCmdThread()
Definition at line 763 of file netbios.c.
764{
766
767 if (ncb)
768 {
771
774 else
777 if (ncb->ncb_post)
778 ncb->ncb_post(ncb);
781 }
782 return 0;
783}
static UCHAR nbDispatch(NetBIOSAdapter *adapter, PNCB ncb)
static NetBIOSAdapter * nbGetAdapter(UCHAR lana)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Referenced by Netbios().
◆ nbDispatch()
Definition at line 699 of file netbios.c.
700{
702
704
707
711 else
712 {
715 {
717 {
720 break;
721
722
723
724
730 break;
731
734 break;
735
738 break;
739
742 break;
743
745 if (
adapter->transport->findName)
747 ncb);
748 else
750 break;
751
752 default:
755 }
757 }
758 }
761}
static UCHAR nbRecv(NetBIOSAdapter *adapter, PNCB ncb)
static UCHAR nbAStat(NetBIOSAdapter *adapter, PNCB ncb)
static UCHAR nbHangup(NetBIOSAdapter *adapter, const NCB *ncb)
static UCHAR nbReset(NetBIOSAdapter *adapter, PNCB ncb)
static UCHAR nbSend(NetBIOSAdapter *adapter, PNCB ncb)
static UCHAR nbCall(NetBIOSAdapter *adapter, PNCB ncb)
UCHAR NBCmdQueueComplete(struct NBCmdQueue *queue, PNCB ncb, UCHAR retcode)
UCHAR NBCmdQueueAdd(struct NBCmdQueue *queue, PNCB ncb)
Referenced by nbCmdThread(), and Netbios().
◆ nbEnum()
Definition at line 342 of file netbios.c.
343{
346
347 TRACE(
": ncb %p\n", ncb);
348
349 if (!lanas)
353 else
354 {
359 {
362 }
364 }
367}
static NetBIOSAdapterTable gNBTable
static void nbInternalEnum(void)
struct _LANA_ENUM * PLANA_ENUM
NetBIOSTransport * transport
Referenced by Netbios().
◆ nbGetAdapter()
◆ nbHangup()
◆ nbInternalEnum()
◆ nbInternalHangup()
◆ nbRecv()
◆ nbReset()
Definition at line 453 of file netbios.c.
454{
456
458
461
463 {
465
467
475 else if (
adapter->sessionsLen == 0)
477 else
478 resizeTo = 0;
479 if (resizeTo > 0)
481 else
484 }
485 else
490}
#define InterlockedIncrement
#define InterlockedDecrement
#define DEFAULT_NUM_SESSIONS
static UCHAR nbResizeAdapter(NetBIOSAdapter *adapter, UCHAR sessionsLen)
UCHAR NBCmdQueueCancelAll(struct NBCmdQueue *queue)
Referenced by nbDispatch().
◆ nbResizeAdapter()
Definition at line 427 of file netbios.c.
428{
430
432 {
434
439 else
442 if (newSessions)
443 {
444 adapter->sessions = newSessions;
445 adapter->sessionsLen = sessionsLen;
446 }
447 else
449 }
451}
Referenced by nbReset().
◆ nbResizeAdapterTable()
static UCHAR nbResizeAdapterTable |
( |
UCHAR |
newSize | ) |
|
|
static |
◆ nbSend()
◆ nbShutdownAdapter()
Definition at line 243 of file netbios.c.
244{
246 {
249 if (
adapter->transport->cleanupAdapter)
252 adapter->cs.DebugInfo->Spare[0] = 0;
255 }
256}
void NBCmdQueueDestroy(struct NBCmdQueue *queue)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
Referenced by nbInternalEnum().
◆ nbSStat()
Definition at line 492 of file netbios.c.
493{
496
498
504
512 {
515 {
517 {
519
528 buf->rcvs_outstanding =
buf->sends_outstanding = 0;
530 }
531 else
533 }
534 }
536
539}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
GLenum GLuint GLenum GLsizei const GLchar * buf
struct _SESSION_HEADER SESSION_HEADER
struct _SESSION_HEADER * PSESSION_HEADER
struct _SESSION_BUFFER * PSESSION_BUFFER
struct _SESSION_BUFFER SESSION_BUFFER
Referenced by Netbios().
◆ Netbios()
Definition at line 785 of file netbios.c.
786{
788
789 TRACE(
"ncb = %p\n", ncb);
790
792
793 TRACE(
"ncb_command 0x%02x, ncb_lana_num %d, ncb_buffer %p, ncb_length %d\n",
796
800 {
801 FIXME(
"NCBADDNAME: stub, returning success\n");
803 }
804 else
805 {
807
808
809
810
816 else
817 {
822 else
823 {
824
831 else
832 {
834 {
837
839 {
846 }
847 else
850 }
851 else
854 }
855 }
856 }
857 }
860}
DWORD WINAPI ResumeThread(IN HANDLE hThread)
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)
static UCHAR nbEnum(PNCB ncb)
static UCHAR nbCancel(NetBIOSAdapter *adapter, PNCB ncb)
static UCHAR nbSStat(NetBIOSAdapter *adapter, PNCB ncb)
static DWORD WINAPI nbCmdThread(LPVOID lpVoid)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Referenced by SvcNetBiosReset().
◆ NetBIOSEnableAdapter()
◆ NetBIOSEnumAdapters()
Definition at line 296 of file netbios.c.
298{
299 TRACE(
"transport 0x%08x, callback %p, closure %p\n", transport,
cb,
300 closure);
302 {
305
308 {
312 }
315 numLANAs++;
316 if (numLANAs > 0)
317 {
319
325 }
327 }
328}
static HMODULE MODULEINFO DWORD cb
Referenced by NetBTEnum(), and NetWkstaTransportEnum().
◆ NetBIOSHangupSession()
◆ NetBIOSInit()
Public functions
Definition at line 103 of file netbios.c.
104{
108}
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
PCRITICAL_SECTION_DEBUG DebugInfo
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Referenced by DllMain().
◆ NetBIOSNumAdapters()
◆ NetBIOSRegisterAdapter()
Definition at line 175 of file netbios.c.
176{
179
180 TRACE(
": transport 0x%08x, ifIndex 0x%08x, data %p\n", transport, ifIndex,
183 ;
185 {
187
188 TRACE(
": found transport %p for id 0x%08x\n", transportPtr, transport);
189
194 ;
196 {
198
201 else
204 }
206 {
207 TRACE(
": registering as LANA %d\n",
i);
218 }
220 }
221 else
225}
static UCHAR nbResizeAdapterTable(UCHAR newSize)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
struct NBCmdQueue * NBCmdQueueCreate(HANDLE heap)
struct NBCmdQueue * cmdQueue
Referenced by NetBTRegisterAdapter().
◆ NetBIOSRegisterTransport()
Definition at line 131 of file netbios.c.
132{
134
135 TRACE(
": transport 0x%08x, p %p\n",
id, transport);
136 if (!transport)
139 {
142 }
143 else
144 {
146
149 {
151 {
152 WARN(
"Replacing NetBIOS transport ID %d\n",
id);
156 }
157 }
159 {
165 }
166 }
169}
Referenced by NetBTInit().
◆ NetBIOSShutdown()
Definition at line 110 of file netbios.c.
111{
113
116 {
121 }
129}
#define HeapFree(x, y, z)
NetBIOSCleanupAdapter cleanupAdapter
Referenced by DllMain().
◆ NetpNetBiosStatusToApiStatus()
Definition at line 862 of file netbios.c.
863{
865
866 switch (nrc)
867 {
870 break;
873 break;
876 break;
879 break;
882 break;
885 break;
888 break;
891 break;
894 break;
897 break;
900 break;
901 default:
903 }
905}
#define ERROR_INVALID_PARAMETER
#define NERR_TooManyNames
#define NERR_NameNotFound
#define NERR_DuplicateName
#define NERR_AlreadyExists
#define NERR_NetworkError
#define NERR_NoNetworkResource
#define ERROR_REM_NOT_LIST
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
netbios |
| ) |
|
◆ gNBTable
Definition at line 80 of file netbios.c.
Referenced by nbEnum(), nbGetAdapter(), nbInternalEnum(), nbResizeAdapterTable(), Netbios(), NetBIOSEnableAdapter(), NetBIOSEnumAdapters(), NetBIOSInit(), NetBIOSNumAdapters(), NetBIOSRegisterAdapter(), and NetBIOSShutdown().
◆ gNumTransports
◆ gTransports