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

USER_INFO_21

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

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

フィールド

フィールドサイズx64x86説明
usri21_passwordBYTE16+0+0暗号化されたパスワード情報(ENCRYPTED_LM_OWF_PASSWORD_LENGTH=16バイト)。

各言語での定義

#include <windows.h>

// USER_INFO_21  (x64 16 / x86 16 バイト)
typedef struct USER_INFO_21 {
    BYTE usri21_password[16];
} USER_INFO_21;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct USER_INFO_21
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] usri21_password;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure USER_INFO_21
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public usri21_password() As Byte
End Structure
import ctypes
from ctypes import wintypes

class USER_INFO_21(ctypes.Structure):
    _fields_ = [
        ("usri21_password", ctypes.c_ubyte * 16),
    ]
#[repr(C)]
pub struct USER_INFO_21 {
    pub usri21_password: [u8; 16],
}
import "golang.org/x/sys/windows"

type USER_INFO_21 struct {
	usri21_password [16]byte
}
type
  USER_INFO_21 = record
    usri21_password: array[0..15] of Byte;
  end;
const USER_INFO_21 = extern struct {
    usri21_password: [16]u8,
};
type
  USER_INFO_21 {.bycopy.} = object
    usri21_password: array[16, uint8]
struct USER_INFO_21
{
    ubyte[16] usri21_password;
}

HSP用 定義

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

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

stdim st, USER_INFO_21        ; NSTRUCT 変数を確保