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

WlanDeleteProfile

関数
指定した無線LANプロファイルを削除する。
DLLwlanapi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD WlanDeleteProfile(
    HANDLE hClientHandle,
    const GUID* pInterfaceGuid,
    LPCWSTR strProfileName,
    void* pReserved   // optional
);

パラメーター

名前型方向説明
hClientHandleHANDLEinクライアントのセッションハンドル。以前に WlanOpenHandle 関数を呼び出して取得します。
pInterfaceGuidGUID*inプロファイルの削除元となるインターフェイスの GUID。
strProfileNameLPCWSTRin

削除するプロファイルの名前。プロファイル名では大文字と小文字が区別されます。この文字列は NULL で終了している必要があります。

Windows XP with SP3 および Wireless LAN API for Windows XP with SP2: 指定する名前は、ネットワークの SSID から自動的に導出されるプロファイル名と一致している必要があります。インフラストラクチャネットワークのプロファイルの場合は、プロファイル名として SSID を指定する必要があります。アドホックネットワークのプロファイルの場合は、指定する名前はアドホックネットワークの SSID の後ろに -adhoc を付けたものである必要があります。

pReservedvoid*optional将来の使用のために予約されています。NULL に設定する必要があります。

戻り値の型: DWORD

公式ドキュメント

ローカルコンピューター上のワイヤレスインターフェイスのワイヤレスプロファイルを削除します。

戻り値

関数が成功した場合、戻り値は ERROR_SUCCESS です。

関数が失敗した場合、戻り値は次のいずれかのエラーコードになることがあります。

戻り値 説明
ERROR_INVALID_PARAMETER
hClientHandle パラメーターが NULL または無効である、pInterfaceGuid パラメーターが NULL である、strProfileName パラメーターが NULL である、または pReserved が NULL ではありません。
ERROR_INVALID_HANDLE
hClientHandle パラメーターで指定されたハンドルがハンドルテーブル内に見つかりませんでした。
ERROR_NOT_FOUND
strProfileName で指定されたワイヤレスプロファイルがプロファイルストア内に見つかりませんでした。
ERROR_ACCESS_DENIED
呼び出し元にプロファイルを削除するための十分なアクセス許可がありません。
RPC_STATUS
さまざまなエラーコード。

解説(Remarks)

WlanDeleteProfile 関数は、ローカルコンピューター上のワイヤレスインターフェイスのワイヤレスプロファイルを削除します。

すべてのワイヤレス LAN 関数は、プロファイル操作を行う際にワイヤレスインターフェイスのインターフェイス GUID を必要とします。ワイヤレスインターフェイスが取り外されると、その状態は Wireless LAN Service (WLANSVC) から消去され、プロファイル操作は行えなくなります。

ワイヤレス LAN プロファイルに対して pInterfaceGuid パラメーターで指定したワイヤレスインターフェイスがシステムから取り外されている場合 (たとえば、USB ワイヤレスアダプターが取り外された場合)、WlanDeleteProfile 関数は ERROR_INVALID_PARAMETER で失敗することがあります。

コマンドラインでプロファイルを削除するには、netsh wlan delete profile コマンドを使用します。詳細については、Netsh Commands for Wireless Local Area Network (wlan) を参照してください。

例

次の例では、ローカルコンピューター上のワイヤレス LAN インターフェイスを列挙し、各ワイヤレス LAN インターフェイスで特定のワイヤレスプロファイルの削除を試みます。

メモ この例は、Wireless LAN Service がインストールされ開始されていない場合、Windows Server 2008 および Windows Server 2008 R2 では読み込みに失敗します。
#ifndef UNICODE
#define UNICODE
#endif

#include <windows.h>
#include <wlanapi.h>
#include <objbase.h>
#include <wtypes.h>

#include <stdio.h>
#include <stdlib.h>

// Need to link with Wlanapi.lib and Ole32.lib
#pragma comment(lib, "wlanapi.lib")
#pragma comment(lib, "ole32.lib")

