ホーム › System.Rpc › RpcStringFreeW
RpcStringFreeW
関数RPCが割り当てた文字列を解放する(Unicode版)。
シグネチャ
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcStringFreeW(
LPWSTR* String
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| String | LPWSTR* | inout |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcStringFreeW(
LPWSTR* String
);[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RpcStringFreeW(
IntPtr String // LPWSTR* in/out
);<DllImport("RPCRT4.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RpcStringFreeW(
[String] As IntPtr ' LPWSTR* in/out
) As Integer
End Function' String : LPWSTR* in/out
Declare PtrSafe Function RpcStringFreeW Lib "rpcrt4" ( _
ByVal String 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
RpcStringFreeW = ctypes.windll.rpcrt4.RpcStringFreeW
RpcStringFreeW.restype = ctypes.c_int
RpcStringFreeW.argtypes = [
ctypes.c_void_p, # String : LPWSTR* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
RpcStringFreeW = Fiddle::Function.new(
lib['RpcStringFreeW'],
[
Fiddle::TYPE_VOIDP, # String : LPWSTR* in/out
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "rpcrt4")]
extern "system" {
fn RpcStringFreeW(
String: *mut *mut u16 // LPWSTR* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode)]
public static extern int RpcStringFreeW(IntPtr String);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcStringFreeW' -Namespace Win32 -PassThru
# $api::RpcStringFreeW(String)#uselib "RPCRT4.dll"
#func global RpcStringFreeW "RpcStringFreeW" wptr
; RpcStringFreeW varptr(String) ; 戻り値は stat
; String : LPWSTR* in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global RpcStringFreeW "RpcStringFreeW" var ; res = RpcStringFreeW(String) ; String : LPWSTR* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global RpcStringFreeW "RpcStringFreeW" sptr ; res = RpcStringFreeW(varptr(String)) ; String : LPWSTR* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS RpcStringFreeW(LPWSTR* String) #uselib "RPCRT4.dll" #cfunc global RpcStringFreeW "RpcStringFreeW" var ; res = RpcStringFreeW(String) ; String : LPWSTR* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcStringFreeW(LPWSTR* String) #uselib "RPCRT4.dll" #cfunc global RpcStringFreeW "RpcStringFreeW" intptr ; res = RpcStringFreeW(varptr(String)) ; String : LPWSTR* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcStringFreeW = rpcrt4.NewProc("RpcStringFreeW")
)
// String (LPWSTR* in/out)
r1, _, err := procRpcStringFreeW.Call(
uintptr(String),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcStringFreeW(
String: PPWideChar // LPWSTR* in/out
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcStringFreeW';result := DllCall("RPCRT4\RpcStringFreeW"
, "Ptr", String ; LPWSTR* in/out
, "Int") ; return: RPC_STATUS●RpcStringFreeW(String) = DLL("RPCRT4.dll", "int RpcStringFreeW(void*)")
# 呼び出し: RpcStringFreeW(String)
# String : LPWSTR* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。