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

AE_CONNREJ

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

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

フィールド

フィールドサイズx64x86説明
ae_cr_compnameDWORD4+0+0接続を拒否されたコンピューター名へのオフセットを示す。
ae_cr_usernameDWORD4+4+4接続を拒否されたユーザー名へのオフセットを示す。
ae_cr_netnameDWORD4+8+8接続を試みた共有(ネット名)へのオフセットを示す。
ae_cr_reasonDWORD4+12+12接続が拒否された理由を示すコード。

各言語での定義

#include <windows.h>

// AE_CONNREJ  (x64 16 / x86 16 バイト)
typedef struct AE_CONNREJ {
    DWORD ae_cr_compname;
    DWORD ae_cr_username;
    DWORD ae_cr_netname;
    DWORD ae_cr_reason;
} AE_CONNREJ;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AE_CONNREJ
{
    public uint ae_cr_compname;
    public uint ae_cr_username;
    public uint ae_cr_netname;
    public uint ae_cr_reason;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AE_CONNREJ
    Public ae_cr_compname As UInteger
    Public ae_cr_username As UInteger
    Public ae_cr_netname As UInteger
    Public ae_cr_reason As UInteger
End Structure
import ctypes
from ctypes import wintypes

class AE_CONNREJ(ctypes.Structure):
    _fields_ = [
        ("ae_cr_compname", wintypes.DWORD),
        ("ae_cr_username", wintypes.DWORD),
        ("ae_cr_netname", wintypes.DWORD),
        ("ae_cr_reason", wintypes.DWORD),
    ]
#[repr(C)]
pub struct AE_CONNREJ {
    pub ae_cr_compname: u32,
    pub ae_cr_username: u32,
    pub ae_cr_netname: u32,
    pub ae_cr_reason: u32,
}
import "golang.org/x/sys/windows"

type AE_CONNREJ struct {
	ae_cr_compname uint32
	ae_cr_username uint32
	ae_cr_netname uint32
	ae_cr_reason uint32
}
type
  AE_CONNREJ = record
    ae_cr_compname: DWORD;
    ae_cr_username: DWORD;
    ae_cr_netname: DWORD;
    ae_cr_reason: DWORD;
  end;
const AE_CONNREJ = extern struct {
    ae_cr_compname: u32,
    ae_cr_username: u32,
    ae_cr_netname: u32,
    ae_cr_reason: u32,
};
type
  AE_CONNREJ {.bycopy.} = object
    ae_cr_compname: uint32
    ae_cr_username: uint32
    ae_cr_netname: uint32
    ae_cr_reason: uint32
struct AE_CONNREJ
{
    uint ae_cr_compname;
    uint ae_cr_username;
    uint ae_cr_netname;
    uint ae_cr_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_CONNREJ サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; ae_cr_compname : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ae_cr_username : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ae_cr_netname : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ae_cr_reason : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AE_CONNREJ
    #field int ae_cr_compname
    #field int ae_cr_username
    #field int ae_cr_netname
    #field int ae_cr_reason
#endstruct

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