int _cdecl wmain(int argc, WCHAR ** argv)
{

    // Declare and initialize variables.

    HANDLE hClient = NULL;
    DWORD dwMaxClient = 2;      //    
    DWORD dwCurVersion = 0;
    DWORD dwResult = 0;
    DWORD dwRetVal = 0;
    int iRet = 0;

    WCHAR GuidString[39] = { 0 };

    unsigned int i;

    /* variables used for WlanEnumInterfaces  */

    PWLAN_INTERFACE_INFO_LIST pIfList = NULL;
    PWLAN_INTERFACE_INFO pIfInfo = NULL;

    LPCWSTR pProfileName = NULL;

    // Validate the parameters
    if (argc < 2) {
        wprintf(L"usage: %s <profile>\n", argv[0]);
        wprintf(L"   Deletes a wireless profile\n");
        wprintf(L"   Example\n");
        wprintf(L"       %s \"Default Wireless\"\n", argv[0]);
        exit(1);
    }

    pProfileName = argv[1];

    wprintf(L"Information for profile: %ws\n\n", pProfileName);

    dwResult = WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient);
    if (dwResult != ERROR_SUCCESS) {
        wprintf(L"WlanOpenHandle failed with error: %u\n", dwResult);
        return 1;
        // You can use FormatMessage here to find out why the function failed
    }

    dwResult = WlanEnumInterfaces(hClient, NULL, &pIfList);
    if (dwResult != ERROR_SUCCESS) {
        wprintf(L"WlanEnumInterfaces failed with error: %u\n", dwResult);
        return 1;
        // You can use FormatMessage here to find out why the function failed
    } else {
        wprintf(L"WLAN_INTERFACE_INFO_LIST for this system\n");

        wprintf(L"Num Entries: %lu\n", pIfList->dwNumberOfItems);
        wprintf(L"Current Index: %lu\n", pIfList->dwIndex);
        for (i = 0; i < pIfList->dwNumberOfItems; i++) {
            pIfInfo = (WLAN_INTERFACE_INFO *) & pIfList->InterfaceInfo[i];
            wprintf(L"  Interface Index[%u]:\t %lu\n", i, i);
            iRet =
                StringFromGUID2(pIfInfo->InterfaceGuid, (LPOLESTR) & GuidString,
                                sizeof (GuidString) / sizeof (*GuidString));
            // For c rather than C++ source code, the above line needs to be
            // iRet = StringFromGUID2(&pIfInfo->InterfaceGuid, (LPOLESTR) &GuidString, 
            //     sizeof(GuidString)/sizeof(*GuidString)); 
            if (iRet == 0)
                wprintf(L"StringFromGUID2 failed\n");
            else {
                wprintf(L"  InterfaceGUID[%d]: %ws\n", i, GuidString);
            }
            wprintf(L"  Interface Description[%d]: %ws", i,
                    pIfInfo->strInterfaceDescription);
            wprintf(L"\n");
            wprintf(L"  Interface State[%d]:\t ", i);
            switch (pIfInfo->isState) {
            case wlan_interface_state_not_ready:
                wprintf(L"Not ready\n");
                break;
            case wlan_interface_state_connected:
                wprintf(L"Connected\n");
                break;
            case wlan_interface_state_ad_hoc_network_formed:
                wprintf(L"First node in a ad hoc network\n");
                break;
            case wlan_interface_state_disconnecting:
                wprintf(L"Disconnecting\n");
                break;
            case wlan_interface_state_disconnected:
                wprintf(L"Not connected\n");
                break;
            case wlan_interface_state_associating:
                wprintf(L"Attempting to associate with a network\n");
                break;
            case wlan_interface_state_discovering:
                wprintf
                    (L"Auto configuration is discovering settings for the network\n");
                break;
            case wlan_interface_state_authenticating:
                wprintf(L"In process of authenticating\n");
                break;
            default:
                wprintf(L"Unknown state %ld\n", pIfInfo->isState);
                break;
            }
            wprintf(L"\n");

            dwResult = WlanDeleteProfile(hClient,
                                         &pIfInfo->InterfaceGuid,
                                         pProfileName, NULL);

            if (dwResult != ERROR_SUCCESS) {
                wprintf
                    (L"WlanDeleteProfile failed on this interface with error: %u\n",
                     dwResult);
                if (dwResult == ERROR_NOT_FOUND)
                    wprintf
                        (L"  Error was the following profile was not found: %ws\n",
                         pProfileName);
                // You can use FormatMessage to find out why the function failed
            } else {
                wprintf(L"Successfully deleted Profile Name: %ws\n",
                        pProfileName);
            }
            wprintf(L"\n");
        }

    }
    if (pIfList != NULL) {
        WlanFreeMemory(pIfList);
        pIfList = NULL;
    }

    return dwRetVal;
}

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

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

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

