ホーム › System.RemoteManagement › WSMAN_SHELL_STARTUP_INFO_V10
WSMAN_SHELL_STARTUP_INFO_V10
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| inputStreamSet | WSMAN_STREAM_ID_SET* | 8/4 | +0 | +0 | 入力ストリームIDセットへのポインター。WSMAN_STREAM_ID_SET。 |
| outputStreamSet | WSMAN_STREAM_ID_SET* | 8/4 | +8 | +4 | 出力ストリームIDセットへのポインター。WSMAN_STREAM_ID_SET。 |
| idleTimeoutMs | DWORD | 4 | +16 | +8 | シェルのアイドルタイムアウトをミリ秒単位で表す。 |
| workingDirectory | LPWSTR | 8/4 | +24 | +12 | シェルの作業ディレクトリ。LPWSTR型。NULL可。 |
| variableSet | WSMAN_ENVIRONMENT_VARIABLE_SET* | 8/4 | +32 | +16 | シェルに設定する環境変数セットへのポインター。NULL可。 |
各言語での定義
#include <windows.h>
// WSMAN_SHELL_STARTUP_INFO_V10 (x64 40 / x86 20 バイト)
typedef struct WSMAN_SHELL_STARTUP_INFO_V10 {
WSMAN_STREAM_ID_SET* inputStreamSet;
WSMAN_STREAM_ID_SET* outputStreamSet;
DWORD idleTimeoutMs;
LPWSTR workingDirectory;
WSMAN_ENVIRONMENT_VARIABLE_SET* variableSet;
} WSMAN_SHELL_STARTUP_INFO_V10;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WSMAN_SHELL_STARTUP_INFO_V10
{
public IntPtr inputStreamSet;
public IntPtr outputStreamSet;
public uint idleTimeoutMs;
public IntPtr workingDirectory;
public IntPtr variableSet;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WSMAN_SHELL_STARTUP_INFO_V10
Public inputStreamSet As IntPtr
Public outputStreamSet As IntPtr
Public idleTimeoutMs As UInteger
Public workingDirectory As IntPtr
Public variableSet As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WSMAN_SHELL_STARTUP_INFO_V10(ctypes.Structure):
_fields_ = [
("inputStreamSet", ctypes.c_void_p),
("outputStreamSet", ctypes.c_void_p),
("idleTimeoutMs", wintypes.DWORD),
("workingDirectory", ctypes.c_void_p),
("variableSet", ctypes.c_void_p),
]#[repr(C)]
pub struct WSMAN_SHELL_STARTUP_INFO_V10 {
pub inputStreamSet: *mut core::ffi::c_void,
pub outputStreamSet: *mut core::ffi::c_void,
pub idleTimeoutMs: u32,
pub workingDirectory: *mut core::ffi::c_void,
pub variableSet: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WSMAN_SHELL_STARTUP_INFO_V10 struct {
inputStreamSet uintptr
outputStreamSet uintptr
idleTimeoutMs uint32
workingDirectory uintptr
variableSet uintptr
}type
WSMAN_SHELL_STARTUP_INFO_V10 = record
inputStreamSet: Pointer;
outputStreamSet: Pointer;
idleTimeoutMs: DWORD;
workingDirectory: Pointer;
variableSet: Pointer;
end;const WSMAN_SHELL_STARTUP_INFO_V10 = extern struct {
inputStreamSet: ?*anyopaque,
outputStreamSet: ?*anyopaque,
idleTimeoutMs: u32,
workingDirectory: ?*anyopaque,
variableSet: ?*anyopaque,
};type
WSMAN_SHELL_STARTUP_INFO_V10 {.bycopy.} = object
inputStreamSet: pointer
outputStreamSet: pointer
idleTimeoutMs: uint32
workingDirectory: pointer
variableSet: pointerstruct WSMAN_SHELL_STARTUP_INFO_V10
{
void* inputStreamSet;
void* outputStreamSet;
uint idleTimeoutMs;
void* workingDirectory;
void* variableSet;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WSMAN_SHELL_STARTUP_INFO_V10 サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; inputStreamSet : WSMAN_STREAM_ID_SET* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; outputStreamSet : WSMAN_STREAM_ID_SET* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; idleTimeoutMs : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; workingDirectory : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; variableSet : WSMAN_ENVIRONMENT_VARIABLE_SET* (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WSMAN_SHELL_STARTUP_INFO_V10 サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; inputStreamSet : WSMAN_STREAM_ID_SET* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; outputStreamSet : WSMAN_STREAM_ID_SET* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; idleTimeoutMs : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; workingDirectory : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; variableSet : WSMAN_ENVIRONMENT_VARIABLE_SET* (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WSMAN_SHELL_STARTUP_INFO_V10
#field intptr inputStreamSet
#field intptr outputStreamSet
#field int idleTimeoutMs
#field intptr workingDirectory
#field intptr variableSet
#endstruct
stdim st, WSMAN_SHELL_STARTUP_INFO_V10 ; NSTRUCT 変数を確保
st->idleTimeoutMs = 100
mes "idleTimeoutMs=" + st->idleTimeoutMs