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

ACCESS_LIST

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

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

フィールド

フィールドサイズx64x86説明
acl_ugnameLPWSTR8/4+0+0アクセス許可の対象となるユーザー名またはグループ名を示すUnicode文字列。
acl_accessDWORD4+8+4対象に付与されたアクセス権ビット。ACCESS_READ等のフラグの組み合わせ。

各言語での定義

#include <windows.h>

// ACCESS_LIST  (x64 16 / x86 8 バイト)
typedef struct ACCESS_LIST {
    LPWSTR acl_ugname;
    DWORD acl_access;
} ACCESS_LIST;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ACCESS_LIST
{
    public IntPtr acl_ugname;
    public uint acl_access;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ACCESS_LIST
    Public acl_ugname As IntPtr
    Public acl_access As UInteger
End Structure
import ctypes
from ctypes import wintypes

class ACCESS_LIST(ctypes.Structure):
    _fields_ = [
        ("acl_ugname", ctypes.c_void_p),
        ("acl_access", wintypes.DWORD),
    ]
#[repr(C)]
pub struct ACCESS_LIST {
    pub acl_ugname: *mut core::ffi::c_void,
    pub acl_access: u32,
}
import "golang.org/x/sys/windows"

type ACCESS_LIST struct {
	acl_ugname uintptr
	acl_access uint32
}
type
  ACCESS_LIST = record
    acl_ugname: Pointer;
    acl_access: DWORD;
  end;
const ACCESS_LIST = extern struct {
    acl_ugname: ?*anyopaque,
    acl_access: u32,
};
type
  ACCESS_LIST {.bycopy.} = object
    acl_ugname: pointer
    acl_access: uint32
struct ACCESS_LIST
{
    void* acl_ugname;
    uint acl_access;
}

HSP用 定義

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

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

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