Win32 API 日本語リファレンス
ホームNetworking.WinInet › HttpQueryInfoW

HttpQueryInfoW

関数
HTTP応答のヘッダーや状態情報を問い合わせる(Unicode版)。
DLLWININET.dll文字セットUnicode (-W)呼出規約winapiSetLastErrorあり対応OSWindows 2000 以降

シグネチャ

// WININET.dll  (Unicode / -W)
#include <windows.h>

BOOL HttpQueryInfoW(
    void* hRequest,
    DWORD dwInfoLevel,
    void* lpBuffer,   // optional
    DWORD* lpdwBufferLength,
    DWORD* lpdwIndex   // optional
);

パラメーター

名前方向説明
hRequestvoid*inHttpOpenRequest または InternetOpenUrl 関数の呼び出しによって返されたハンドルです。
dwInfoLevelDWORDin取得する属性と、リクエストを変更するフラグの組み合わせです。指定可能な属性と修飾子の値の一覧については、Query Info Flags を参照してください。
lpBuffervoid*inoutoptional要求した情報を受け取るバッファーへのポインターです。このパラメーターを NULL にすることはできません。
lpdwBufferLengthDWORD*inout

lpvBuffer が指すバッファーのサイズ (バイト単位) を、呼び出し時に格納する変数へのポインターです。

関数が正常に返ると、この変数にはバッファーへ書き込まれた情報のバイト数が格納されます。文字列の場合、このバイト数には文字列の終端 null 文字は含まれません。

関数が拡張エラーコード ERROR_INSUFFICIENT_BUFFER で失敗した場合、lpdwBufferLength が指す変数には、要求した情報を受け取るのに十分な大きさのバッファーのサイズ (バイト単位) が終了時に格納されます。呼び出し元のアプリケーションは、このサイズ以上のバッファーを割り当てて、関数を再度呼び出すことができます。

lpdwIndexDWORD*inoutoptional同じ名前の複数のヘッダーを列挙するために使用する、0 から始まるヘッダーインデックスへのポインターです。関数を呼び出す際、このパラメーターは返す対象として指定するヘッダーのインデックスです。関数が返ると、このパラメーターは次のヘッダーのインデックスになります。次のインデックスが見つからない場合は、ERROR_HTTP_HEADER_NOT_FOUND が返されます。

戻り値の型: BOOL

公式ドキュメント

HTTP リクエストに関連付けられたヘッダー情報を取得します。(Unicode)

戻り値

成功した場合は TRUE を、それ以外の場合は FALSE を返します。拡張エラー情報を取得するには、GetLastError を呼び出します。

解説(Remarks)

HttpQueryInfo からは、次の種類のデータを取得できます。

アプリケーションがデータを文字列以外のデータ型で返すことを必要とする場合は、dwInfoLevel に渡す属性に適切な修飾子を含める必要があります。

HttpQueryInfo 関数は、Microsoft Internet Explorer 3.0 では ISO-8859-1 文字に対して (HttpQueryInfoA 関数)、Internet Explorer 4.0 以降では ISO-8859-1 文字に対して (HttpQueryInfoA 関数) および ISO-8859-1 文字を UTF-16LE 文字に変換したものに対して (HttpQueryInfoW 関数) 利用できます。

注意 HttpQueryInfoA 関数は、ヘッダーを ANSI 文字ではなく ISO-8859-1 文字として表します。HttpQueryInfoW 関数は、ヘッダーを ISO-8859-1 文字を UTF-16LE 文字に変換したものとして表します。そのため、ヘッダーに非 ASCII 文字が含まれる可能性がある場合に HttpQueryInfoW 関数を使用するのは決して安全ではありません。 代わりに、アプリケーションは Codepage パラメーターを 28591 に設定した MultiByteToWideChar 関数および WideCharToMultiByte 関数を使用して、ANSI 文字と UTF-16LE 文字の間でマッピングできます。
HttpQueryInfo 関数を呼び出すサンプルコードについては、Retrieving HTTP Headers を参照してください。

WinINet API の他のすべての側面と同様に、この関数は DllMain やグローバルオブジェクトのコンストラクター・デストラクター内から安全に呼び出すことはできません。

