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

AE_CONNSTART

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

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

フィールド

フィールドサイズx64x86説明
ae_ct_compnameDWORD4+0+0接続を開始したコンピューター名へのオフセットを示す。
ae_ct_usernameDWORD4+4+4接続を開始したユーザー名へのオフセットを示す。
ae_ct_netnameDWORD4+8+8接続先の共有(ネット名)へのオフセットを示す。
ae_ct_connidDWORD4+12+12この接続に割り当てられた接続IDを示す。

各言語での定義

#include <windows.h>

// AE_CONNSTART  (x64 16 / x86 16 バイト)
typedef struct AE_CONNSTART {
    DWORD ae_ct_compname;
    DWORD ae_ct_username;
    DWORD ae_ct_netname;
    DWORD ae_ct_connid;
} AE_CONNSTART;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AE_CONNSTART
{
    public uint ae_ct_compname;
    public uint ae_ct_username;
    public uint ae_ct_netname;
    public uint ae_ct_connid;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AE_CONNSTART
    Public ae_ct_compname As UInteger
    Public ae_ct_username As UInteger
    Public ae_ct_netname As UInteger
    Public ae_ct_connid As UInteger
End Structure
import ctypes
from ctypes import wintypes

class AE_CONNSTART(ctypes.Structure):
    _fields_ = [
        ("ae_ct_compname", wintypes.DWORD),
        ("ae_ct_username", wintypes.DWORD),
        ("ae_ct_netname", wintypes.DWORD),
        ("ae_ct_connid", wintypes.DWORD),
    ]
#[repr(C)]
pub struct AE_CONNSTART {
    pub ae_ct_compname: u32,
    pub ae_ct_username: u32,
    pub ae_ct_netname: u32,
    pub ae_ct_connid: u32,
}
import "golang.org/x/sys/windows"

type AE_CONNSTART struct {
	ae_ct_compname uint32
	ae_ct_username uint32
	ae_ct_netname uint32
	ae_ct_connid uint32
}
type
  AE_CONNSTART = record
    ae_ct_compname: DWORD;
    ae_ct_username: DWORD;
    ae_ct_netname: DWORD;
    ae_ct_connid: DWORD;
  end;
const AE_CONNSTART = extern struct {
    ae_ct_compname: u32,
    ae_ct_username: u32,
    ae_ct_netname: u32,
    ae_ct_connid: u32,
};
type
  AE_CONNSTART {.bycopy.} = object
    ae_ct_compname: uint32
    ae_ct_username: uint32
    ae_ct_netname: uint32
    ae_ct_connid: uint32
struct AE_CONNSTART
{
    uint ae_ct_compname;
    uint ae_ct_username;
    uint ae_ct_netname;
    uint ae_ct_connid;
}

HSP用 定義

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

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

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