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

WsFreeSecurityToken

関数
セキュリティトークンを解放する。
DLLwebservices.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

void WsFreeSecurityToken(
    WS_SECURITY_TOKEN* token
);

パラメーター

名前方向説明
tokenWS_SECURITY_TOKEN*in解放対象のWS_SECURITY_TOKENオブジェクトへのポインタ。

戻り値の型: void

各言語での呼び出し定義

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

void WsFreeSecurityToken(
    WS_SECURITY_TOKEN* token
);
[DllImport("webservices.dll", ExactSpelling = true)]
static extern void WsFreeSecurityToken(
    ref IntPtr token   // WS_SECURITY_TOKEN*
);
<DllImport("webservices.dll", ExactSpelling:=True)>
Public Shared Sub WsFreeSecurityToken(
    ByRef token As IntPtr   ' WS_SECURITY_TOKEN*
)
End Sub
' token : WS_SECURITY_TOKEN*
Declare PtrSafe Sub WsFreeSecurityToken Lib "webservices" ( _
    ByRef token As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WsFreeSecurityToken = ctypes.windll.webservices.WsFreeSecurityToken
WsFreeSecurityToken.restype = None
WsFreeSecurityToken.argtypes = [
    ctypes.c_void_p,  # token : WS_SECURITY_TOKEN*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('webservices.dll')
WsFreeSecurityToken = Fiddle::Function.new(
  lib['WsFreeSecurityToken'],
  [
    Fiddle::TYPE_VOIDP,  # token : WS_SECURITY_TOKEN*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "webservices")]
extern "system" {
    fn WsFreeSecurityToken(
        token: *mut isize  // WS_SECURITY_TOKEN*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("webservices.dll")]
public static extern void WsFreeSecurityToken(ref IntPtr token);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webservices_WsFreeSecurityToken' -Namespace Win32 -PassThru
# $api::WsFreeSecurityToken(token)
#uselib "webservices.dll"
#func global WsFreeSecurityToken "WsFreeSecurityToken" sptr
; WsFreeSecurityToken varptr(token)
; token : WS_SECURITY_TOKEN* -> "sptr"
出力引数:
#uselib "webservices.dll"
#func global WsFreeSecurityToken "WsFreeSecurityToken" var
; WsFreeSecurityToken token
; token : WS_SECURITY_TOKEN* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void WsFreeSecurityToken(WS_SECURITY_TOKEN* token)
#uselib "webservices.dll"
#func global WsFreeSecurityToken "WsFreeSecurityToken" var
; WsFreeSecurityToken token
; token : WS_SECURITY_TOKEN* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	webservices = windows.NewLazySystemDLL("webservices.dll")
	procWsFreeSecurityToken = webservices.NewProc("WsFreeSecurityToken")
)

// token (WS_SECURITY_TOKEN*)
r1, _, err := procWsFreeSecurityToken.Call(
	uintptr(token),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure WsFreeSecurityToken(
  token: Pointer   // WS_SECURITY_TOKEN*
); stdcall;
  external 'webservices.dll' name 'WsFreeSecurityToken';
result := DllCall("webservices\WsFreeSecurityToken"
    , "Ptr", token   ; WS_SECURITY_TOKEN*
    , "Int")   ; return: void
●WsFreeSecurityToken(token) = DLL("webservices.dll", "int WsFreeSecurityToken(void*)")
# 呼び出し: WsFreeSecurityToken(token)
# token : WS_SECURITY_TOKEN* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "webservices" fn WsFreeSecurityToken(
    token: [*c]isize // WS_SECURITY_TOKEN*
) callconv(std.os.windows.WINAPI) void;
proc WsFreeSecurityToken(
    token: ptr int  # WS_SECURITY_TOKEN*
) {.importc: "WsFreeSecurityToken", stdcall, dynlib: "webservices.dll".}
pragma(lib, "webservices");
extern(Windows)
void WsFreeSecurityToken(
    ptrdiff_t* token   // WS_SECURITY_TOKEN*
);
ccall((:WsFreeSecurityToken, "webservices.dll"), stdcall, Cvoid,
      (Ptr{Int},),
      token)
# token : WS_SECURITY_TOKEN* -> Ptr{Int}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void WsFreeSecurityToken(
    intptr_t* token);
]]
local webservices = ffi.load("webservices")
-- webservices.WsFreeSecurityToken(token)
-- token : WS_SECURITY_TOKEN*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('webservices.dll');
const WsFreeSecurityToken = lib.func('__stdcall', 'WsFreeSecurityToken', 'void', ['intptr_t *']);
// WsFreeSecurityToken(token)
// token : WS_SECURITY_TOKEN* -> 'intptr_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("webservices.dll", {
  WsFreeSecurityToken: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.WsFreeSecurityToken(token)
// token : WS_SECURITY_TOKEN* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void WsFreeSecurityToken(
    intptr_t* token);
C, "webservices.dll");
// $ffi->WsFreeSecurityToken(token);
// token : WS_SECURITY_TOKEN*
// 構造体/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 WsFreeSecurityToken(
        LongByReference token   // WS_SECURITY_TOKEN*
    );
}
@[Link("webservices")]
lib Libwebservices
  fun WsFreeSecurityToken = WsFreeSecurityToken(
    token : LibC::SSizeT*   # WS_SECURITY_TOKEN*
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef WsFreeSecurityTokenNative = Void Function(Pointer<IntPtr>);
typedef WsFreeSecurityTokenDart = void Function(Pointer<IntPtr>);
final WsFreeSecurityToken = DynamicLibrary.open('webservices.dll')
    .lookupFunction<WsFreeSecurityTokenNative, WsFreeSecurityTokenDart>('WsFreeSecurityToken');
// token : WS_SECURITY_TOKEN* -> Pointer<IntPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure WsFreeSecurityToken(
  token: Pointer   // WS_SECURITY_TOKEN*
); stdcall;
  external 'webservices.dll' name 'WsFreeSecurityToken';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "WsFreeSecurityToken"
  c_WsFreeSecurityToken :: Ptr CIntPtr -> IO ()
-- token : WS_SECURITY_TOKEN* -> Ptr CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let wsfreesecuritytoken =
  foreign "WsFreeSecurityToken"
    ((ptr intptr_t) @-> returning void)
(* token : WS_SECURITY_TOKEN* -> (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 ("WsFreeSecurityToken" ws-free-security-token :convention :stdcall) :void
  (token :pointer))   ; WS_SECURITY_TOKEN*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $WsFreeSecurityToken = Win32::API::More->new('webservices',
    'void WsFreeSecurityToken(LPVOID token)');
# my $ret = $WsFreeSecurityToken->Call($token);
# token : WS_SECURITY_TOKEN* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。