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

WKSTA_INFO_100

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

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

フィールド

フィールドサイズx64x86説明
wki100_platform_idDWORD4+0+0ワークステーションの動作プラットフォームIDを示す(PLATFORM_ID_NT等)。
wki100_computernameLPWSTR8/4+8+4ローカルコンピューター名を表すUnicode文字列へのポインタ。
wki100_langroupLPWSTR8/4+16+8所属するワークグループまたはドメイン名を表す文字列へのポインタ。
wki100_ver_majorDWORD4+24+12ワークステーションソフトウェアのメジャーバージョン番号を示す。
wki100_ver_minorDWORD4+28+16ワークステーションソフトウェアのマイナーバージョン番号を示す。

各言語での定義

#include <windows.h>

// WKSTA_INFO_100  (x64 32 / x86 20 バイト)
typedef struct WKSTA_INFO_100 {
    DWORD wki100_platform_id;
    LPWSTR wki100_computername;
    LPWSTR wki100_langroup;
    DWORD wki100_ver_major;
    DWORD wki100_ver_minor;
} WKSTA_INFO_100;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WKSTA_INFO_100
{
    public uint wki100_platform_id;
    public IntPtr wki100_computername;
    public IntPtr wki100_langroup;
    public uint wki100_ver_major;
    public uint wki100_ver_minor;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WKSTA_INFO_100
    Public wki100_platform_id As UInteger
    Public wki100_computername As IntPtr
    Public wki100_langroup As IntPtr
    Public wki100_ver_major As UInteger
    Public wki100_ver_minor As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WKSTA_INFO_100(ctypes.Structure):
    _fields_ = [
        ("wki100_platform_id", wintypes.DWORD),
        ("wki100_computername", ctypes.c_void_p),
        ("wki100_langroup", ctypes.c_void_p),
        ("wki100_ver_major", wintypes.DWORD),
        ("wki100_ver_minor", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WKSTA_INFO_100 {
    pub wki100_platform_id: u32,
    pub wki100_computername: *mut core::ffi::c_void,
    pub wki100_langroup: *mut core::ffi::c_void,
    pub wki100_ver_major: u32,
    pub wki100_ver_minor: u32,
}
import "golang.org/x/sys/windows"

type WKSTA_INFO_100 struct {
	wki100_platform_id uint32
	wki100_computername uintptr
	wki100_langroup uintptr
	wki100_ver_major uint32
	wki100_ver_minor uint32
}
type
  WKSTA_INFO_100 = record
    wki100_platform_id: DWORD;
    wki100_computername: Pointer;
    wki100_langroup: Pointer;
    wki100_ver_major: DWORD;
    wki100_ver_minor: DWORD;
  end;
const WKSTA_INFO_100 = extern struct {
    wki100_platform_id: u32,
    wki100_computername: ?*anyopaque,
    wki100_langroup: ?*anyopaque,
    wki100_ver_major: u32,
    wki100_ver_minor: u32,
};
type
  WKSTA_INFO_100 {.bycopy.} = object
    wki100_platform_id: uint32
    wki100_computername: pointer
    wki100_langroup: pointer
    wki100_ver_major: uint32
    wki100_ver_minor: uint32
struct WKSTA_INFO_100
{
    uint wki100_platform_id;
    void* wki100_computername;
    void* wki100_langroup;
    uint wki100_ver_major;
    uint wki100_ver_minor;
}

HSP用 定義

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

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

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