Win32 API 日本語リファレンス
ホームNetworkManagement.NetManagement › SMB_TREE_CONNECT_PARAMETERS

SMB_TREE_CONNECT_PARAMETERS

構造体
サイズx64: 16 バイト / x86: 16 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
EABufferOffsetDWORD4+0+0拡張属性(EA)バッファの構造体先頭からのオフセットをバイト単位で示す。
EABufferLenDWORD4+4+4拡張属性(EA)バッファの長さをバイト単位で示す。
CreateOptionsDWORD4+8+8ツリー接続時の作成オプションフラグを示す。
TreeConnectAttributesDWORD4+12+12ツリー接続に付与する属性フラグを示す。

各言語での定義

#include <windows.h>

// SMB_TREE_CONNECT_PARAMETERS  (x64 16 / x86 16 バイト)
typedef struct SMB_TREE_CONNECT_PARAMETERS {
    DWORD EABufferOffset;
    DWORD EABufferLen;
    DWORD CreateOptions;
    DWORD TreeConnectAttributes;
} SMB_TREE_CONNECT_PARAMETERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SMB_TREE_CONNECT_PARAMETERS
{
    public uint EABufferOffset;
    public uint EABufferLen;
    public uint CreateOptions;
    public uint TreeConnectAttributes;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SMB_TREE_CONNECT_PARAMETERS
    Public EABufferOffset As UInteger
    Public EABufferLen As UInteger
    Public CreateOptions As UInteger
    Public TreeConnectAttributes As UInteger
End Structure
import ctypes
from ctypes import wintypes

class SMB_TREE_CONNECT_PARAMETERS(ctypes.Structure):
    _fields_ = [
        ("EABufferOffset", wintypes.DWORD),
        ("EABufferLen", wintypes.DWORD),
        ("CreateOptions", wintypes.DWORD),
        ("TreeConnectAttributes", wintypes.DWORD),
    ]
#[repr(C)]
pub struct SMB_TREE_CONNECT_PARAMETERS {
    pub EABufferOffset: u32,
    pub EABufferLen: u32,
    pub CreateOptions: u32,
    pub TreeConnectAttributes: u32,
}
import "golang.org/x/sys/windows"

type SMB_TREE_CONNECT_PARAMETERS struct {
	EABufferOffset uint32
	EABufferLen uint32
	CreateOptions uint32
	TreeConnectAttributes uint32
}
type
  SMB_TREE_CONNECT_PARAMETERS = record
    EABufferOffset: DWORD;
    EABufferLen: DWORD;
    CreateOptions: DWORD;
    TreeConnectAttributes: DWORD;
  end;
const SMB_TREE_CONNECT_PARAMETERS = extern struct {
    EABufferOffset: u32,
    EABufferLen: u32,
    CreateOptions: u32,
    TreeConnectAttributes: u32,
};
type
  SMB_TREE_CONNECT_PARAMETERS {.bycopy.} = object
    EABufferOffset: uint32
    EABufferLen: uint32
    CreateOptions: uint32
    TreeConnectAttributes: uint32
struct SMB_TREE_CONNECT_PARAMETERS
{
    uint EABufferOffset;
    uint EABufferLen;
    uint CreateOptions;
    uint TreeConnectAttributes;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SMB_TREE_CONNECT_PARAMETERS サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; EABufferOffset : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; EABufferLen : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; CreateOptions : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; TreeConnectAttributes : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SMB_TREE_CONNECT_PARAMETERS
    #field int EABufferOffset
    #field int EABufferLen
    #field int CreateOptions
    #field int TreeConnectAttributes
#endstruct

stdim st, SMB_TREE_CONNECT_PARAMETERS        ; NSTRUCT 変数を確保
st->EABufferOffset = 100
mes "EABufferOffset=" + st->EABufferOffset