ホーム › NetworkManagement.NetManagement › USER_INFO_11
USER_INFO_11
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| usri11_name | LPWSTR | 8/4 | +0 | +0 | ユーザーアカウント名。 |
| usri11_comment | LPWSTR | 8/4 | +8 | +4 | アカウントのコメント。 |
| usri11_usr_comment | LPWSTR | 8/4 | +16 | +8 | ユーザー自身が設定するコメント。 |
| usri11_full_name | LPWSTR | 8/4 | +24 | +12 | ユーザーのフルネーム。 |
| usri11_priv | USER_PRIV | 4 | +32 | +16 | ユーザーの権限レベル(ゲスト/ユーザー/管理者)。 |
| usri11_auth_flags | AF_OP | 4 | +36 | +20 | 操作者(管理)権限を示す認可フラグ。 |
| usri11_password_age | DWORD | 4 | +40 | +24 | 前回のパスワード変更からの経過時間(秒)。 |
| usri11_home_dir | LPWSTR | 8/4 | +48 | +28 | ホームディレクトリのパス。 |
| usri11_parms | LPWSTR | 8/4 | +56 | +32 | アプリケーション固有のパラメータ領域。 |
| usri11_last_logon | DWORD | 4 | +64 | +36 | 最後にログオンした日時(1970年起算秒)。 |
| usri11_last_logoff | DWORD | 4 | +68 | +40 | 最後にログオフした日時(1970年起算秒)。 |
| usri11_bad_pw_count | DWORD | 4 | +72 | +44 | 誤ったパスワード入力の回数。 |
| usri11_num_logons | DWORD | 4 | +76 | +48 | このアカウントの累計ログオン回数。 |
| usri11_logon_server | LPWSTR | 8/4 | +80 | +52 | ログオンを処理するサーバー名。 |
| usri11_country_code | DWORD | 4 | +88 | +56 | ユーザーの国コード。 |
| usri11_workstations | LPWSTR | 8/4 | +96 | +60 | ログオンを許可するワークステーション一覧(カンマ区切り)。 |
| usri11_max_storage | DWORD | 4 | +104 | +64 | ユーザーに許可される最大ディスク容量(バイト)。 |
| usri11_units_per_week | DWORD | 4 | +108 | +68 | ログオン時間を表す週あたりの単位数。 |
| usri11_logon_hours | BYTE* | 8/4 | +112 | +72 | ログオン可能時間帯を表すビットマップへのポインタ。 |
| usri11_code_page | DWORD | 4 | +120 | +76 | ユーザーのコードページ。 |
各言語での定義
#include <windows.h>
// USER_INFO_11 (x64 128 / x86 80 バイト)
typedef struct USER_INFO_11 {
LPWSTR usri11_name;
LPWSTR usri11_comment;
LPWSTR usri11_usr_comment;
LPWSTR usri11_full_name;
USER_PRIV usri11_priv;
AF_OP usri11_auth_flags;
DWORD usri11_password_age;
LPWSTR usri11_home_dir;
LPWSTR usri11_parms;
DWORD usri11_last_logon;
DWORD usri11_last_logoff;
DWORD usri11_bad_pw_count;
DWORD usri11_num_logons;
LPWSTR usri11_logon_server;
DWORD usri11_country_code;
LPWSTR usri11_workstations;
DWORD usri11_max_storage;
DWORD usri11_units_per_week;
BYTE* usri11_logon_hours;
DWORD usri11_code_page;
} USER_INFO_11;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USER_INFO_11
{
public IntPtr usri11_name;
public IntPtr usri11_comment;
public IntPtr usri11_usr_comment;
public IntPtr usri11_full_name;
public uint usri11_priv;
public uint usri11_auth_flags;
public uint usri11_password_age;
public IntPtr usri11_home_dir;
public IntPtr usri11_parms;
public uint usri11_last_logon;
public uint usri11_last_logoff;
public uint usri11_bad_pw_count;
public uint usri11_num_logons;
public IntPtr usri11_logon_server;
public uint usri11_country_code;
public IntPtr usri11_workstations;
public uint usri11_max_storage;
public uint usri11_units_per_week;
public IntPtr usri11_logon_hours;
public uint usri11_code_page;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure USER_INFO_11
Public usri11_name As IntPtr
Public usri11_comment As IntPtr
Public usri11_usr_comment As IntPtr
Public usri11_full_name As IntPtr
Public usri11_priv As UInteger
Public usri11_auth_flags As UInteger
Public usri11_password_age As UInteger
Public usri11_home_dir As IntPtr
Public usri11_parms As IntPtr
Public usri11_last_logon As UInteger
Public usri11_last_logoff As UInteger
Public usri11_bad_pw_count As UInteger
Public usri11_num_logons As UInteger
Public usri11_logon_server As IntPtr
Public usri11_country_code As UInteger
Public usri11_workstations As IntPtr
Public usri11_max_storage As UInteger
Public usri11_units_per_week As UInteger
Public usri11_logon_hours As IntPtr
Public usri11_code_page As UInteger
End Structureimport ctypes
from ctypes import wintypes
class USER_INFO_11(ctypes.Structure):
_fields_ = [
("usri11_name", ctypes.c_void_p),
("usri11_comment", ctypes.c_void_p),
("usri11_usr_comment", ctypes.c_void_p),
("usri11_full_name", ctypes.c_void_p),
("usri11_priv", wintypes.DWORD),
("usri11_auth_flags", wintypes.DWORD),
("usri11_password_age", wintypes.DWORD),
("usri11_home_dir", ctypes.c_void_p),
("usri11_parms", ctypes.c_void_p),
("usri11_last_logon", wintypes.DWORD),
("usri11_last_logoff", wintypes.DWORD),
("usri11_bad_pw_count", wintypes.DWORD),
("usri11_num_logons", wintypes.DWORD),
("usri11_logon_server", ctypes.c_void_p),
("usri11_country_code", wintypes.DWORD),
("usri11_workstations", ctypes.c_void_p),
("usri11_max_storage", wintypes.DWORD),
("usri11_units_per_week", wintypes.DWORD),
("usri11_logon_hours", ctypes.c_void_p),
("usri11_code_page", wintypes.DWORD),
]#[repr(C)]
pub struct USER_INFO_11 {
pub usri11_name: *mut core::ffi::c_void,
pub usri11_comment: *mut core::ffi::c_void,
pub usri11_usr_comment: *mut core::ffi::c_void,
pub usri11_full_name: *mut core::ffi::c_void,
pub usri11_priv: u32,
pub usri11_auth_flags: u32,
pub usri11_password_age: u32,
pub usri11_home_dir: *mut core::ffi::c_void,
pub usri11_parms: *mut core::ffi::c_void,
pub usri11_last_logon: u32,
pub usri11_last_logoff: u32,
pub usri11_bad_pw_count: u32,
pub usri11_num_logons: u32,
pub usri11_logon_server: *mut core::ffi::c_void,
pub usri11_country_code: u32,
pub usri11_workstations: *mut core::ffi::c_void,
pub usri11_max_storage: u32,
pub usri11_units_per_week: u32,
pub usri11_logon_hours: *mut core::ffi::c_void,
pub usri11_code_page: u32,
}import "golang.org/x/sys/windows"
type USER_INFO_11 struct {
usri11_name uintptr
usri11_comment uintptr
usri11_usr_comment uintptr
usri11_full_name uintptr
usri11_priv uint32
usri11_auth_flags uint32
usri11_password_age uint32
usri11_home_dir uintptr
usri11_parms uintptr
usri11_last_logon uint32
usri11_last_logoff uint32
usri11_bad_pw_count uint32
usri11_num_logons uint32
usri11_logon_server uintptr
usri11_country_code uint32
usri11_workstations uintptr
usri11_max_storage uint32
usri11_units_per_week uint32
usri11_logon_hours uintptr
usri11_code_page uint32
}type
USER_INFO_11 = record
usri11_name: Pointer;
usri11_comment: Pointer;
usri11_usr_comment: Pointer;
usri11_full_name: Pointer;
usri11_priv: DWORD;
usri11_auth_flags: DWORD;
usri11_password_age: DWORD;
usri11_home_dir: Pointer;
usri11_parms: Pointer;
usri11_last_logon: DWORD;
usri11_last_logoff: DWORD;
usri11_bad_pw_count: DWORD;
usri11_num_logons: DWORD;
usri11_logon_server: Pointer;
usri11_country_code: DWORD;
usri11_workstations: Pointer;
usri11_max_storage: DWORD;
usri11_units_per_week: DWORD;
usri11_logon_hours: Pointer;
usri11_code_page: DWORD;
end;const USER_INFO_11 = extern struct {
usri11_name: ?*anyopaque,
usri11_comment: ?*anyopaque,
usri11_usr_comment: ?*anyopaque,
usri11_full_name: ?*anyopaque,
usri11_priv: u32,
usri11_auth_flags: u32,
usri11_password_age: u32,
usri11_home_dir: ?*anyopaque,
usri11_parms: ?*anyopaque,
usri11_last_logon: u32,
usri11_last_logoff: u32,
usri11_bad_pw_count: u32,
usri11_num_logons: u32,
usri11_logon_server: ?*anyopaque,
usri11_country_code: u32,
usri11_workstations: ?*anyopaque,
usri11_max_storage: u32,
usri11_units_per_week: u32,
usri11_logon_hours: ?*anyopaque,
usri11_code_page: u32,
};type
USER_INFO_11 {.bycopy.} = object
usri11_name: pointer
usri11_comment: pointer
usri11_usr_comment: pointer
usri11_full_name: pointer
usri11_priv: uint32
usri11_auth_flags: uint32
usri11_password_age: uint32
usri11_home_dir: pointer
usri11_parms: pointer
usri11_last_logon: uint32
usri11_last_logoff: uint32
usri11_bad_pw_count: uint32
usri11_num_logons: uint32
usri11_logon_server: pointer
usri11_country_code: uint32
usri11_workstations: pointer
usri11_max_storage: uint32
usri11_units_per_week: uint32
usri11_logon_hours: pointer
usri11_code_page: uint32struct USER_INFO_11
{
void* usri11_name;
void* usri11_comment;
void* usri11_usr_comment;
void* usri11_full_name;
uint usri11_priv;
uint usri11_auth_flags;
uint usri11_password_age;
void* usri11_home_dir;
void* usri11_parms;
uint usri11_last_logon;
uint usri11_last_logoff;
uint usri11_bad_pw_count;
uint usri11_num_logons;
void* usri11_logon_server;
uint usri11_country_code;
void* usri11_workstations;
uint usri11_max_storage;
uint usri11_units_per_week;
void* usri11_logon_hours;
uint usri11_code_page;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; USER_INFO_11 サイズ: 80 バイト(x86)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; usri11_name : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; usri11_comment : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; usri11_usr_comment : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; usri11_full_name : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; usri11_priv : USER_PRIV (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; usri11_auth_flags : AF_OP (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; usri11_password_age : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; usri11_home_dir : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; usri11_parms : LPWSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; usri11_last_logon : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; usri11_last_logoff : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; usri11_bad_pw_count : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; usri11_num_logons : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; usri11_logon_server : LPWSTR (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; usri11_country_code : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; usri11_workstations : LPWSTR (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; usri11_max_storage : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; usri11_units_per_week : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; usri11_logon_hours : BYTE* (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; usri11_code_page : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; USER_INFO_11 サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; usri11_name : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; usri11_comment : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; usri11_usr_comment : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; usri11_full_name : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; usri11_priv : USER_PRIV (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; usri11_auth_flags : AF_OP (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; usri11_password_age : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; usri11_home_dir : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; usri11_parms : LPWSTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; usri11_last_logon : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; usri11_last_logoff : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; usri11_bad_pw_count : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; usri11_num_logons : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; usri11_logon_server : LPWSTR (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; usri11_country_code : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; usri11_workstations : LPWSTR (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; usri11_max_storage : DWORD (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; usri11_units_per_week : DWORD (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; usri11_logon_hours : BYTE* (+112, 8byte) qpoke st,112,値 / qpeek(st,112) ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; usri11_code_page : DWORD (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global USER_INFO_11
#field intptr usri11_name
#field intptr usri11_comment
#field intptr usri11_usr_comment
#field intptr usri11_full_name
#field int usri11_priv
#field int usri11_auth_flags
#field int usri11_password_age
#field intptr usri11_home_dir
#field intptr usri11_parms
#field int usri11_last_logon
#field int usri11_last_logoff
#field int usri11_bad_pw_count
#field int usri11_num_logons
#field intptr usri11_logon_server
#field int usri11_country_code
#field intptr usri11_workstations
#field int usri11_max_storage
#field int usri11_units_per_week
#field intptr usri11_logon_hours
#field int usri11_code_page
#endstruct
stdim st, USER_INFO_11 ; NSTRUCT 変数を確保
st->usri11_priv = 100
mes "usri11_priv=" + st->usri11_priv