注意 WinINet はサーバー実装をサポートしていません。また、サービスから使用すべきではありません。サーバー実装やサービスでは、Microsoft Windows HTTP Services (WinHTTP) を使用してください。
メモ

wininet.h ヘッダーは、HttpQueryInfo を、UNICODE プリプロセッサ定数の定義に基づいて ANSI 版または Unicode 版を自動的に選択するエイリアスとして定義します。エンコーディング中立なエイリアスの使用を、エンコーディング中立でないコードと混在させると、不整合が生じ、コンパイルエラーや実行時エラーを引き起こす可能性があります。詳細については、Conventions for Function Prototypes を参照してください。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

// WININET.dll  (Unicode / -W)
#include <windows.h>

BOOL HttpQueryInfoW(
    void* hRequest,
    DWORD dwInfoLevel,
    void* lpBuffer,   // optional
    DWORD* lpdwBufferLength,
    DWORD* lpdwIndex   // optional
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
static extern bool HttpQueryInfoW(
    IntPtr hRequest,   // void*
    uint dwInfoLevel,   // DWORD
    IntPtr lpBuffer,   // void* optional, in/out
    ref uint lpdwBufferLength,   // DWORD* in/out
    IntPtr lpdwIndex   // DWORD* optional, in/out
);
<DllImport("WININET.dll", CharSet:=CharSet.Unicode, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function HttpQueryInfoW(
    hRequest As IntPtr,   ' void*
    dwInfoLevel As UInteger,   ' DWORD
    lpBuffer As IntPtr,   ' void* optional, in/out
    ByRef lpdwBufferLength As UInteger,   ' DWORD* in/out
    lpdwIndex As IntPtr   ' DWORD* optional, in/out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' hRequest : void*
' dwInfoLevel : DWORD
' lpBuffer : void* optional, in/out
' lpdwBufferLength : DWORD* in/out
' lpdwIndex : DWORD* optional, in/out
Declare PtrSafe Function HttpQueryInfoW Lib "wininet" ( _
    ByVal hRequest As LongPtr, _
    ByVal dwInfoLevel As Long, _
    ByVal lpBuffer As LongPtr, _
    ByRef lpdwBufferLength As Long, _
    ByVal lpdwIndex As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HttpQueryInfoW = ctypes.windll.wininet.HttpQueryInfoW
HttpQueryInfoW.restype = wintypes.BOOL
HttpQueryInfoW.argtypes = [
    ctypes.POINTER(None),  # hRequest : void*
    wintypes.DWORD,  # dwInfoLevel : DWORD
    ctypes.POINTER(None),  # lpBuffer : void* optional, in/out
    ctypes.POINTER(wintypes.DWORD),  # lpdwBufferLength : DWORD* in/out
    ctypes.POINTER(wintypes.DWORD),  # lpdwIndex : DWORD* optional, in/out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WININET.dll')
HttpQueryInfoW = Fiddle::Function.new(
  lib['HttpQueryInfoW'],
  [
    Fiddle::TYPE_VOIDP,  # hRequest : void*
    -Fiddle::TYPE_INT,  # dwInfoLevel : DWORD
    Fiddle::TYPE_VOIDP,  # lpBuffer : void* optional, in/out
    Fiddle::TYPE_VOIDP,  # lpdwBufferLength : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # lpdwIndex : DWORD* optional, in/out
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "wininet")]
extern "system" {
    fn HttpQueryInfoW(
        hRequest: *mut (),  // void*
        dwInfoLevel: u32,  // DWORD
        lpBuffer: *mut (),  // void* optional, in/out
        lpdwBufferLength: *mut u32,  // DWORD* in/out
        lpdwIndex: *mut u32  // DWORD* optional, in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool HttpQueryInfoW(IntPtr hRequest, uint dwInfoLevel, IntPtr lpBuffer, ref uint lpdwBufferLength, IntPtr lpdwIndex);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_HttpQueryInfoW' -Namespace Win32 -PassThru
# $api::HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
#uselib "WININET.dll"
#func global HttpQueryInfoW "HttpQueryInfoW" wptr, wptr, wptr, wptr, wptr
; HttpQueryInfoW hRequest, dwInfoLevel, lpBuffer, varptr(lpdwBufferLength), varptr(lpdwIndex)   ; 戻り値は stat
; hRequest : void* -> "wptr"
; dwInfoLevel : DWORD -> "wptr"
; lpBuffer : void* optional, in/out -> "wptr"
; lpdwBufferLength : DWORD* in/out -> "wptr"
; lpdwIndex : DWORD* optional, in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WININET.dll"
#cfunc global HttpQueryInfoW "HttpQueryInfoW" sptr, int, sptr, var, var
; res = HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
; hRequest : void* -> "sptr"
; dwInfoLevel : DWORD -> "int"
; lpBuffer : void* optional, in/out -> "sptr"
; lpdwBufferLength : DWORD* in/out -> "var"
; lpdwIndex : DWORD* optional, in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL HttpQueryInfoW(void* hRequest, DWORD dwInfoLevel, void* lpBuffer, DWORD* lpdwBufferLength, DWORD* lpdwIndex)
#uselib "WININET.dll"
#cfunc global HttpQueryInfoW "HttpQueryInfoW" intptr, int, intptr, var, var
; res = HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
; hRequest : void* -> "intptr"
; dwInfoLevel : DWORD -> "int"
; lpBuffer : void* optional, in/out -> "intptr"
; lpdwBufferLength : DWORD* in/out -> "var"
; lpdwIndex : DWORD* optional, in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procHttpQueryInfoW = wininet.NewProc("HttpQueryInfoW")
)

// hRequest (void*), dwInfoLevel (DWORD), lpBuffer (void* optional, in/out), lpdwBufferLength (DWORD* in/out), lpdwIndex (DWORD* optional, in/out)
r1, _, err := procHttpQueryInfoW.Call(
	uintptr(hRequest),
	uintptr(dwInfoLevel),
	uintptr(lpBuffer),
	uintptr(lpdwBufferLength),
	uintptr(lpdwIndex),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function HttpQueryInfoW(
  hRequest: Pointer;   // void*
  dwInfoLevel: DWORD;   // DWORD
  lpBuffer: Pointer;   // void* optional, in/out
  lpdwBufferLength: Pointer;   // DWORD* in/out
  lpdwIndex: Pointer   // DWORD* optional, in/out
): BOOL; stdcall;
  external 'WININET.dll' name 'HttpQueryInfoW';
result := DllCall("WININET\HttpQueryInfoW"
    , "Ptr", hRequest   ; void*
    , "UInt", dwInfoLevel   ; DWORD
    , "Ptr", lpBuffer   ; void* optional, in/out
    , "Ptr", lpdwBufferLength   ; DWORD* in/out
    , "Ptr", lpdwIndex   ; DWORD* optional, in/out
    , "Int")   ; return: BOOL
●HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex) = DLL("WININET.dll", "bool HttpQueryInfoW(void*, dword, void*, void*, void*)")
# 呼び出し: HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
# hRequest : void* -> "void*"
# dwInfoLevel : DWORD -> "dword"
# lpBuffer : void* optional, in/out -> "void*"
# lpdwBufferLength : DWORD* in/out -> "void*"
# lpdwIndex : DWORD* optional, in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。
const std = @import("std");

extern "wininet" fn HttpQueryInfoW(
    hRequest: ?*anyopaque, // void*
    dwInfoLevel: u32, // DWORD
    lpBuffer: ?*anyopaque, // void* optional, in/out
    lpdwBufferLength: [*c]u32, // DWORD* in/out
    lpdwIndex: [*c]u32 // DWORD* optional, in/out
) callconv(std.os.windows.WINAPI) i32;
// Unicode(-W): UTF-16LE のヌル終端バッファ([*c]const u16)を渡す。
proc HttpQueryInfoW(
    hRequest: pointer,  # void*
    dwInfoLevel: uint32,  # DWORD
    lpBuffer: pointer,  # void* optional, in/out
    lpdwBufferLength: ptr uint32,  # DWORD* in/out
    lpdwIndex: ptr uint32  # DWORD* optional, in/out
): int32 {.importc: "HttpQueryInfoW", stdcall, dynlib: "WININET.dll".}
# Unicode(-W): WideCString は newWideCString("...") で生成。
pragma(lib, "wininet");
extern(Windows)
int HttpQueryInfoW(
    void* hRequest,   // void*
    uint dwInfoLevel,   // DWORD
    void* lpBuffer,   // void* optional, in/out
    uint* lpdwBufferLength,   // DWORD* in/out
    uint* lpdwIndex   // DWORD* optional, in/out
);
ccall((:HttpQueryInfoW, "WININET.dll"), stdcall, Int32,
      (Ptr{Cvoid}, UInt32, Ptr{Cvoid}, Ptr{UInt32}, Ptr{UInt32}),
      hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
# hRequest : void* -> Ptr{Cvoid}
# dwInfoLevel : DWORD -> UInt32
# lpBuffer : void* optional, in/out -> Ptr{Cvoid}
# lpdwBufferLength : DWORD* in/out -> Ptr{UInt32}
# lpdwIndex : DWORD* optional, in/out -> Ptr{UInt32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
# Unicode(-W): Cwstring には transcode(UInt16, "...") 等で UTF-16 を渡す。
local ffi = require("ffi")
ffi.cdef[[
int32_t HttpQueryInfoW(
    void* hRequest,
    uint32_t dwInfoLevel,
    void* lpBuffer,
    uint32_t* lpdwBufferLength,
    uint32_t* lpdwIndex);
]]
local wininet = ffi.load("wininet")
-- wininet.HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
-- hRequest : void*
-- dwInfoLevel : DWORD
-- lpBuffer : void* optional, in/out
-- lpdwBufferLength : DWORD* in/out
-- lpdwIndex : DWORD* optional, in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
-- Unicode(-W): uint16_t* には UTF-16LE のバッファ(ffi.new("uint16_t[?]", ...))を渡す。
const koffi = require('koffi');
const lib = koffi.load('WININET.dll');
const HttpQueryInfoW = lib.func('__stdcall', 'HttpQueryInfoW', 'int32_t', ['void *', 'uint32_t', 'void *', 'uint32_t *', 'uint32_t *']);
// HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
// hRequest : void* -> 'void *'
// dwInfoLevel : DWORD -> 'uint32_t'
// lpBuffer : void* optional, in/out -> 'void *'
// lpdwBufferLength : DWORD* in/out -> 'uint32_t *'
// lpdwIndex : DWORD* optional, in/out -> 'uint32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("WININET.dll", {
  HttpQueryInfoW: { parameters: ["pointer", "u32", "pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex)
// hRequest : void* -> "pointer"
// dwInfoLevel : DWORD -> "u32"
// lpBuffer : void* optional, in/out -> "pointer"
// lpdwBufferLength : DWORD* in/out -> "pointer"
// lpdwIndex : DWORD* optional, in/out -> "pointer"
// 文字列は "buffer"。Unicode(-W) は new TextEncoder() ではなく UTF-16LE のバイト列(末尾に \x00\x00)を Uint8Array で渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t HttpQueryInfoW(
    void* hRequest,
    uint32_t dwInfoLevel,
    void* lpBuffer,
    uint32_t* lpdwBufferLength,
    uint32_t* lpdwIndex);
C, "WININET.dll");
// $ffi->HttpQueryInfoW(hRequest, dwInfoLevel, lpBuffer, lpdwBufferLength, lpdwIndex);
// hRequest : void*
// dwInfoLevel : DWORD
// lpBuffer : void* optional, in/out
// lpdwBufferLength : DWORD* in/out
// lpdwIndex : DWORD* optional, in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Wininet extends StdCallLibrary {
    Wininet INSTANCE = Native.load("wininet", Wininet.class, W32APIOptions.UNICODE_OPTIONS);
    boolean HttpQueryInfoW(
        Pointer hRequest,   // void*
        int dwInfoLevel,   // DWORD
        Pointer lpBuffer,   // void* optional, in/out
        IntByReference lpdwBufferLength,   // DWORD* in/out
        IntByReference lpdwIndex   // DWORD* optional, in/out
    );
}
// Unicode(-W): WString(入力)/char[](出力)で UTF-16 をマーシャリング。
@[Link("wininet")]
lib LibWININET
  fun HttpQueryInfoW = HttpQueryInfoW(
    hRequest : Void*,   # void*
    dwInfoLevel : UInt32,   # DWORD
    lpBuffer : Void*,   # void* optional, in/out
    lpdwBufferLength : UInt32*,   # DWORD* in/out
    lpdwIndex : UInt32*   # DWORD* optional, in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef HttpQueryInfoWNative = Int32 Function(Pointer<Void>, Uint32, Pointer<Void>, Pointer<Uint32>, Pointer<Uint32>);
typedef HttpQueryInfoWDart = int Function(Pointer<Void>, int, Pointer<Void>, Pointer<Uint32>, Pointer<Uint32>);
final HttpQueryInfoW = DynamicLibrary.open('WININET.dll')
    .lookupFunction<HttpQueryInfoWNative, HttpQueryInfoWDart>('HttpQueryInfoW');
// hRequest : void* -> Pointer<Void>
// dwInfoLevel : DWORD -> Uint32
// lpBuffer : void* optional, in/out -> Pointer<Void>
// lpdwBufferLength : DWORD* in/out -> Pointer<Uint32>
// lpdwIndex : DWORD* optional, in/out -> Pointer<Uint32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function HttpQueryInfoW(
  hRequest: Pointer;   // void*
  dwInfoLevel: DWORD;   // DWORD
  lpBuffer: Pointer;   // void* optional, in/out
  lpdwBufferLength: Pointer;   // DWORD* in/out
  lpdwIndex: Pointer   // DWORD* optional, in/out
): BOOL; stdcall;
  external 'WININET.dll' name 'HttpQueryInfoW';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "HttpQueryInfoW"
  c_HttpQueryInfoW :: Ptr () -> Word32 -> Ptr () -> Ptr Word32 -> Ptr Word32 -> IO CInt
-- hRequest : void* -> Ptr ()
-- dwInfoLevel : DWORD -> Word32
-- lpBuffer : void* optional, in/out -> Ptr ()
-- lpdwBufferLength : DWORD* in/out -> Ptr Word32
-- lpdwIndex : DWORD* optional, in/out -> Ptr Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let httpqueryinfow =
  foreign "HttpQueryInfoW"
    ((ptr void) @-> uint32_t @-> (ptr void) @-> (ptr uint32_t) @-> (ptr uint32_t) @-> returning int32_t)
(* hRequest : void* -> (ptr void) *)
(* dwInfoLevel : DWORD -> uint32_t *)
(* lpBuffer : void* optional, in/out -> (ptr void) *)
(* lpdwBufferLength : DWORD* in/out -> (ptr uint32_t) *)
(* lpdwIndex : DWORD* optional, in/out -> (ptr uint32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library wininet (t "WININET.dll"))
(cffi:use-foreign-library wininet)

(cffi:defcfun ("HttpQueryInfoW" http-query-info-w :convention :stdcall) :int32
  (h-request :pointer)   ; void*
  (dw-info-level :uint32)   ; DWORD
  (lp-buffer :pointer)   ; void* optional, in/out
  (lpdw-buffer-length :pointer)   ; DWORD* in/out
  (lpdw-index :pointer))   ; DWORD* optional, in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $HttpQueryInfoW = Win32::API::More->new('WININET',
    'BOOL HttpQueryInfoW(LPVOID hRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPVOID lpdwBufferLength, LPVOID lpdwIndex)');
# my $ret = $HttpQueryInfoW->Call($hRequest, $dwInfoLevel, $lpBuffer, $lpdwBufferLength, $lpdwIndex);
# hRequest : void* -> LPVOID
# dwInfoLevel : DWORD -> DWORD
# lpBuffer : void* optional, in/out -> LPVOID
# lpdwBufferLength : DWORD* in/out -> LPVOID
# lpdwIndex : DWORD* optional, in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# Unicode(-W): LPCWSTR/LPWSTR は Win32::API が UTF-16 変換を行う。

関連項目

文字セット違い