Win32 API 日本語リファレンス
ホームNetworkManagement.WiFi › WlanGetSupportedDeviceServices

WlanGetSupportedDeviceServices

関数
インターフェイスが対応するデバイスサービスの一覧を取得する。
DLLwlanapi.dll呼出規約winapi

シグネチャ

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

DWORD WlanGetSupportedDeviceServices(
    HANDLE hClientHandle,
    const GUID* pInterfaceGuid,
    WLAN_DEVICE_SERVICE_GUID_LIST** ppDevSvcGuidList
);

パラメーター

名前方向
hClientHandleHANDLEin
pInterfaceGuidGUID*in
ppDevSvcGuidListWLAN_DEVICE_SERVICE_GUID_LIST**out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD WlanGetSupportedDeviceServices(
    HANDLE hClientHandle,
    const GUID* pInterfaceGuid,
    WLAN_DEVICE_SERVICE_GUID_LIST** ppDevSvcGuidList
);
[DllImport("wlanapi.dll", ExactSpelling = true)]
static extern uint WlanGetSupportedDeviceServices(
    IntPtr hClientHandle,   // HANDLE
    ref Guid pInterfaceGuid,   // GUID*
    IntPtr ppDevSvcGuidList   // WLAN_DEVICE_SERVICE_GUID_LIST** out
);
<DllImport("wlanapi.dll", ExactSpelling:=True)>
Public Shared Function WlanGetSupportedDeviceServices(
    hClientHandle As IntPtr,   ' HANDLE
    ByRef pInterfaceGuid As Guid,   ' GUID*
    ppDevSvcGuidList As IntPtr   ' WLAN_DEVICE_SERVICE_GUID_LIST** out
) As UInteger
End Function
' hClientHandle : HANDLE
' pInterfaceGuid : GUID*
' ppDevSvcGuidList : WLAN_DEVICE_SERVICE_GUID_LIST** out
Declare PtrSafe Function WlanGetSupportedDeviceServices Lib "wlanapi" ( _
    ByVal hClientHandle As LongPtr, _
    ByVal pInterfaceGuid As LongPtr, _
    ByVal ppDevSvcGuidList As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WlanGetSupportedDeviceServices = ctypes.windll.wlanapi.WlanGetSupportedDeviceServices
WlanGetSupportedDeviceServices.restype = wintypes.DWORD
WlanGetSupportedDeviceServices.argtypes = [
    wintypes.HANDLE,  # hClientHandle : HANDLE
    ctypes.c_void_p,  # pInterfaceGuid : GUID*
    ctypes.c_void_p,  # ppDevSvcGuidList : WLAN_DEVICE_SERVICE_GUID_LIST** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('wlanapi.dll')
WlanGetSupportedDeviceServices = Fiddle::Function.new(
  lib['WlanGetSupportedDeviceServices'],
  [
    Fiddle::TYPE_VOIDP,  # hClientHandle : HANDLE
    Fiddle::TYPE_VOIDP,  # pInterfaceGuid : GUID*
    Fiddle::TYPE_VOIDP,  # ppDevSvcGuidList : WLAN_DEVICE_SERVICE_GUID_LIST** out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wlanapi")]
extern "system" {
    fn WlanGetSupportedDeviceServices(
        hClientHandle: *mut core::ffi::c_void,  // HANDLE
        pInterfaceGuid: *const GUID,  // GUID*
        ppDevSvcGuidList: *mut *mut WLAN_DEVICE_SERVICE_GUID_LIST  // WLAN_DEVICE_SERVICE_GUID_LIST** out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("wlanapi.dll")]
public static extern uint WlanGetSupportedDeviceServices(IntPtr hClientHandle, ref Guid pInterfaceGuid, IntPtr ppDevSvcGuidList);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wlanapi_WlanGetSupportedDeviceServices' -Namespace Win32 -PassThru
# $api::WlanGetSupportedDeviceServices(hClientHandle, pInterfaceGuid, ppDevSvcGuidList)
#uselib "wlanapi.dll"
#func global WlanGetSupportedDeviceServices "WlanGetSupportedDeviceServices" sptr, sptr, sptr
; WlanGetSupportedDeviceServices hClientHandle, varptr(pInterfaceGuid), varptr(ppDevSvcGuidList)   ; 戻り値は stat
; hClientHandle : HANDLE -> "sptr"
; pInterfaceGuid : GUID* -> "sptr"
; ppDevSvcGuidList : WLAN_DEVICE_SERVICE_GUID_LIST** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "wlanapi.dll"
#cfunc global WlanGetSupportedDeviceServices "WlanGetSupportedDeviceServices" sptr, var, var
; res = WlanGetSupportedDeviceServices(hClientHandle, pInterfaceGuid, ppDevSvcGuidList)
; hClientHandle : HANDLE -> "sptr"
; pInterfaceGuid : GUID* -> "var"
; ppDevSvcGuidList : WLAN_DEVICE_SERVICE_GUID_LIST** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD WlanGetSupportedDeviceServices(HANDLE hClientHandle, GUID* pInterfaceGuid, WLAN_DEVICE_SERVICE_GUID_LIST** ppDevSvcGuidList)
#uselib "wlanapi.dll"
#cfunc global WlanGetSupportedDeviceServices "WlanGetSupportedDeviceServices" intptr, var, var
; res = WlanGetSupportedDeviceServices(hClientHandle, pInterfaceGuid, ppDevSvcGuidList)
; hClientHandle : HANDLE -> "intptr"
; pInterfaceGuid : GUID* -> "var"
; ppDevSvcGuidList : WLAN_DEVICE_SERVICE_GUID_LIST** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wlanapi = windows.NewLazySystemDLL("wlanapi.dll")
	procWlanGetSupportedDeviceServices = wlanapi.NewProc("WlanGetSupportedDeviceServices")
)

// hClientHandle (HANDLE), pInterfaceGuid (GUID*), ppDevSvcGuidList (WLAN_DEVICE_SERVICE_GUID_LIST** out)
r1, _, err := procWlanGetSupportedDeviceServices.Call(
	uintptr(hClientHandle),
	uintptr(pInterfaceGuid),
	uintptr(ppDevSvcGuidList),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function WlanGetSupportedDeviceServices(
  hClientHandle: THandle;   // HANDLE
  pInterfaceGuid: PGUID;   // GUID*
  ppDevSvcGuidList: Pointer   // WLAN_DEVICE_SERVICE_GUID_LIST** out
): DWORD; stdcall;
  external 'wlanapi.dll' name 'WlanGetSupportedDeviceServices';
result := DllCall("wlanapi\WlanGetSupportedDeviceServices"
    , "Ptr", hClientHandle   ; HANDLE
    , "Ptr", pInterfaceGuid   ; GUID*
    , "Ptr", ppDevSvcGuidList   ; WLAN_DEVICE_SERVICE_GUID_LIST** out
    , "UInt")   ; return: DWORD
●WlanGetSupportedDeviceServices(hClientHandle, pInterfaceGuid, ppDevSvcGuidList) = DLL("wlanapi.dll", "dword WlanGetSupportedDeviceServices(void*, void*, void*)")
# 呼び出し: WlanGetSupportedDeviceServices(hClientHandle, pInterfaceGuid, ppDevSvcGuidList)
# hClientHandle : HANDLE -> "void*"
# pInterfaceGuid : GUID* -> "void*"
# ppDevSvcGuidList : WLAN_DEVICE_SERVICE_GUID_LIST** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。