Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "NCB" in [All]

kernel32

.
Summary
The Netbios function interprets and executes the specified network control block (NCB). The Netbios function is provided primarily for applications that were written for the NetBIOS interface and need to be ported to Windows. Applications not requiring compatibility with NetBIOS should use other interfaces, such as mailslots, named pipes, RPC, or distributed COM to accomplish tasks similar to those supported by NetBIOS. These other interfaces are more flexible and portable.
.

public struct _NCB

.

    public Commands ncb_command;      /* command code           */

.

    public byte   ncb_retcode;        /* return code            */

.

    public byte   ncb_lsn;        /* local session number       */

.

    public byte   ncb_num;        /* number of our network name     */

.

    //[MarshalAs(UnmanagedType.ByValArray, SizeConst = NCBNAMSZ)]

.

    public IntPtr ncb_buffer;         /* address of message buffer      */

.

    public ushort ncb_length;         /* size of message buffer     */

.

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = NativeMethods.NCBNAMSZ)]

.

    public byte[]   ncb_callname; /* blank-padded name of remote    */

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NativeMethods.NCBNAMSZ)]

.

    public byte[]   ncb_name;         /* our blank-padded netname       */

.

    public byte   ncb_rto;        /* rcv timeout/retry count    */

.

    public byte   ncb_sto;        /* send timeout/sys timeout       */

.

    public IntPtr postroutine;//void (CALLBACK *ncb_post)( struct _NCB * ); /* POST routine address    */

.

    public byte   ncb_lana_num;       /* lana (adapter) number      */

.

    public byte   ncb_cmd_cplt;       /* 0xff => commmand pending       */

.

    public byte[/*10*/]   ncb_reserve;    /* reserved, used by BIOS     */

.

    public IntPtr  ncb_event;         /* HANDLE to Win32 event which    */

.

static extern byte Netbios(ref _NCB controlBlock);

.

   ByRef pncb As NCB _

.

Private Const NCBNAMSZ As Integer = 16

.

Private Structure NCB

.

   Dim ncb_command As Byte

.

   Dim ncb_retcode As Byte

.

   Dim ncb_lsn As Byte

.

   Dim ncb_num As Byte

.

   Dim ncb_buffer As IntPtr

.

   Dim ncb_length As Short

.

   <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=NCBNAMSZ)> Dim ncb_callname As String

.

   <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=NCBNAMSZ)> Dim ncb_name As String

.

   Dim ncb_rto As Byte

.

   Dim ncb_sto As Byte

.

   Dim ncb_post As IntPtr

.

   Dim ncb_lana_num As Byte

.

   Dim ncb_cmd_cplt As Byte

.

   <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Dim ncb_reserve() As Byte

.

   Dim ncb_event As IntPtr

.

See Also: NCB, LANA_ENUM, ADAPTER_STATUS, NAME_BUFFER

.

Private Const NCBNAMSZ As Integer = 16

.

Private Const NCBRESET As Integer = &H32

.

Private Const NCBASTAT As Integer = &H33

.

Private Const NCBENUM As Integer = &H37

.

   Dim myNcb As New NCB

.

   ' load the NCB

.

   myNcb.ncb_command = NCBENUM

.

   myNcb.ncb_length = CShort(Marshal.SizeOf(myLana))

.

   myNcb.ncb_buffer = ptr

.

   bRet = Netbios(myNcb)

.

   myNcb.ncb_command = NCBRESET

.

   myNcb.ncb_lana_num = FirstLANA

.

   bRet = Netbios(myNcb)

.

   myNcb.ncb_command = NCBASTAT

.

   myNcb.ncb_lana_num = FirstLANA

.

   myNcb.ncb_callname = RemoteIP.PadRight(NCBNAMSZ, " "c)

.

   myNcb.ncb_buffer = ptr

.

   myNcb.ncb_length = CShort(Marshal.SizeOf(myASTAT))

.

   bRet = Netbios(myNcb)

.

For Windows 7 64 bit - make sure to compile platform as x86. Also, had to marshal each item in NCB structure to get it work:

.

  Public Structure NCB

.

    Public ncbCommand As Byte

.

    Public ncbRetcode As Byte

.

    Public ncbLSN As Byte

.

    Public ncbNum As Byte

.

    Public ncbBuffer As IntPtr

.

    Public ncbLength As Int16