WlanDeleteProfile = ctypes.windll.wlanapi.WlanDeleteProfile
WlanDeleteProfile.restype = wintypes.DWORD
WlanDeleteProfile.argtypes = [
    wintypes.HANDLE,  # hClientHandle : HANDLE
    ctypes.c_void_p,  # pInterfaceGuid : GUID*
    wintypes.LPCWSTR,  # strProfileName : LPCWSTR
    ctypes.POINTER(None),  # pReserved : void* optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	wlanapi = windows.NewLazySystemDLL("wlanapi.dll")
	procWlanDeleteProfile = wlanapi.NewProc("WlanDeleteProfile")
)

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

extern "wlanapi" fn WlanDeleteProfile(
    hClientHandle: ?*anyopaque, // HANDLE
    pInterfaceGuid: [*c]GUID, // GUID*
    strProfileName: [*c]const u16, // LPCWSTR
    pReserved: ?*anyopaque // void* optional
) callconv(std.os.windows.WINAPI) u32;
proc WlanDeleteProfile(
    hClientHandle: pointer,  # HANDLE
    pInterfaceGuid: ptr GUID,  # GUID*
    strProfileName: WideCString,  # LPCWSTR
    pReserved: pointer  # void* optional
): uint32 {.importc: "WlanDeleteProfile", stdcall, dynlib: "wlanapi.dll".}
pragma(lib, "wlanapi");
extern(Windows)
uint WlanDeleteProfile(
    void* hClientHandle,   // HANDLE
    GUID* pInterfaceGuid,   // GUID*
    const(wchar)* strProfileName,   // LPCWSTR
    void* pReserved   // void* optional
);
ccall((:WlanDeleteProfile, "wlanapi.dll"), stdcall, UInt32,
      (Ptr{Cvoid}, Ptr{GUID}, Cwstring, Ptr{Cvoid}),
      hClientHandle, pInterfaceGuid, strProfileName, pReserved)
# hClientHandle : HANDLE -> Ptr{Cvoid}
# pInterfaceGuid : GUID* -> Ptr{GUID}
# strProfileName : LPCWSTR -> Cwstring
# pReserved : void* optional -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t WlanDeleteProfile(
    void* hClientHandle,
    void* pInterfaceGuid,
    const uint16_t* strProfileName,
    void* pReserved);
]]
local wlanapi = ffi.load("wlanapi")
-- wlanapi.WlanDeleteProfile(hClientHandle, pInterfaceGuid, strProfileName, pReserved)
-- hClientHandle : HANDLE
-- pInterfaceGuid : GUID*
-- strProfileName : LPCWSTR
-- pReserved : void* optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('wlanapi.dll');
const WlanDeleteProfile = lib.func('__stdcall', 'WlanDeleteProfile', 'uint32_t', ['void *', 'void *', 'str16', 'void *']);
// WlanDeleteProfile(hClientHandle, pInterfaceGuid, strProfileName, pReserved)
// hClientHandle : HANDLE -> 'void *'
// pInterfaceGuid : GUID* -> 'void *'
// strProfileName : LPCWSTR -> 'str16'
// pReserved : void* optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("wlanapi.dll", {
  WlanDeleteProfile: { parameters: ["pointer", "pointer", "buffer", "pointer"], result: "u32" },
});
// lib.symbols.WlanDeleteProfile(hClientHandle, pInterfaceGuid, strProfileName, pReserved)
// hClientHandle : HANDLE -> "pointer"
// pInterfaceGuid : GUID* -> "pointer"
// strProfileName : LPCWSTR -> "buffer"
// pReserved : void* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t WlanDeleteProfile(
    void* hClientHandle,
    void* pInterfaceGuid,
    const uint16_t* strProfileName,
    void* pReserved);
