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

GROUP_INFO_3

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

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

フィールド

フィールドサイズx64x86説明
grpi3_nameLPWSTR8/4+0+0グローバルグループ名を示すUnicode文字列。NULL終端で指定する。
grpi3_commentLPWSTR8/4+8+4グループのコメントや説明文を示すUnicode文字列。
grpi3_group_sidPSID8/4+16+8グループのセキュリティ識別子(SID)へのポインター。グループを一意に識別する。
grpi3_attributesDWORD4+24+12グループSIDの属性ビット。SE_GROUP_ENABLED等のフラグの組み合わせ。

各言語での定義

#include <windows.h>

// GROUP_INFO_3  (x64 32 / x86 16 バイト)
typedef struct GROUP_INFO_3 {
    LPWSTR grpi3_name;
    LPWSTR grpi3_comment;
    PSID grpi3_group_sid;
    DWORD grpi3_attributes;
} GROUP_INFO_3;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GROUP_INFO_3
{
    public IntPtr grpi3_name;
    public IntPtr grpi3_comment;
    public IntPtr grpi3_group_sid;
    public uint grpi3_attributes;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GROUP_INFO_3
    Public grpi3_name As IntPtr
    Public grpi3_comment As IntPtr
    Public grpi3_group_sid As IntPtr
    Public grpi3_attributes As UInteger
End Structure
import ctypes
from ctypes import wintypes

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

type GROUP_INFO_3 struct {
	grpi3_name uintptr
	grpi3_comment uintptr
	grpi3_group_sid uintptr
	grpi3_attributes uint32
}
type
  GROUP_INFO_3 = record
    grpi3_name: Pointer;
    grpi3_comment: Pointer;
    grpi3_group_sid: Pointer;
    grpi3_attributes: DWORD;
  end;
const GROUP_INFO_3 = extern struct {
    grpi3_name: ?*anyopaque,
    grpi3_comment: ?*anyopaque,
    grpi3_group_sid: ?*anyopaque,
    grpi3_attributes: u32,
};
type
  GROUP_INFO_3 {.bycopy.} = object
    grpi3_name: pointer
    grpi3_comment: pointer
    grpi3_group_sid: pointer
    grpi3_attributes: uint32
struct GROUP_INFO_3
{
    void* grpi3_name;
    void* grpi3_comment;
    void* grpi3_group_sid;
    uint grpi3_attributes;
}

HSP用 定義

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

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

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