Win32 API 日本語リファレンス
ホームNetworking.Clustering › CLUSTER_SET_PASSWORD_STATUS

CLUSTER_SET_PASSWORD_STATUS

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

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

フィールド

フィールドサイズx64x86説明
NodeIdDWORD4+0+0対象ノードのID。
SetAttemptedBOOLEAN1+4+4TRUEならこのノードでパスワード設定を試みたことを示す論理値。
ReturnStatusDWORD4+8+8パスワード設定操作の結果コード(Win32エラー)。

各言語での定義

#include <windows.h>

// CLUSTER_SET_PASSWORD_STATUS  (x64 12 / x86 12 バイト)
typedef struct CLUSTER_SET_PASSWORD_STATUS {
    DWORD NodeId;
    BOOLEAN SetAttempted;
    DWORD ReturnStatus;
} CLUSTER_SET_PASSWORD_STATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSTER_SET_PASSWORD_STATUS
{
    public uint NodeId;
    [MarshalAs(UnmanagedType.U1)] public bool SetAttempted;
    public uint ReturnStatus;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSTER_SET_PASSWORD_STATUS
    Public NodeId As UInteger
    <MarshalAs(UnmanagedType.U1)> Public SetAttempted As Boolean
    Public ReturnStatus As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CLUSTER_SET_PASSWORD_STATUS(ctypes.Structure):
    _fields_ = [
        ("NodeId", wintypes.DWORD),
        ("SetAttempted", ctypes.c_byte),
        ("ReturnStatus", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CLUSTER_SET_PASSWORD_STATUS {
    pub NodeId: u32,
    pub SetAttempted: u8,
    pub ReturnStatus: u32,
}
import "golang.org/x/sys/windows"

type CLUSTER_SET_PASSWORD_STATUS struct {
	NodeId uint32
	SetAttempted byte
	ReturnStatus uint32
}
type
  CLUSTER_SET_PASSWORD_STATUS = record
    NodeId: DWORD;
    SetAttempted: ByteBool;
    ReturnStatus: DWORD;
  end;
const CLUSTER_SET_PASSWORD_STATUS = extern struct {
    NodeId: u32,
    SetAttempted: u8,
    ReturnStatus: u32,
};
type
  CLUSTER_SET_PASSWORD_STATUS {.bycopy.} = object
    NodeId: uint32
    SetAttempted: uint8
    ReturnStatus: uint32
struct CLUSTER_SET_PASSWORD_STATUS
{
    uint NodeId;
    ubyte SetAttempted;
    uint ReturnStatus;
}

HSP用 定義

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

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

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