C, "wlanapi.dll");
// $ffi->WlanDeleteProfile(hClientHandle, pInterfaceGuid, strProfileName, pReserved);
// hClientHandle : HANDLE
// pInterfaceGuid : GUID*
// strProfileName : LPCWSTR
// pReserved : void* optional
// 構造体/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 Wlanapi extends StdCallLibrary {
    Wlanapi INSTANCE = Native.load("wlanapi", Wlanapi.class);
    int WlanDeleteProfile(
        Pointer hClientHandle,   // HANDLE
        Pointer pInterfaceGuid,   // GUID*
        WString strProfileName,   // LPCWSTR
        Pointer pReserved   // void* optional
    );
}
@[Link("wlanapi")]
lib Libwlanapi
  fun WlanDeleteProfile = WlanDeleteProfile(
    hClientHandle : Void*,   # HANDLE
    pInterfaceGuid : GUID*,   # GUID*
    strProfileName : UInt16*,   # LPCWSTR
    pReserved : Void*   # void* optional
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef WlanDeleteProfileNative = Uint32 Function(Pointer<Void>, Pointer<Void>, Pointer<Utf16>, Pointer<Void>);
typedef WlanDeleteProfileDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Utf16>, Pointer<Void>);
final WlanDeleteProfile = DynamicLibrary.open('wlanapi.dll')
    .lookupFunction<WlanDeleteProfileNative, WlanDeleteProfileDart>('WlanDeleteProfile');
// hClientHandle : HANDLE -> Pointer<Void>
// pInterfaceGuid : GUID* -> Pointer<Void>
// strProfileName : LPCWSTR -> Pointer<Utf16>
// pReserved : void* optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function WlanDeleteProfile(
  hClientHandle: THandle;   // HANDLE
  pInterfaceGuid: PGUID;   // GUID*
  strProfileName: PWideChar;   // LPCWSTR
  pReserved: Pointer   // void* optional
): DWORD; stdcall;
  external 'wlanapi.dll' name 'WlanDeleteProfile';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "WlanDeleteProfile"
  c_WlanDeleteProfile :: Ptr () -> Ptr () -> CWString -> Ptr () -> IO Word32
-- hClientHandle : HANDLE -> Ptr ()
-- pInterfaceGuid : GUID* -> Ptr ()
-- strProfileName : LPCWSTR -> CWString
-- pReserved : void* optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let wlandeleteprofile =
  foreign "WlanDeleteProfile"
    ((ptr void) @-> (ptr void) @-> (ptr uint16_t) @-> (ptr void) @-> returning uint32_t)
(* hClientHandle : HANDLE -> (ptr void) *)
(* pInterfaceGuid : GUID* -> (ptr void) *)
(* strProfileName : LPCWSTR -> (ptr uint16_t) *)
(* pReserved : void* optional -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library wlanapi (t "wlanapi.dll"))
(cffi:use-foreign-library wlanapi)

(cffi:defcfun ("WlanDeleteProfile" wlan-delete-profile :convention :stdcall) :uint32
  (h-client-handle :pointer)   ; HANDLE
  (p-interface-guid :pointer)   ; GUID*
  (str-profile-name (:string :encoding :utf-16le))   ; LPCWSTR
  (p-reserved :pointer))   ; void* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $WlanDeleteProfile = Win32::API::More->new('wlanapi',
    'DWORD WlanDeleteProfile(HANDLE hClientHandle, LPVOID pInterfaceGuid, LPCWSTR strProfileName, LPVOID pReserved)');
# my $ret = $WlanDeleteProfile->Call($hClientHandle, $pInterfaceGuid, $strProfileName, $pReserved);
# hClientHandle : HANDLE -> HANDLE
# pInterfaceGuid : GUID* -> LPVOID
# strProfileName : LPCWSTR -> LPCWSTR
# pReserved : void* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

公式の関連項目