ホーム › Networking.WindowsWebServices › WS_TIMESPAN_DESCRIPTION
WS_TIMESPAN_DESCRIPTION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| minValue | WS_TIMESPAN | 8 | +0 | +0 | 許容する時間間隔の最小値(WS_TIMESPAN)。 |
| maxValue | WS_TIMESPAN | 8 | +8 | +8 | 許容する時間間隔の最大値(WS_TIMESPAN)。 |
各言語での定義
#include <windows.h>
// WS_TIMESPAN (x64 8 / x86 8 バイト)
typedef struct WS_TIMESPAN {
LONGLONG ticks;
} WS_TIMESPAN;
// WS_TIMESPAN_DESCRIPTION (x64 16 / x86 16 バイト)
typedef struct WS_TIMESPAN_DESCRIPTION {
WS_TIMESPAN minValue;
WS_TIMESPAN maxValue;
} WS_TIMESPAN_DESCRIPTION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_TIMESPAN
{
public long ticks;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_TIMESPAN_DESCRIPTION
{
public WS_TIMESPAN minValue;
public WS_TIMESPAN maxValue;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_TIMESPAN
Public ticks As Long
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_TIMESPAN_DESCRIPTION
Public minValue As WS_TIMESPAN
Public maxValue As WS_TIMESPAN
End Structureimport ctypes
from ctypes import wintypes
class WS_TIMESPAN(ctypes.Structure):
_fields_ = [
("ticks", ctypes.c_longlong),
]
class WS_TIMESPAN_DESCRIPTION(ctypes.Structure):
_fields_ = [
("minValue", WS_TIMESPAN),
("maxValue", WS_TIMESPAN),
]#[repr(C)]
pub struct WS_TIMESPAN {
pub ticks: i64,
}
#[repr(C)]
pub struct WS_TIMESPAN_DESCRIPTION {
pub minValue: WS_TIMESPAN,
pub maxValue: WS_TIMESPAN,
}import "golang.org/x/sys/windows"
type WS_TIMESPAN struct {
ticks int64
}
type WS_TIMESPAN_DESCRIPTION struct {
minValue WS_TIMESPAN
maxValue WS_TIMESPAN
}type
WS_TIMESPAN = record
ticks: Int64;
end;
WS_TIMESPAN_DESCRIPTION = record
minValue: WS_TIMESPAN;
maxValue: WS_TIMESPAN;
end;const WS_TIMESPAN = extern struct {
ticks: i64,
};
const WS_TIMESPAN_DESCRIPTION = extern struct {
minValue: WS_TIMESPAN,
maxValue: WS_TIMESPAN,
};type
WS_TIMESPAN {.bycopy.} = object
ticks: int64
WS_TIMESPAN_DESCRIPTION {.bycopy.} = object
minValue: WS_TIMESPAN
maxValue: WS_TIMESPANstruct WS_TIMESPAN
{
long ticks;
}
struct WS_TIMESPAN_DESCRIPTION
{
WS_TIMESPAN minValue;
WS_TIMESPAN maxValue;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_TIMESPAN_DESCRIPTION サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; minValue : WS_TIMESPAN (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; maxValue : WS_TIMESPAN (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WS_TIMESPAN
#field int64 ticks
#endstruct
#defstruct global WS_TIMESPAN_DESCRIPTION
#field WS_TIMESPAN minValue
#field WS_TIMESPAN maxValue
#endstruct
stdim st, WS_TIMESPAN_DESCRIPTION ; NSTRUCT 変数を確保