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

DNS_QUERY_CANCEL

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

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

フィールド

フィールドサイズx64x86説明
ReservedCHAR32+0+0非同期クエリ取消ハンドルの内部状態を保持する予約バッファ。直接操作しない。

各言語での定義

#include <windows.h>

// DNS_QUERY_CANCEL  (x64 32 / x86 32 バイト)
typedef struct DNS_QUERY_CANCEL {
    CHAR Reserved[32];
} DNS_QUERY_CANCEL;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DNS_QUERY_CANCEL
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public sbyte[] Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DNS_QUERY_CANCEL
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public Reserved() As SByte
End Structure
import ctypes
from ctypes import wintypes

class DNS_QUERY_CANCEL(ctypes.Structure):
    _fields_ = [
        ("Reserved", ctypes.c_byte * 32),
    ]
#[repr(C)]
pub struct DNS_QUERY_CANCEL {
    pub Reserved: [i8; 32],
}
import "golang.org/x/sys/windows"

type DNS_QUERY_CANCEL struct {
	Reserved [32]int8
}
type
  DNS_QUERY_CANCEL = record
    Reserved: array[0..31] of Shortint;
  end;
const DNS_QUERY_CANCEL = extern struct {
    Reserved: [32]i8,
};
type
  DNS_QUERY_CANCEL {.bycopy.} = object
    Reserved: array[32, int8]
struct DNS_QUERY_CANCEL
{
    byte[32] Reserved;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DNS_QUERY_CANCEL サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Reserved : CHAR (+0, 32byte)  varptr(st)+0 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DNS_QUERY_CANCEL
    #field byte Reserved 32
#endstruct

stdim st, DNS_QUERY_CANCEL        ; NSTRUCT 変数を確保