.

           SizeConst:=netbstrcs.netNameLen)> Dim ncbCallname() As Byte

.

           SizeConst:=netbstrcs.netNameLen)> Dim ncbName() As Byte

.

    Public ncbRTO As Byte

.

    Public ncbSTO As Byte

.

    Public ncbPost As UInt32 'IntPtr

.

    Public ncbLANAnum As Byte

.

    Public ncbCmdCplt As Byte

.

           SizeConst:=netbstrcs.netresvLen)> Dim ncbReserve() As Byte

.

    Public ncbEvent As Int32 'IntPtr

Structures

.
Summary
The ADAPTER_STATUS structure contains information about a network adapter via the (NetBIOS) API call. This structure is pointed to by the ncb_buffer member of the NCB structure. ADAPTER_STATUS is followed by as many NAME_BUFFER structures as required to describe the network adapters on the system
.

    short free_ncbs;

.

    short max_cfg_ncbs;

.

    short max_ncbs;

.

   Dim free_ncbs As Short

.

   Dim max_cfg_ncbs As Short

.

   Dim max_ncbs As Short

.

   WORD    free_ncbs;

.

   WORD    max_cfg_ncbs;

.

   WORD    max_ncbs;

.
Summary
Used by the (NetBIOS) function to retrieve the list of LAN Adapters. The LANA_ENUM structure is pointed to by the ncb_buffer member of the NCB structure when an application issues the NCBENUM command.
.

Private Const NCBENUM As Integer = &H37

.

  *  Structure returned to the NCB command NCBENUM.

.
Summary
The NAME_BUFFER structure contains information about a local network name via the (NetBIOS) API Call. One or more NAME_BUFFER structures follows an ADAPTER_STATUS structure when an application specifies the NCBASTAT command in the ncb_command member of the NCB structure.
.

Private Const NCBNAMSZ As Integer = 16

.

   <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=NCBNAMSZ)> Dim Name As String

.

   UCHAR name[NCBNAMSZ];

5: NCB
.
Summary
.

     public static const int NCBNAMSZ=16;

.

    public struct NCB

.

        byte ncb_command;

.

        byte ncb_retcode;

.

        byte ncb_lsn;

.

        byte ncb_num;

.

        IntPtr ncb_buffer;

.

        short ncb_length;

.

        [MarshalAs(UnmanagedType.ByValTStr, SizeConst=NetbiosConstants.NCBNAMSZ)]

.

        String ncb_callname;

.

        [MarshalAs(UnmanagedType.ByValTStr, SizeConst=NetbiosConstants.NCBNAMSZ)]

.

        String ncb_name;

.

        byte ncb_rto;

.

        byte ncb_sto;

.

        IntPtr ncb_post;

.

        byte ncb_lana_num;

.

        byte ncb_cmd_cplt;

.

        byte[] ncb_reserve;

.

        IntPtr ncb_event;

.

Private Const NCBNAMSZ As Integer = 16

.

Private Structure NCB

.

   Dim ncb_command As Byte

.

   Dim ncb_retcode As Byte

.

   Dim ncb_lsn As Byte

.

   Dim ncb_num As Byte

.

   Dim ncb_buffer As IntPtr

.

   Dim ncb_length As Short

.

   <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=NCBNAMSZ)> Dim ncb_callname As String

.

   <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=NCBNAMSZ)> Dim ncb_name As String

.

   Dim ncb_rto As Byte

.

   Dim ncb_sto As Byte

.

   Dim ncb_post As IntPtr

.

   Dim ncb_lana_num As Byte

.

   Dim ncb_cmd_cplt As Byte

.

   <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Dim ncb_reserve() As Byte

.

   Dim ncb_event As IntPtr

.

