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

AE_CONNSTOP

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

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

フィールド

フィールドサイズx64x86説明
ae_cp_compnameDWORD4+0+0接続を終了したコンピューター名へのオフセットを示す。
ae_cp_usernameDWORD4+4+4接続を終了したユーザー名へのオフセットを示す。
ae_cp_netnameDWORD4+8+8接続先の共有(ネット名)へのオフセットを示す。
ae_cp_connidDWORD4+12+12終了した接続の接続IDを示す。
ae_cp_reasonDWORD4+16+16接続が終了した理由を示すコード。

各言語での定義

#include <windows.h>

// AE_CONNSTOP  (x64 20 / x86 20 バイト)
typedef struct AE_CONNSTOP {
    DWORD ae_cp_compname;
    DWORD ae_cp_username;
    DWORD ae_cp_netname;
    DWORD ae_cp_connid;
    DWORD ae_cp_reason;
} AE_CONNSTOP;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AE_CONNSTOP
{
    public uint ae_cp_compname;
    public uint ae_cp_username;
    public uint ae_cp_netname;
    public uint ae_cp_connid;
    public uint ae_cp_reason;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AE_CONNSTOP
    Public ae_cp_compname As UInteger
    Public ae_cp_username As UInteger
    Public ae_cp_netname As UInteger
    Public ae_cp_connid As UInteger
    Public ae_cp_reason As UInteger
End Structure
import ctypes
from ctypes import wintypes

class AE_CONNSTOP(ctypes.Structure):
    _fields_ = [
        ("ae_cp_compname", wintypes.DWORD),
        ("ae_cp_username", wintypes.DWORD),
        ("ae_cp_netname", wintypes.DWORD),
        ("ae_cp_connid", wintypes.DWORD),
        ("ae_cp_reason", wintypes.DWORD),
    ]
#[repr(C)]
pub struct AE_CONNSTOP {
    pub ae_cp_compname: u32,
    pub ae_cp_username: u32,
    pub ae_cp_netname: u32,
    pub ae_cp_connid: u32,
    pub ae_cp_reason: u32,
}
import "golang.org/x/sys/windows"

type AE_CONNSTOP struct {
	ae_cp_compname uint32
	ae_cp_username uint32
	ae_cp_netname uint32
	ae_cp_connid uint32
	ae_cp_reason uint32
}
type
  AE_CONNSTOP = record
    ae_cp_compname: DWORD;
    ae_cp_username: DWORD;
    ae_cp_netname: DWORD;
    ae_cp_connid: DWORD;
    ae_cp_reason: DWORD;
  end;
const AE_CONNSTOP = extern struct {
    ae_cp_compname: u32,
    ae_cp_username: u32,
    ae_cp_netname: u32,
    ae_cp_connid: u32,
    ae_cp_reason: u32,
};
type
  AE_CONNSTOP {.bycopy.} = object
    ae_cp_compname: uint32
    ae_cp_username: uint32
    ae_cp_netname: uint32
    ae_cp_connid: uint32
    ae_cp_reason: uint32
struct AE_CONNSTOP
{
    uint ae_cp_compname;
    uint ae_cp_username;
    uint ae_cp_netname;
    uint ae_cp_connid;
    uint ae_cp_reason;
}

HSP用 定義

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

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

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