1

我有 2 台机器通过 NetBEUI 使用 NetBIOS 相互通信。我正在用 TCP 替换 NETBEUI。我正在寻找最简单和最快的方法来做到这一点。有基于 TCP/IP 协议的 NetBios 可用,但由于某种原因它不起作用……我不知道为什么。所以现在,我正在考虑序列化 NetBIOS 结构并使用 TCP 将其发送到另一台机器并在那里反序列化。结构如下所示。序列化方法会起作用吗?

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 * );
    UCHAR   ncb_lana_num;           /* lana (adapter) number          */
    UCHAR   ncb_cmd_cplt;           /* 0xff => commmand pending       */
#ifdef _WIN64
    UCHAR   ncb_reserve[18];        /* reserved, used by BIOS         */
#else
    UCHAR   ncb_reserve[10];        /* reserved, used by BIOS         */
#endif
    HANDLE  ncb_event;              /* HANDLE to Win32 event which    */
                                /* will be set to the signalled   */
                                /* state when an ASYNCH command   */
                                /* completes                      */
} NCB, *PNCB;
4

0 回答 0