Win32 API 日本語リファレンス
ホームDevices.WebServicesOnDevices › WSDCreateHttpAddress

WSDCreateHttpAddress

関数
WSD用のHTTPアドレスオブジェクトを作成する。
DLLwsdapi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// wsdapi.dll
#include <windows.h>

HRESULT WSDCreateHttpAddress(
    IWSDHttpAddress** ppAddress
);

パラメーター

名前方向
ppAddressIWSDHttpAddress**out

戻り値の型: HRESULT

各言語での呼び出し定義

// wsdapi.dll
#include <windows.h>

HRESULT WSDCreateHttpAddress(
    IWSDHttpAddress** ppAddress
);
[DllImport("wsdapi.dll", ExactSpelling = true)]
static extern int WSDCreateHttpAddress(
    IntPtr ppAddress   // IWSDHttpAddress** out
);
<DllImport("wsdapi.dll", ExactSpelling:=True)>
Public Shared Function WSDCreateHttpAddress(
    ppAddress As IntPtr   ' IWSDHttpAddress** out
) As Integer
End Function
' ppAddress : IWSDHttpAddress** out
Declare PtrSafe Function WSDCreateHttpAddress Lib "wsdapi" ( _
    ByVal ppAddress As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WSDCreateHttpAddress = ctypes.windll.wsdapi.WSDCreateHttpAddress
WSDCreateHttpAddress.restype = ctypes.c_int
WSDCreateHttpAddress.argtypes = [
    ctypes.c_void_p,  # ppAddress : IWSDHttpAddress** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('wsdapi.dll')
WSDCreateHttpAddress = Fiddle::Function.new(
  lib['WSDCreateHttpAddress'],
  [
    Fiddle::TYPE_VOIDP,  # ppAddress : IWSDHttpAddress** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "wsdapi")]
extern "system" {
    fn WSDCreateHttpAddress(
        ppAddress: *mut *mut core::ffi::c_void  // IWSDHttpAddress** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("wsdapi.dll")]
public static extern int WSDCreateHttpAddress(IntPtr ppAddress);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wsdapi_WSDCreateHttpAddress' -Namespace Win32 -PassThru
# $api::WSDCreateHttpAddress(ppAddress)
#uselib "wsdapi.dll"
#func global WSDCreateHttpAddress "WSDCreateHttpAddress" sptr
; WSDCreateHttpAddress ppAddress   ; 戻り値は stat
; ppAddress : IWSDHttpAddress** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "wsdapi.dll"
#cfunc global WSDCreateHttpAddress "WSDCreateHttpAddress" sptr
; res = WSDCreateHttpAddress(ppAddress)
; ppAddress : IWSDHttpAddress** out -> "sptr"
; HRESULT WSDCreateHttpAddress(IWSDHttpAddress** ppAddress)
#uselib "wsdapi.dll"
#cfunc global WSDCreateHttpAddress "WSDCreateHttpAddress" intptr
; res = WSDCreateHttpAddress(ppAddress)
; ppAddress : IWSDHttpAddress** out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wsdapi = windows.NewLazySystemDLL("wsdapi.dll")
	procWSDCreateHttpAddress = wsdapi.NewProc("WSDCreateHttpAddress")
)

// ppAddress (IWSDHttpAddress** out)
r1, _, err := procWSDCreateHttpAddress.Call(
	uintptr(ppAddress),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function WSDCreateHttpAddress(
  ppAddress: Pointer   // IWSDHttpAddress** out
): Integer; stdcall;
  external 'wsdapi.dll' name 'WSDCreateHttpAddress';
result := DllCall("wsdapi\WSDCreateHttpAddress"
    , "Ptr", ppAddress   ; IWSDHttpAddress** out
    , "Int")   ; return: HRESULT
●WSDCreateHttpAddress(ppAddress) = DLL("wsdapi.dll", "int WSDCreateHttpAddress(void*)")
# 呼び出し: WSDCreateHttpAddress(ppAddress)
# ppAddress : IWSDHttpAddress** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。