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

WKSTA_INFO_101

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

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

フィールド

フィールドサイズx64x86説明
wki101_platform_idDWORD4+0+0ワークステーションの動作プラットフォームIDを示す(PLATFORM_ID_NT等)。
wki101_computernameLPWSTR8/4+8+4ローカルコンピューター名を表すUnicode文字列へのポインタ。
wki101_langroupLPWSTR8/4+16+8所属するワークグループまたはドメイン名を表す文字列へのポインタ。
wki101_ver_majorDWORD4+24+12ワークステーションソフトウェアのメジャーバージョン番号を示す。
wki101_ver_minorDWORD4+28+16ワークステーションソフトウェアのマイナーバージョン番号を示す。
wki101_lanrootLPWSTR8/4+32+20ネットワークソフトウェアがインストールされたパスを表す文字列。互換用。

各言語での定義

#include <windows.h>

// WKSTA_INFO_101  (x64 40 / x86 24 バイト)
typedef struct WKSTA_INFO_101 {
    DWORD wki101_platform_id;
    LPWSTR wki101_computername;
    LPWSTR wki101_langroup;
    DWORD wki101_ver_major;
    DWORD wki101_ver_minor;
    LPWSTR wki101_lanroot;
} WKSTA_INFO_101;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WKSTA_INFO_101
{
    public uint wki101_platform_id;
    public IntPtr wki101_computername;
    public IntPtr wki101_langroup;
    public uint wki101_ver_major;
    public uint wki101_ver_minor;
    public IntPtr wki101_lanroot;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WKSTA_INFO_101
    Public wki101_platform_id As UInteger
    Public wki101_computername As IntPtr
    Public wki101_langroup As IntPtr
    Public wki101_ver_major As UInteger
    Public wki101_ver_minor As UInteger
    Public wki101_lanroot As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class WKSTA_INFO_101(ctypes.Structure):
    _fields_ = [
        ("wki101_platform_id", wintypes.DWORD),
        ("wki101_computername", ctypes.c_void_p),
        ("wki101_langroup", ctypes.c_void_p),
        ("wki101_ver_major", wintypes.DWORD),
        ("wki101_ver_minor", wintypes.DWORD),
        ("wki101_lanroot", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct WKSTA_INFO_101 {
    pub wki101_platform_id: u32,
    pub wki101_computername: *mut core::ffi::c_void,
    pub wki101_langroup: *mut core::ffi::c_void,
    pub wki101_ver_major: u32,
    pub wki101_ver_minor: u32,
    pub wki101_lanroot: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type WKSTA_INFO_101 struct {
	wki101_platform_id uint32
	wki101_computername uintptr
	wki101_langroup uintptr
	wki101_ver_major uint32
	wki101_ver_minor uint32
	wki101_lanroot uintptr
}
type
  WKSTA_INFO_101 = record
    wki101_platform_id: DWORD;
    wki101_computername: Pointer;
    wki101_langroup: Pointer;
    wki101_ver_major: DWORD;
    wki101_ver_minor: DWORD;
    wki101_lanroot: Pointer;
  end;
const WKSTA_INFO_101 = extern struct {
    wki101_platform_id: u32,
    wki101_computername: ?*anyopaque,
    wki101_langroup: ?*anyopaque,
    wki101_ver_major: u32,
    wki101_ver_minor: u32,
    wki101_lanroot: ?*anyopaque,
};
type
  WKSTA_INFO_101 {.bycopy.} = object
    wki101_platform_id: uint32
    wki101_computername: pointer
    wki101_langroup: pointer
    wki101_ver_major: uint32
    wki101_ver_minor: uint32
    wki101_lanroot: pointer
struct WKSTA_INFO_101
{
    uint wki101_platform_id;
    void* wki101_computername;
    void* wki101_langroup;
    uint wki101_ver_major;
    uint wki101_ver_minor;
    void* wki101_lanroot;
}

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

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