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

AE_RESACCESS

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

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

フィールド

フィールドサイズx64x86説明
ae_ra_compnameDWORD4+0+0リソースにアクセスしたコンピューター名へのオフセットを示す。
ae_ra_usernameDWORD4+4+4リソースにアクセスしたユーザー名へのオフセットを示す。
ae_ra_resnameDWORD4+8+8アクセスされたリソース名へのオフセットを示す。
ae_ra_operationDWORD4+12+12実行された操作の種別を示すコード。
ae_ra_returncodeDWORD4+16+16操作の結果を示すリターンコードを保持する。
ae_ra_restypeDWORD4+20+20アクセスされたリソースの種別を示す。
ae_ra_fileidDWORD4+24+24アクセス対象ファイルに割り当てられたファイルIDを示す。

各言語での定義

#include <windows.h>

// AE_RESACCESS  (x64 28 / x86 28 バイト)
typedef struct AE_RESACCESS {
    DWORD ae_ra_compname;
    DWORD ae_ra_username;
    DWORD ae_ra_resname;
    DWORD ae_ra_operation;
    DWORD ae_ra_returncode;
    DWORD ae_ra_restype;
    DWORD ae_ra_fileid;
} AE_RESACCESS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AE_RESACCESS
{
    public uint ae_ra_compname;
    public uint ae_ra_username;
    public uint ae_ra_resname;
    public uint ae_ra_operation;
    public uint ae_ra_returncode;
    public uint ae_ra_restype;
    public uint ae_ra_fileid;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AE_RESACCESS
    Public ae_ra_compname As UInteger
    Public ae_ra_username As UInteger
    Public ae_ra_resname As UInteger
    Public ae_ra_operation As UInteger
    Public ae_ra_returncode As UInteger
    Public ae_ra_restype As UInteger
    Public ae_ra_fileid As UInteger
End Structure
import ctypes
from ctypes import wintypes

class AE_RESACCESS(ctypes.Structure):
    _fields_ = [
        ("ae_ra_compname", wintypes.DWORD),
        ("ae_ra_username", wintypes.DWORD),
        ("ae_ra_resname", wintypes.DWORD),
        ("ae_ra_operation", wintypes.DWORD),
        ("ae_ra_returncode", wintypes.DWORD),
        ("ae_ra_restype", wintypes.DWORD),
        ("ae_ra_fileid", wintypes.DWORD),
    ]
#[repr(C)]
pub struct AE_RESACCESS {
    pub ae_ra_compname: u32,
    pub ae_ra_username: u32,
    pub ae_ra_resname: u32,
    pub ae_ra_operation: u32,
    pub ae_ra_returncode: u32,
    pub ae_ra_restype: u32,
    pub ae_ra_fileid: u32,
}
import "golang.org/x/sys/windows"

type AE_RESACCESS struct {
	ae_ra_compname uint32
	ae_ra_username uint32
	ae_ra_resname uint32
	ae_ra_operation uint32
	ae_ra_returncode uint32
	ae_ra_restype uint32
	ae_ra_fileid uint32
}
type
  AE_RESACCESS = record
    ae_ra_compname: DWORD;
    ae_ra_username: DWORD;
    ae_ra_resname: DWORD;
    ae_ra_operation: DWORD;
    ae_ra_returncode: DWORD;
    ae_ra_restype: DWORD;
    ae_ra_fileid: DWORD;
  end;
const AE_RESACCESS = extern struct {
    ae_ra_compname: u32,
    ae_ra_username: u32,
    ae_ra_resname: u32,
    ae_ra_operation: u32,
    ae_ra_returncode: u32,
    ae_ra_restype: u32,
    ae_ra_fileid: u32,
};
type
  AE_RESACCESS {.bycopy.} = object
    ae_ra_compname: uint32
    ae_ra_username: uint32
    ae_ra_resname: uint32
    ae_ra_operation: uint32
    ae_ra_returncode: uint32
    ae_ra_restype: uint32
    ae_ra_fileid: uint32
struct AE_RESACCESS
{
    uint ae_ra_compname;
    uint ae_ra_username;
    uint ae_ra_resname;
    uint ae_ra_operation;
    uint ae_ra_returncode;
    uint ae_ra_restype;
    uint ae_ra_fileid;
}

HSP用 定義

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

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

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