ホーム › Networking.WindowsWebServices › WsFreeServiceProxy
WsFreeServiceProxy
関数サービスプロキシを解放する。
シグネチャ
// webservices.dll
#include <windows.h>
void WsFreeServiceProxy(
WS_SERVICE_PROXY* serviceProxy
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| serviceProxy | WS_SERVICE_PROXY* | in | 解放対象のWS_SERVICE_PROXYオブジェクトへのポインタ。以降は使用不可となる。 |
戻り値の型: void
各言語での呼び出し定義
// webservices.dll
#include <windows.h>
void WsFreeServiceProxy(
WS_SERVICE_PROXY* serviceProxy
);[DllImport("webservices.dll", ExactSpelling = true)]
static extern void WsFreeServiceProxy(
ref IntPtr serviceProxy // WS_SERVICE_PROXY*
);<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Sub WsFreeServiceProxy(
ByRef serviceProxy As IntPtr ' WS_SERVICE_PROXY*
)
End Sub' serviceProxy : WS_SERVICE_PROXY*
Declare PtrSafe Sub WsFreeServiceProxy Lib "webservices" ( _
ByRef serviceProxy As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WsFreeServiceProxy = ctypes.windll.webservices.WsFreeServiceProxy
WsFreeServiceProxy.restype = None
WsFreeServiceProxy.argtypes = [
ctypes.c_void_p, # serviceProxy : WS_SERVICE_PROXY*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('webservices.dll')
WsFreeServiceProxy = Fiddle::Function.new(
lib['WsFreeServiceProxy'],
[
Fiddle::TYPE_VOIDP, # serviceProxy : WS_SERVICE_PROXY*
],
Fiddle::TYPE_VOID)#[link(name = "webservices")]
extern "system" {
fn WsFreeServiceProxy(
serviceProxy: *mut isize // WS_SERVICE_PROXY*
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("webservices.dll")]
public static extern void WsFreeServiceProxy(ref IntPtr serviceProxy);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsFreeServiceProxy' -Namespace Win32 -PassThru
# $api::WsFreeServiceProxy(serviceProxy)#uselib "webservices.dll"
#func global WsFreeServiceProxy "WsFreeServiceProxy" sptr
; WsFreeServiceProxy varptr(serviceProxy)
; serviceProxy : WS_SERVICE_PROXY* -> "sptr"出力引数:
#uselib "webservices.dll" #func global WsFreeServiceProxy "WsFreeServiceProxy" var ; WsFreeServiceProxy serviceProxy ; serviceProxy : WS_SERVICE_PROXY* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "webservices.dll" #func global WsFreeServiceProxy "WsFreeServiceProxy" sptr ; WsFreeServiceProxy varptr(serviceProxy) ; serviceProxy : WS_SERVICE_PROXY* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void WsFreeServiceProxy(WS_SERVICE_PROXY* serviceProxy) #uselib "webservices.dll" #func global WsFreeServiceProxy "WsFreeServiceProxy" var ; WsFreeServiceProxy serviceProxy ; serviceProxy : WS_SERVICE_PROXY* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void WsFreeServiceProxy(WS_SERVICE_PROXY* serviceProxy) #uselib "webservices.dll" #func global WsFreeServiceProxy "WsFreeServiceProxy" intptr ; WsFreeServiceProxy varptr(serviceProxy) ; serviceProxy : WS_SERVICE_PROXY* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
webservices = windows.NewLazySystemDLL("webservices.dll")
procWsFreeServiceProxy = webservices.NewProc("WsFreeServiceProxy")
)
// serviceProxy (WS_SERVICE_PROXY*)
r1, _, err := procWsFreeServiceProxy.Call(
uintptr(serviceProxy),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure WsFreeServiceProxy(
serviceProxy: Pointer // WS_SERVICE_PROXY*
); stdcall;
external 'webservices.dll' name 'WsFreeServiceProxy';result := DllCall("webservices\WsFreeServiceProxy"
, "Ptr", serviceProxy ; WS_SERVICE_PROXY*
, "Int") ; return: void●WsFreeServiceProxy(serviceProxy) = DLL("webservices.dll", "int WsFreeServiceProxy(void*)")
# 呼び出し: WsFreeServiceProxy(serviceProxy)
# serviceProxy : WS_SERVICE_PROXY* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "webservices" fn WsFreeServiceProxy(
serviceProxy: [*c]isize // WS_SERVICE_PROXY*
) callconv(std.os.windows.WINAPI) void;proc WsFreeServiceProxy(
serviceProxy: ptr int # WS_SERVICE_PROXY*
) {.importc: "WsFreeServiceProxy", stdcall, dynlib: "webservices.dll".}pragma(lib, "webservices");
extern(Windows)
void WsFreeServiceProxy(
ptrdiff_t* serviceProxy // WS_SERVICE_PROXY*
);ccall((:WsFreeServiceProxy, "webservices.dll"), stdcall, Cvoid,
(Ptr{Int},),
serviceProxy)
# serviceProxy : WS_SERVICE_PROXY* -> Ptr{Int}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
void WsFreeServiceProxy(
intptr_t* serviceProxy);
]]
local webservices = ffi.load("webservices")
-- webservices.WsFreeServiceProxy(serviceProxy)
-- serviceProxy : WS_SERVICE_PROXY*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('webservices.dll');
const WsFreeServiceProxy = lib.func('__stdcall', 'WsFreeServiceProxy', 'void', ['intptr_t *']);
// WsFreeServiceProxy(serviceProxy)
// serviceProxy : WS_SERVICE_PROXY* -> 'intptr_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("webservices.dll", {
WsFreeServiceProxy: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.WsFreeServiceProxy(serviceProxy)
// serviceProxy : WS_SERVICE_PROXY* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void WsFreeServiceProxy(
intptr_t* serviceProxy);
C, "webservices.dll");
// $ffi->WsFreeServiceProxy(serviceProxy);
// serviceProxy : WS_SERVICE_PROXY*
// 構造体/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 Webservices extends StdCallLibrary {
Webservices INSTANCE = Native.load("webservices", Webservices.class);
void WsFreeServiceProxy(
LongByReference serviceProxy // WS_SERVICE_PROXY*
);
}@[Link("webservices")]
lib Libwebservices
fun WsFreeServiceProxy = WsFreeServiceProxy(
serviceProxy : LibC::SSizeT* # WS_SERVICE_PROXY*
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WsFreeServiceProxyNative = Void Function(Pointer<IntPtr>);
typedef WsFreeServiceProxyDart = void Function(Pointer<IntPtr>);
final WsFreeServiceProxy = DynamicLibrary.open('webservices.dll')
.lookupFunction<WsFreeServiceProxyNative, WsFreeServiceProxyDart>('WsFreeServiceProxy');
// serviceProxy : WS_SERVICE_PROXY* -> Pointer<IntPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure WsFreeServiceProxy(
serviceProxy: Pointer // WS_SERVICE_PROXY*
); stdcall;
external 'webservices.dll' name 'WsFreeServiceProxy';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WsFreeServiceProxy"
c_WsFreeServiceProxy :: Ptr CIntPtr -> IO ()
-- serviceProxy : WS_SERVICE_PROXY* -> Ptr CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let wsfreeserviceproxy =
foreign "WsFreeServiceProxy"
((ptr intptr_t) @-> returning void)
(* serviceProxy : WS_SERVICE_PROXY* -> (ptr intptr_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library webservices (t "webservices.dll"))
(cffi:use-foreign-library webservices)
(cffi:defcfun ("WsFreeServiceProxy" ws-free-service-proxy :convention :stdcall) :void
(service-proxy :pointer)) ; WS_SERVICE_PROXY*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WsFreeServiceProxy = Win32::API::More->new('webservices',
'void WsFreeServiceProxy(LPVOID serviceProxy)');
# my $ret = $WsFreeServiceProxy->Call($serviceProxy);
# serviceProxy : WS_SERVICE_PROXY* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。