Win32 API 日本語リファレンス
ホームGlobalization › uspoof_setRestrictionLevel

uspoof_setRestrictionLevel

関数
許容するスクリプト制限レベルを設定する。
DLLicuin.dll呼出規約cdecl

シグネチャ

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

void uspoof_setRestrictionLevel(
    USpoofChecker* sc,
    URestrictionLevel restrictionLevel
);

パラメーター

名前方向
scUSpoofChecker*inout
restrictionLevelURestrictionLevelin

戻り値の型: void

各言語での呼び出し定義

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

void uspoof_setRestrictionLevel(
    USpoofChecker* sc,
    URestrictionLevel restrictionLevel
);
[DllImport("icuin.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern void uspoof_setRestrictionLevel(
    ref IntPtr sc,   // USpoofChecker* in/out
    int restrictionLevel   // URestrictionLevel
);
<DllImport("icuin.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Sub uspoof_setRestrictionLevel(
    ByRef sc As IntPtr,   ' USpoofChecker* in/out
    restrictionLevel As Integer   ' URestrictionLevel
)
End Sub
' sc : USpoofChecker* in/out
' restrictionLevel : URestrictionLevel
Declare PtrSafe Sub uspoof_setRestrictionLevel Lib "icuin" ( _
    ByRef sc As LongPtr, _
    ByVal restrictionLevel As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

uspoof_setRestrictionLevel = ctypes.cdll.icuin.uspoof_setRestrictionLevel
uspoof_setRestrictionLevel.restype = None
uspoof_setRestrictionLevel.argtypes = [
    ctypes.c_void_p,  # sc : USpoofChecker* in/out
    ctypes.c_int,  # restrictionLevel : URestrictionLevel
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('icuin.dll')
uspoof_setRestrictionLevel = Fiddle::Function.new(
  lib['uspoof_setRestrictionLevel'],
  [
    Fiddle::TYPE_VOIDP,  # sc : USpoofChecker* in/out
    Fiddle::TYPE_INT,  # restrictionLevel : URestrictionLevel
  ],
  Fiddle::TYPE_VOID, Fiddle::Function::CDECL)
#[link(name = "icuin")]
extern "C" {
    fn uspoof_setRestrictionLevel(
        sc: *mut isize,  // USpoofChecker* in/out
        restrictionLevel: i32  // URestrictionLevel
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("icuin.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void uspoof_setRestrictionLevel(ref IntPtr sc, int restrictionLevel);
"@
$api = Add-Type -MemberDefinition $sig -Name 'icuin_uspoof_setRestrictionLevel' -Namespace Win32 -PassThru
# $api::uspoof_setRestrictionLevel(sc, restrictionLevel)
#uselib "icuin.dll"
#func global uspoof_setRestrictionLevel "uspoof_setRestrictionLevel" sptr, sptr
; uspoof_setRestrictionLevel sc, restrictionLevel
; sc : USpoofChecker* in/out -> "sptr"
; restrictionLevel : URestrictionLevel -> "sptr"
#uselib "icuin.dll"
#func global uspoof_setRestrictionLevel "uspoof_setRestrictionLevel" int, int
; uspoof_setRestrictionLevel sc, restrictionLevel
; sc : USpoofChecker* in/out -> "int"
; restrictionLevel : URestrictionLevel -> "int"
; void uspoof_setRestrictionLevel(USpoofChecker* sc, URestrictionLevel restrictionLevel)
#uselib "icuin.dll"
#func global uspoof_setRestrictionLevel "uspoof_setRestrictionLevel" int, int
; uspoof_setRestrictionLevel sc, restrictionLevel
; sc : USpoofChecker* in/out -> "int"
; restrictionLevel : URestrictionLevel -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icuin = windows.NewLazySystemDLL("icuin.dll")
	procuspoof_setRestrictionLevel = icuin.NewProc("uspoof_setRestrictionLevel")
)

// sc (USpoofChecker* in/out), restrictionLevel (URestrictionLevel)
r1, _, err := procuspoof_setRestrictionLevel.Call(
	uintptr(sc),
	uintptr(restrictionLevel),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure uspoof_setRestrictionLevel(
  sc: Pointer;   // USpoofChecker* in/out
  restrictionLevel: Integer   // URestrictionLevel
); cdecl;
  external 'icuin.dll' name 'uspoof_setRestrictionLevel';
result := DllCall("icuin\uspoof_setRestrictionLevel"
    , "Ptr", sc   ; USpoofChecker* in/out
    , "Int", restrictionLevel   ; URestrictionLevel
    , "Cdecl Int")   ; return: void
●uspoof_setRestrictionLevel(sc, restrictionLevel) = DLL("icuin.dll", "int uspoof_setRestrictionLevel(void*, int)")
# 呼び出し: uspoof_setRestrictionLevel(sc, restrictionLevel)
# sc : USpoofChecker* in/out -> "void*"
# restrictionLevel : URestrictionLevel -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。