ホーム › NetworkManagement.NetManagement › NET_DISPLAY_USER
NET_DISPLAY_USER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| usri1_name | LPWSTR | 8/4 | +0 | +0 | ユーザーアカウントの名前を指定する Unicode 文字列へのポインターです。 | ||||||||||||||||||||||||||||||
| usri1_comment | LPWSTR | 8/4 | +8 | +4 | ユーザーに関連付けられたコメントを含む Unicode 文字列へのポインターです。この文字列は空文字列でもよく、終端の NULL 文字の前に任意の数の文字 (MAXCOMMENTSZ) を含めることができます。 | ||||||||||||||||||||||||||||||
| usri1_flags | USER_ACCOUNT_FLAGS | 4 | +16 | +8 | ユーザーアカウントフラグのセットです。このメンバーには、次の値の 1 つ以上を指定できます。 ユーザーアカウント制御フラグの設定には、特定の 特権 および コントロールアクセス権 が必要になる場合があることに注意してください。詳細については、NetUserSetInfo 関数の解説セクションを参照してください。
次の値はアカウントの種類を表します。設定できる値は 1 つだけです。 NetUserSetInfo 関数を使用してアカウントの種類を変更することはできません。 | ||||||||||||||||||||||||||||||
| usri1_full_name | LPWSTR | 8/4 | +24 | +12 | ユーザーのフルネームを含む Unicode 文字列へのポインターです。この文字列は空文字列でもよく、終端の NULL 文字の前に任意の数の文字を含めることができます。 | ||||||||||||||||||||||||||||||
| usri1_user_id | DWORD | 4 | +32 | +16 | ユーザーの相対識別子 (RID) です。相対識別子は、ユーザーが作成されるときにアカウントデータベースによって決定されます。これは、ドメイン内のアカウントマネージャーに対してこのユーザーアカウントを一意に識別します。相対識別子の詳細については、 SID Components を参照してください。 | ||||||||||||||||||||||||||||||
| usri1_next_index | DWORD | 4 | +36 | +20 | NetQueryDisplayInformation 関数が返した最後のエントリのインデックスです。次の論理エントリを返すには、この値を NetQueryDisplayInformation の Index パラメーターとして渡します。このメンバーの値は、 NetQueryDisplayInformation を追加で呼び出してさらにデータを取得する目的以外には使用しないでください。 |
公式ドキュメント
NET_DISPLAY_USER 構造体には、アカウントマネージャーがユーザーアカウントに関する情報を判別するためにアクセスできる情報が格納されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// NET_DISPLAY_USER (x64 40 / x86 24 バイト)
typedef struct NET_DISPLAY_USER {
LPWSTR usri1_name;
LPWSTR usri1_comment;
USER_ACCOUNT_FLAGS usri1_flags;
LPWSTR usri1_full_name;
DWORD usri1_user_id;
DWORD usri1_next_index;
} NET_DISPLAY_USER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NET_DISPLAY_USER
{
public IntPtr usri1_name;
public IntPtr usri1_comment;
public uint usri1_flags;
public IntPtr usri1_full_name;
public uint usri1_user_id;
public uint usri1_next_index;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NET_DISPLAY_USER
Public usri1_name As IntPtr
Public usri1_comment As IntPtr
Public usri1_flags As UInteger
Public usri1_full_name As IntPtr
Public usri1_user_id As UInteger
Public usri1_next_index As UInteger
End Structureimport ctypes
from ctypes import wintypes
class NET_DISPLAY_USER(ctypes.Structure):
_fields_ = [
("usri1_name", ctypes.c_void_p),
("usri1_comment", ctypes.c_void_p),
("usri1_flags", wintypes.DWORD),
("usri1_full_name", ctypes.c_void_p),
("usri1_user_id", wintypes.DWORD),
("usri1_next_index", wintypes.DWORD),
]#[repr(C)]
pub struct NET_DISPLAY_USER {
pub usri1_name: *mut core::ffi::c_void,
pub usri1_comment: *mut core::ffi::c_void,
pub usri1_flags: u32,
pub usri1_full_name: *mut core::ffi::c_void,
pub usri1_user_id: u32,
pub usri1_next_index: u32,
}import "golang.org/x/sys/windows"
type NET_DISPLAY_USER struct {
usri1_name uintptr
usri1_comment uintptr
usri1_flags uint32
usri1_full_name uintptr
usri1_user_id uint32
usri1_next_index uint32
}type
NET_DISPLAY_USER = record
usri1_name: Pointer;
usri1_comment: Pointer;
usri1_flags: DWORD;
usri1_full_name: Pointer;
usri1_user_id: DWORD;
usri1_next_index: DWORD;
end;const NET_DISPLAY_USER = extern struct {
usri1_name: ?*anyopaque,
usri1_comment: ?*anyopaque,
usri1_flags: u32,
usri1_full_name: ?*anyopaque,
usri1_user_id: u32,
usri1_next_index: u32,
};type
NET_DISPLAY_USER {.bycopy.} = object
usri1_name: pointer
usri1_comment: pointer
usri1_flags: uint32
usri1_full_name: pointer
usri1_user_id: uint32
usri1_next_index: uint32struct NET_DISPLAY_USER
{
void* usri1_name;
void* usri1_comment;
uint usri1_flags;
void* usri1_full_name;
uint usri1_user_id;
uint usri1_next_index;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; NET_DISPLAY_USER サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; usri1_name : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; usri1_comment : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; usri1_flags : USER_ACCOUNT_FLAGS (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; usri1_full_name : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; usri1_user_id : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; usri1_next_index : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NET_DISPLAY_USER サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; usri1_name : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; usri1_comment : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; usri1_flags : USER_ACCOUNT_FLAGS (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; usri1_full_name : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; usri1_user_id : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; usri1_next_index : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NET_DISPLAY_USER
#field intptr usri1_name
#field intptr usri1_comment
#field int usri1_flags
#field intptr usri1_full_name
#field int usri1_user_id
#field int usri1_next_index
#endstruct
stdim st, NET_DISPLAY_USER ; NSTRUCT 変数を確保
st->usri1_flags = 100
mes "usri1_flags=" + st->usri1_flags