ホーム › Networking.WinHttp › WINHTTP_REQUEST_TIMES
WINHTTP_REQUEST_TIMES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cTimes | DWORD | 4 | +0 | +0 | rgullTimes配列に格納された有効な時刻エントリの数。 |
| rgullTimes | ULONGLONG | 512 | +4 | +4 | 要求処理の各段階のタイムスタンプ配列。WINHTTP_REQUEST_TIME_ENTRYで定義された段階別の時刻を保持する。 |
各言語での定義
#include <windows.h>
// WINHTTP_REQUEST_TIMES (x64 516 / x86 516 バイト)
#pragma pack(push, 4)
typedef struct WINHTTP_REQUEST_TIMES {
DWORD cTimes;
ULONGLONG rgullTimes[64];
} WINHTTP_REQUEST_TIMES;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct WINHTTP_REQUEST_TIMES
{
public uint cTimes;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public ulong[] rgullTimes;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure WINHTTP_REQUEST_TIMES
Public cTimes As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public rgullTimes() As ULong
End Structureimport ctypes
from ctypes import wintypes
class WINHTTP_REQUEST_TIMES(ctypes.Structure):
_pack_ = 4
_fields_ = [
("cTimes", wintypes.DWORD),
("rgullTimes", ctypes.c_ulonglong * 64),
]#[repr(C, packed(4))]
pub struct WINHTTP_REQUEST_TIMES {
pub cTimes: u32,
pub rgullTimes: [u64; 64],
}import "golang.org/x/sys/windows"
type WINHTTP_REQUEST_TIMES struct {
cTimes uint32
rgullTimes [64]uint64
}type
WINHTTP_REQUEST_TIMES = packed record
cTimes: DWORD;
rgullTimes: array[0..63] of UInt64;
end;const WINHTTP_REQUEST_TIMES = extern struct {
cTimes: u32,
rgullTimes: [64]u64,
};type
WINHTTP_REQUEST_TIMES {.packed.} = object
cTimes: uint32
rgullTimes: array[64, uint64]align(4)
struct WINHTTP_REQUEST_TIMES
{
uint cTimes;
ulong[64] rgullTimes;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WINHTTP_REQUEST_TIMES サイズ: 516 バイト(x64)
dim st, 129 ; 4byte整数×129(構造体サイズ 516 / 4 切り上げ)
; cTimes : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; rgullTimes : ULONGLONG (+4, 512byte) varptr(st)+4 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WINHTTP_REQUEST_TIMES, pack=4
#field int cTimes
#field int64 rgullTimes 64
#endstruct
stdim st, WINHTTP_REQUEST_TIMES ; NSTRUCT 変数を確保
st->cTimes = 100
mes "cTimes=" + st->cTimes