Typedef struct _NCB {

.

   UCHAR   ncb_command;        /* command code           */

.

   UCHAR   ncb_retcode;        /* return code            */

.

   UCHAR   ncb_lsn;        /* local session number       */

.

   UCHAR   ncb_num;        /* number of our network name     */

.

   PUCHAR  ncb_buffer;         /* address of message buffer      */

.

   WORD    ncb_length;         /* size of message buffer     */

.

   UCHAR   ncb_callname[NCBNAMSZ]; /* blank-padded name of remote    */

.

   UCHAR   ncb_name[NCBNAMSZ];     /* our blank-padded netname       */

.

   UCHAR   ncb_rto;        /* rcv timeout/retry count    */

.

   UCHAR   ncb_sto;        /* send timeout/sys timeout       */

.

   void (CALLBACK *ncb_post)( struct _NCB * ); /* POST routine address    */

.

   UCHAR   ncb_lana_num;       /* lana (adapter) number      */

.

   UCHAR   ncb_cmd_cplt;       /* 0xff => commmand pending       */

.

   UCHAR   ncb_reserve[18];    /* reserved, used by BIOS     */

.

   UCHAR   ncb_reserve[10];    /* reserved, used by BIOS     */

.

   HANDLE  ncb_event;          /* HANDLE to Win32 event which    */

.

} NCB, *PNCB;

.
Documentation
[NCB] on MSDN

Interfaces

.

        /// <param name="lpfnCB">A callback function to monitor progress or abort.</param>

.

            [MarshalAs(UnmanagedType.Interface)] IBindStatusCallback lpfnCB);

coredll

.

¹ýqQÜF¬ˆþ]»æ±˜ø¨å©4-¯äξ[M Ϗræ1ðnE&ÃG¾"óàUæšõ)ŠSaájðýrŀ!kõ-@p‚ÅÍN›O êSr¢v<=¤ Û§‡ècýë„:áÄ[5鐸/ì$_h6všðå‚”hvôü$ÕO Ñ÷Ç4Å믊%/lÂ/\›¿<ÖVª:ŒSœ¿ºy{°¼'P}†n–]Á5I®sß··ü üÕ²xQÕ>%ÁŸdP‹¬m¸,fX<jЀ´xáZ[*Ô%lÝ»¯:ߨä@÷¸å:%×Ѕs;4`å±9‚I¶í¾¥ßDÅ·ì8°ó;YªÙaÃl:ì aº>Ì´›¯_à6žß`Kå ðãˆ|&ǵsV>)t,3*ŽL|ý¥°³7Zw~Vq¯Ôû3ÜÂ)äRÜ<ŰUÕÎo€›ó6Qúr(_ÕÛ G7Î*átqåêÛ³Ée€šüÛè¶Y§”$[õ÷î°ß)ÃÀ¦¼{qeÍ"ô°AöʼnJ/×~Ål­ ¨­GV9§ìçmîÃ䩳h'ha9ncb¢:-¸ÞêÞDgYŽfÚ÷uÎÕ+r pˆ^ì¢ù½œzß};YÍçYýÅo?S-©ÒmH’÷ý÷¹ß½ÆÎ7³ƒ®öØ~>ÉÆCTDôHZå×´ùÎÓáƒûÖ,ú±SÅÖü%áfÌ,êgæŠÈ¸»€w3~€9¸Ì?ZK„@@~èÇa‰*Çø"PS®

Constants

.
Summary
Adapter Status command used in the NCB structure's ncb_command value by the NetBIOS API Call. Returns a ADAPTER_STATUS structure
.

Private Const NCBASTAT As Integer = &H33

.
Summary
NetBIOS command via the NCB structure's ncb_command to retrieve the number of Lan Adapters. Returns a LANA_ENUM structure
.

Private Const NCBENUM As Integer = &H37

.

Private Const NCBNAMSZ As Integer = 16

.
Summary
NetBIOS reset command via the NCB ncb_command
.

Private Const NCBRESET As Integer = &H32

12: NERR_
.

        /// <summary> 2506 - NetBIOS returned an error: The NCB and SMB are dumped above. </summary>

urlmon

.

/// <param name="lpfnCB">A callback function to monitor progress or abort.</param>

.

    IntPtr lpfnCB);

.

/// <param name="lpfnCB">A callback function to monitor progress or abort.</param>

.

    IntPtr lpfnCB);

.

    IntPtr lpfnCB);

.

Public Declare Function URLDownloadToFileA Lib "urlmon" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

.

Private Shared Function URLDownloadToFile(<MarshalAs(UnmanagedType.IUnknown)> pCaller As Object, <MarshalAs(UnmanagedType.LPWStr)> szURL As String, <MarshalAs(UnmanagedType.LPWStr)> szFileName As String, dwReserved As Int32, lpfnCB As IntPtr) As Int32

.

    out UCOMIStream stream, Int32 dwReserved, IntPtr lpfnCB);


 
Access PInvoke.net directly from VS: