ホーム › Networking.WinHttp › WINHTTP_PROXY_RESULT_EX
WINHTTP_PROXY_RESULT_EX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cEntries | DWORD | 4 | +0 | +0 | pEntries配列の要素数。プロキシ候補エントリの個数。 |
| pEntries | WINHTTP_PROXY_RESULT_ENTRY* | 8/4 | +8 | +4 | プロキシ結果エントリの配列へのポインタ。各候補プロキシ情報を保持する。 |
| hProxyDetectionHandle | HANDLE | 8/4 | +16 | +8 | プロキシ検出操作に関連付けられたハンドル。後続処理や解放に用いる。 |
| dwProxyInterfaceAffinity | DWORD | 4 | +24 | +12 | プロキシが結び付くネットワークインターフェイスのアフィニティ(インデックス)。 |
各言語での定義
#include <windows.h>
// WINHTTP_PROXY_RESULT_EX (x64 32 / x86 16 バイト)
typedef struct WINHTTP_PROXY_RESULT_EX {
DWORD cEntries;
WINHTTP_PROXY_RESULT_ENTRY* pEntries;
HANDLE hProxyDetectionHandle;
DWORD dwProxyInterfaceAffinity;
} WINHTTP_PROXY_RESULT_EX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WINHTTP_PROXY_RESULT_EX
{
public uint cEntries;
public IntPtr pEntries;
public IntPtr hProxyDetectionHandle;
public uint dwProxyInterfaceAffinity;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WINHTTP_PROXY_RESULT_EX
Public cEntries As UInteger
Public pEntries As IntPtr
Public hProxyDetectionHandle As IntPtr
Public dwProxyInterfaceAffinity As UInteger
End Structureimport ctypes
from ctypes import wintypes
class WINHTTP_PROXY_RESULT_EX(ctypes.Structure):
_fields_ = [
("cEntries", wintypes.DWORD),
("pEntries", ctypes.c_void_p),
("hProxyDetectionHandle", ctypes.c_void_p),
("dwProxyInterfaceAffinity", wintypes.DWORD),
]#[repr(C)]
pub struct WINHTTP_PROXY_RESULT_EX {
pub cEntries: u32,
pub pEntries: *mut core::ffi::c_void,
pub hProxyDetectionHandle: *mut core::ffi::c_void,
pub dwProxyInterfaceAffinity: u32,
}import "golang.org/x/sys/windows"
type WINHTTP_PROXY_RESULT_EX struct {
cEntries uint32
pEntries uintptr
hProxyDetectionHandle uintptr
dwProxyInterfaceAffinity uint32
}type
WINHTTP_PROXY_RESULT_EX = record
cEntries: DWORD;
pEntries: Pointer;
hProxyDetectionHandle: Pointer;
dwProxyInterfaceAffinity: DWORD;
end;const WINHTTP_PROXY_RESULT_EX = extern struct {
cEntries: u32,
pEntries: ?*anyopaque,
hProxyDetectionHandle: ?*anyopaque,
dwProxyInterfaceAffinity: u32,
};type
WINHTTP_PROXY_RESULT_EX {.bycopy.} = object
cEntries: uint32
pEntries: pointer
hProxyDetectionHandle: pointer
dwProxyInterfaceAffinity: uint32struct WINHTTP_PROXY_RESULT_EX
{
uint cEntries;
void* pEntries;
void* hProxyDetectionHandle;
uint dwProxyInterfaceAffinity;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WINHTTP_PROXY_RESULT_EX サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; cEntries : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pEntries : WINHTTP_PROXY_RESULT_ENTRY* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; hProxyDetectionHandle : HANDLE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwProxyInterfaceAffinity : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WINHTTP_PROXY_RESULT_EX サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cEntries : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pEntries : WINHTTP_PROXY_RESULT_ENTRY* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; hProxyDetectionHandle : HANDLE (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dwProxyInterfaceAffinity : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WINHTTP_PROXY_RESULT_EX
#field int cEntries
#field intptr pEntries
#field intptr hProxyDetectionHandle
#field int dwProxyInterfaceAffinity
#endstruct
stdim st, WINHTTP_PROXY_RESULT_EX ; NSTRUCT 変数を確保
st->cEntries = 100
mes "cEntries=" + st->cEntries