Desktop Functions: Smart Device Functions:
|
Search Results for "NCB" in [All]kernel321: NetBIOS
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
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; 3: LANA_ENUM
4: NAME_BUFFER
Private Const NCBNAMSZ As Integer = 16
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=NCBNAMSZ)> Dim Name As String
UCHAR name[NCBNAMSZ]; 5: NCB
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; 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ÅÍNO ê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`å±9I¶í¾¥ßDÅ·ì8°ó;YªÙaÃl:ì aº>Ì´¯_à6ß`Kå ðã|&ǵsV>)t, 3*L|ý¥°³7Zw~Vq¯Ôû3ÜÂ)äRÜ<ŰUÕÎoó6Qúr(_ÕÛG7Î*átqåêÛ³ÉeüÛè¶Y§$[õ÷î°ß)ÃÀ¦¼{qeÍ"ô°AöÅJ/×~Ål ¨GV9§ìçmîÃ䩳h'ha9ncb¢:-¸ÞêÞDgYfÚ÷uÎÕ+r p^ì¢ù½zß};YÍçYýÅo?S-©ÒmH÷ý÷¹ß½ÆÎ7³®öØ~>ÉÆCTDôHZå×´ùÎÓáûÖ,ú±SÅÖü%áfÌ,êgæÈ¸»w3~9¸Ì?ZK@@~èÇa*Çø"PS® Constants8: NCBASTAT
9: NCBENUM
10: NCBNAMSZ
Private Const NCBNAMSZ As Integer = 16 11: NCBRESET
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); |