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