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

AE_UASMOD

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

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

フィールド

フィールドサイズx64x86説明
ae_um_compnameDWORD4+0+0ユーザーアカウントDBを変更したコンピューター名へのオフセットを示す。
ae_um_usernameDWORD4+4+4変更を行ったユーザー名へのオフセットを示す。
ae_um_resnameDWORD4+8+8変更対象のアカウントリソース名へのオフセットを示す。
ae_um_rectypeDWORD4+12+12変更されたアカウントレコードの種別を示す。
ae_um_actionDWORD4+16+16実行された変更操作の種別を示すコード。
ae_um_datalenDWORD4+20+20変更に関連する追加データの長さをバイト単位で示す。

各言語での定義

#include <windows.h>

// AE_UASMOD  (x64 24 / x86 24 バイト)
typedef struct AE_UASMOD {
    DWORD ae_um_compname;
    DWORD ae_um_username;
    DWORD ae_um_resname;
    DWORD ae_um_rectype;
    DWORD ae_um_action;
    DWORD ae_um_datalen;
} AE_UASMOD;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AE_UASMOD
{
    public uint ae_um_compname;
    public uint ae_um_username;
    public uint ae_um_resname;
    public uint ae_um_rectype;
    public uint ae_um_action;
    public uint ae_um_datalen;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AE_UASMOD
    Public ae_um_compname As UInteger
    Public ae_um_username As UInteger
    Public ae_um_resname As UInteger
    Public ae_um_rectype As UInteger
    Public ae_um_action As UInteger
    Public ae_um_datalen As UInteger
End Structure
import ctypes
from ctypes import wintypes

class AE_UASMOD(ctypes.Structure):
    _fields_ = [
        ("ae_um_compname", wintypes.DWORD),
        ("ae_um_username", wintypes.DWORD),
        ("ae_um_resname", wintypes.DWORD),
        ("ae_um_rectype", wintypes.DWORD),
        ("ae_um_action", wintypes.DWORD),
        ("ae_um_datalen", wintypes.DWORD),
    ]
#[repr(C)]
pub struct AE_UASMOD {
    pub ae_um_compname: u32,
    pub ae_um_username: u32,
    pub ae_um_resname: u32,
    pub ae_um_rectype: u32,
    pub ae_um_action: u32,
    pub ae_um_datalen: u32,
}
import "golang.org/x/sys/windows"

type AE_UASMOD struct {
	ae_um_compname uint32
	ae_um_username uint32
	ae_um_resname uint32
	ae_um_rectype uint32
	ae_um_action uint32
	ae_um_datalen uint32
}
type
  AE_UASMOD = record
    ae_um_compname: DWORD;
    ae_um_username: DWORD;
    ae_um_resname: DWORD;
    ae_um_rectype: DWORD;
    ae_um_action: DWORD;
    ae_um_datalen: DWORD;
  end;
const AE_UASMOD = extern struct {
    ae_um_compname: u32,
    ae_um_username: u32,
    ae_um_resname: u32,
    ae_um_rectype: u32,
    ae_um_action: u32,
    ae_um_datalen: u32,
};
type
  AE_UASMOD {.bycopy.} = object
    ae_um_compname: uint32
    ae_um_username: uint32
    ae_um_resname: uint32
    ae_um_rectype: uint32
    ae_um_action: uint32
    ae_um_datalen: uint32
struct AE_UASMOD
{
    uint ae_um_compname;
    uint ae_um_username;
    uint ae_um_resname;
    uint ae_um_rectype;
    uint ae_um_action;
    uint ae_um_datalen;
}

HSP用 定義

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

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

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