ホーム › NetworkManagement.Rras › RasDeleteEntryW
RasDeleteEntryW
関数RAS電話帳エントリを削除する(Unicode版)。
シグネチャ
// RASAPI32.dll (Unicode / -W)
#include <windows.h>
DWORD RasDeleteEntryW(
LPCWSTR param0, // optional
LPCWSTR param1
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| param0 | LPCWSTR | inoptional |
| param1 | LPCWSTR | in |
戻り値の型: DWORD
各言語での呼び出し定義
// RASAPI32.dll (Unicode / -W)
#include <windows.h>
DWORD RasDeleteEntryW(
LPCWSTR param0, // optional
LPCWSTR param1
);[DllImport("RASAPI32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint RasDeleteEntryW(
[MarshalAs(UnmanagedType.LPWStr)] string param0, // LPCWSTR optional
[MarshalAs(UnmanagedType.LPWStr)] string param1 // LPCWSTR
);<DllImport("RASAPI32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RasDeleteEntryW(
<MarshalAs(UnmanagedType.LPWStr)> param0 As String, ' LPCWSTR optional
<MarshalAs(UnmanagedType.LPWStr)> param1 As String ' LPCWSTR
) As UInteger
End Function' param0 : LPCWSTR optional
' param1 : LPCWSTR
Declare PtrSafe Function RasDeleteEntryW Lib "rasapi32" ( _
ByVal param0 As LongPtr, _
ByVal param1 As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RasDeleteEntryW = ctypes.windll.rasapi32.RasDeleteEntryW
RasDeleteEntryW.restype = wintypes.DWORD
RasDeleteEntryW.argtypes = [
wintypes.LPCWSTR, # param0 : LPCWSTR optional
wintypes.LPCWSTR, # param1 : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RASAPI32.dll')
RasDeleteEntryW = Fiddle::Function.new(
lib['RasDeleteEntryW'],
[
Fiddle::TYPE_VOIDP, # param0 : LPCWSTR optional
Fiddle::TYPE_VOIDP, # param1 : LPCWSTR
],
-Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "rasapi32")]
extern "system" {
fn RasDeleteEntryW(
param0: *const u16, // LPCWSTR optional
param1: *const u16 // LPCWSTR
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RASAPI32.dll", CharSet = CharSet.Unicode)]
public static extern uint RasDeleteEntryW([MarshalAs(UnmanagedType.LPWStr)] string param0, [MarshalAs(UnmanagedType.LPWStr)] string param1);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RASAPI32_RasDeleteEntryW' -Namespace Win32 -PassThru
# $api::RasDeleteEntryW(param0, param1)#uselib "RASAPI32.dll"
#func global RasDeleteEntryW "RasDeleteEntryW" wptr, wptr
; RasDeleteEntryW param0, param1 ; 戻り値は stat
; param0 : LPCWSTR optional -> "wptr"
; param1 : LPCWSTR -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RASAPI32.dll"
#cfunc global RasDeleteEntryW "RasDeleteEntryW" wstr, wstr
; res = RasDeleteEntryW(param0, param1)
; param0 : LPCWSTR optional -> "wstr"
; param1 : LPCWSTR -> "wstr"; DWORD RasDeleteEntryW(LPCWSTR param0, LPCWSTR param1)
#uselib "RASAPI32.dll"
#cfunc global RasDeleteEntryW "RasDeleteEntryW" wstr, wstr
; res = RasDeleteEntryW(param0, param1)
; param0 : LPCWSTR optional -> "wstr"
; param1 : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rasapi32 = windows.NewLazySystemDLL("RASAPI32.dll")
procRasDeleteEntryW = rasapi32.NewProc("RasDeleteEntryW")
)
// param0 (LPCWSTR optional), param1 (LPCWSTR)
r1, _, err := procRasDeleteEntryW.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(param0))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(param1))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction RasDeleteEntryW(
param0: PWideChar; // LPCWSTR optional
param1: PWideChar // LPCWSTR
): DWORD; stdcall;
external 'RASAPI32.dll' name 'RasDeleteEntryW';result := DllCall("RASAPI32\RasDeleteEntryW"
, "WStr", param0 ; LPCWSTR optional
, "WStr", param1 ; LPCWSTR
, "UInt") ; return: DWORD●RasDeleteEntryW(param0, param1) = DLL("RASAPI32.dll", "dword RasDeleteEntryW(char*, char*)")
# 呼び出し: RasDeleteEntryW(param0, param1)
# param0 : LPCWSTR optional -> "char*"
# param1 : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。