ホーム › Networking.WinInet › HttpOpenDependencyHandle
HttpOpenDependencyHandle
関数HTTPリクエストの依存ハンドルを開く。
シグネチャ
// WININET.dll
#include <windows.h>
DWORD HttpOpenDependencyHandle(
void* hRequestHandle,
BOOL fBackground,
void** phDependencyHandle
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hRequestHandle | void* | in |
| fBackground | BOOL | in |
| phDependencyHandle | void** | out |
戻り値の型: DWORD
各言語での呼び出し定義
// WININET.dll
#include <windows.h>
DWORD HttpOpenDependencyHandle(
void* hRequestHandle,
BOOL fBackground,
void** phDependencyHandle
);[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint HttpOpenDependencyHandle(
IntPtr hRequestHandle, // void*
bool fBackground, // BOOL
IntPtr phDependencyHandle // void** out
);<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function HttpOpenDependencyHandle(
hRequestHandle As IntPtr, ' void*
fBackground As Boolean, ' BOOL
phDependencyHandle As IntPtr ' void** out
) As UInteger
End Function' hRequestHandle : void*
' fBackground : BOOL
' phDependencyHandle : void** out
Declare PtrSafe Function HttpOpenDependencyHandle Lib "wininet" ( _
ByVal hRequestHandle As LongPtr, _
ByVal fBackground As Long, _
ByVal phDependencyHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
HttpOpenDependencyHandle = ctypes.windll.wininet.HttpOpenDependencyHandle
HttpOpenDependencyHandle.restype = wintypes.DWORD
HttpOpenDependencyHandle.argtypes = [
ctypes.POINTER(None), # hRequestHandle : void*
wintypes.BOOL, # fBackground : BOOL
ctypes.c_void_p, # phDependencyHandle : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
HttpOpenDependencyHandle = Fiddle::Function.new(
lib['HttpOpenDependencyHandle'],
[
Fiddle::TYPE_VOIDP, # hRequestHandle : void*
Fiddle::TYPE_INT, # fBackground : BOOL
Fiddle::TYPE_VOIDP, # phDependencyHandle : void** out
],
-Fiddle::TYPE_INT)#[link(name = "wininet")]
extern "system" {
fn HttpOpenDependencyHandle(
hRequestHandle: *mut (), // void*
fBackground: i32, // BOOL
phDependencyHandle: *mut *mut () // void** out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WININET.dll")]
public static extern uint HttpOpenDependencyHandle(IntPtr hRequestHandle, bool fBackground, IntPtr phDependencyHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_HttpOpenDependencyHandle' -Namespace Win32 -PassThru
# $api::HttpOpenDependencyHandle(hRequestHandle, fBackground, phDependencyHandle)#uselib "WININET.dll"
#func global HttpOpenDependencyHandle "HttpOpenDependencyHandle" sptr, sptr, sptr
; HttpOpenDependencyHandle hRequestHandle, fBackground, phDependencyHandle ; 戻り値は stat
; hRequestHandle : void* -> "sptr"
; fBackground : BOOL -> "sptr"
; phDependencyHandle : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WININET.dll"
#cfunc global HttpOpenDependencyHandle "HttpOpenDependencyHandle" sptr, int, sptr
; res = HttpOpenDependencyHandle(hRequestHandle, fBackground, phDependencyHandle)
; hRequestHandle : void* -> "sptr"
; fBackground : BOOL -> "int"
; phDependencyHandle : void** out -> "sptr"; DWORD HttpOpenDependencyHandle(void* hRequestHandle, BOOL fBackground, void** phDependencyHandle)
#uselib "WININET.dll"
#cfunc global HttpOpenDependencyHandle "HttpOpenDependencyHandle" intptr, int, intptr
; res = HttpOpenDependencyHandle(hRequestHandle, fBackground, phDependencyHandle)
; hRequestHandle : void* -> "intptr"
; fBackground : BOOL -> "int"
; phDependencyHandle : void** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procHttpOpenDependencyHandle = wininet.NewProc("HttpOpenDependencyHandle")
)
// hRequestHandle (void*), fBackground (BOOL), phDependencyHandle (void** out)
r1, _, err := procHttpOpenDependencyHandle.Call(
uintptr(hRequestHandle),
uintptr(fBackground),
uintptr(phDependencyHandle),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction HttpOpenDependencyHandle(
hRequestHandle: Pointer; // void*
fBackground: BOOL; // BOOL
phDependencyHandle: Pointer // void** out
): DWORD; stdcall;
external 'WININET.dll' name 'HttpOpenDependencyHandle';result := DllCall("WININET\HttpOpenDependencyHandle"
, "Ptr", hRequestHandle ; void*
, "Int", fBackground ; BOOL
, "Ptr", phDependencyHandle ; void** out
, "UInt") ; return: DWORD●HttpOpenDependencyHandle(hRequestHandle, fBackground, phDependencyHandle) = DLL("WININET.dll", "dword HttpOpenDependencyHandle(void*, bool, void*)")
# 呼び出し: HttpOpenDependencyHandle(hRequestHandle, fBackground, phDependencyHandle)
# hRequestHandle : void* -> "void*"
# fBackground : BOOL -> "bool"
# phDependencyHandle : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。