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

USER_MODALS_INFO_3

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

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

フィールド

フィールドサイズx64x86説明
usrmod3_lockout_durationDWORD4+0+0ロックアウトされたアカウントが自動的にロック解除されるまで、ロックされた状態を維持する時間を秒単位で指定します。
usrmod3_lockout_observation_windowDWORD4+4+4ロックアウトが発生するまでに、失敗した 2 回のログオン試行の間に経過できる最大時間を秒単位で指定します。
usrmod3_lockout_thresholdDWORD4+8+8アカウントが「ロックアウト」としてマークされるまでに発生し得る、無効なパスワード認証の回数を指定します。

公式ドキュメント

USER_MODALS_INFO_3 構造体は、セキュリティ データベース (セキュリティ アカウント マネージャー (SAM) データベース、ドメイン コントローラーの場合は Active Directory) 内のユーザーおよびグローバル グループのロックアウト情報を格納します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// USER_MODALS_INFO_3  (x64 12 / x86 12 バイト)
typedef struct USER_MODALS_INFO_3 {
    DWORD usrmod3_lockout_duration;
    DWORD usrmod3_lockout_observation_window;
    DWORD usrmod3_lockout_threshold;
} USER_MODALS_INFO_3;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USER_MODALS_INFO_3
{
    public uint usrmod3_lockout_duration;
    public uint usrmod3_lockout_observation_window;
    public uint usrmod3_lockout_threshold;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure USER_MODALS_INFO_3
    Public usrmod3_lockout_duration As UInteger
    Public usrmod3_lockout_observation_window As UInteger
    Public usrmod3_lockout_threshold As UInteger
End Structure
import ctypes
from ctypes import wintypes

class USER_MODALS_INFO_3(ctypes.Structure):
    _fields_ = [
        ("usrmod3_lockout_duration", wintypes.DWORD),
        ("usrmod3_lockout_observation_window", wintypes.DWORD),
        ("usrmod3_lockout_threshold", wintypes.DWORD),
    ]
#[repr(C)]
pub struct USER_MODALS_INFO_3 {
    pub usrmod3_lockout_duration: u32,
    pub usrmod3_lockout_observation_window: u32,
    pub usrmod3_lockout_threshold: u32,
}
import "golang.org/x/sys/windows"

type USER_MODALS_INFO_3 struct {
	usrmod3_lockout_duration uint32
	usrmod3_lockout_observation_window uint32
	usrmod3_lockout_threshold uint32
}
type
  USER_MODALS_INFO_3 = record
    usrmod3_lockout_duration: DWORD;
    usrmod3_lockout_observation_window: DWORD;
    usrmod3_lockout_threshold: DWORD;
  end;
const USER_MODALS_INFO_3 = extern struct {
    usrmod3_lockout_duration: u32,
    usrmod3_lockout_observation_window: u32,
    usrmod3_lockout_threshold: u32,
};
type
  USER_MODALS_INFO_3 {.bycopy.} = object
    usrmod3_lockout_duration: uint32
    usrmod3_lockout_observation_window: uint32
    usrmod3_lockout_threshold: uint32
struct USER_MODALS_INFO_3
{
    uint usrmod3_lockout_duration;
    uint usrmod3_lockout_observation_window;
    uint usrmod3_lockout_threshold;
}

HSP用 定義

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

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

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