ホーム › NetworkManagement.NetBios › FIND_NAME_HEADER
FIND_NAME_HEADER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| node_count | WORD | 2 | +0 | +0 | 名前を所有するノード数(FIND_NAME_BUFFER要素数)。 |
| reserved | BYTE | 1 | +2 | +2 | 予約フィールド。 |
| unique_group | BYTE | 1 | +3 | +3 | 名前が一意名(0)かグループ名(1)かを示す。 |
各言語での定義
#include <windows.h>
// FIND_NAME_HEADER (x64 4 / x86 4 バイト)
typedef struct FIND_NAME_HEADER {
WORD node_count;
BYTE reserved;
BYTE unique_group;
} FIND_NAME_HEADER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FIND_NAME_HEADER
{
public ushort node_count;
public byte reserved;
public byte unique_group;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FIND_NAME_HEADER
Public node_count As UShort
Public reserved As Byte
Public unique_group As Byte
End Structureimport ctypes
from ctypes import wintypes
class FIND_NAME_HEADER(ctypes.Structure):
_fields_ = [
("node_count", ctypes.c_ushort),
("reserved", ctypes.c_ubyte),
("unique_group", ctypes.c_ubyte),
]#[repr(C)]
pub struct FIND_NAME_HEADER {
pub node_count: u16,
pub reserved: u8,
pub unique_group: u8,
}import "golang.org/x/sys/windows"
type FIND_NAME_HEADER struct {
node_count uint16
reserved byte
unique_group byte
}type
FIND_NAME_HEADER = record
node_count: Word;
reserved: Byte;
unique_group: Byte;
end;const FIND_NAME_HEADER = extern struct {
node_count: u16,
reserved: u8,
unique_group: u8,
};type
FIND_NAME_HEADER {.bycopy.} = object
node_count: uint16
reserved: uint8
unique_group: uint8struct FIND_NAME_HEADER
{
ushort node_count;
ubyte reserved;
ubyte unique_group;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FIND_NAME_HEADER サイズ: 4 バイト(x64)
dim st, 1 ; 4byte整数×1(構造体サイズ 4 / 4 切り上げ)
; node_count : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; reserved : BYTE (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; unique_group : BYTE (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FIND_NAME_HEADER
#field short node_count
#field byte reserved
#field byte unique_group
#endstruct
stdim st, FIND_NAME_HEADER ; NSTRUCT 変数を確保
st->node_count = 100
mes "node_count=" + st->node_count