ホーム › System.Threading › IsProcessorFeaturePresent
IsProcessorFeaturePresent
関数指定したプロセッサ機能が利用可能か判定する。
シグネチャ
// KERNEL32.dll
#include <windows.h>
BOOL IsProcessorFeaturePresent(
PROCESSOR_FEATURE_ID ProcessorFeature
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ProcessorFeature | PROCESSOR_FEATURE_ID | in |
戻り値の型: BOOL
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
BOOL IsProcessorFeaturePresent(
PROCESSOR_FEATURE_ID ProcessorFeature
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern bool IsProcessorFeaturePresent(
uint ProcessorFeature // PROCESSOR_FEATURE_ID
);<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function IsProcessorFeaturePresent(
ProcessorFeature As UInteger ' PROCESSOR_FEATURE_ID
) As Boolean
End Function' ProcessorFeature : PROCESSOR_FEATURE_ID
Declare PtrSafe Function IsProcessorFeaturePresent Lib "kernel32" ( _
ByVal ProcessorFeature As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
IsProcessorFeaturePresent = ctypes.windll.kernel32.IsProcessorFeaturePresent
IsProcessorFeaturePresent.restype = wintypes.BOOL
IsProcessorFeaturePresent.argtypes = [
wintypes.DWORD, # ProcessorFeature : PROCESSOR_FEATURE_ID
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
IsProcessorFeaturePresent = Fiddle::Function.new(
lib['IsProcessorFeaturePresent'],
[
-Fiddle::TYPE_INT, # ProcessorFeature : PROCESSOR_FEATURE_ID
],
Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn IsProcessorFeaturePresent(
ProcessorFeature: u32 // PROCESSOR_FEATURE_ID
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll")]
public static extern bool IsProcessorFeaturePresent(uint ProcessorFeature);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_IsProcessorFeaturePresent' -Namespace Win32 -PassThru
# $api::IsProcessorFeaturePresent(ProcessorFeature)#uselib "KERNEL32.dll"
#func global IsProcessorFeaturePresent "IsProcessorFeaturePresent" sptr
; IsProcessorFeaturePresent ProcessorFeature ; 戻り値は stat
; ProcessorFeature : PROCESSOR_FEATURE_ID -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global IsProcessorFeaturePresent "IsProcessorFeaturePresent" int
; res = IsProcessorFeaturePresent(ProcessorFeature)
; ProcessorFeature : PROCESSOR_FEATURE_ID -> "int"; BOOL IsProcessorFeaturePresent(PROCESSOR_FEATURE_ID ProcessorFeature)
#uselib "KERNEL32.dll"
#cfunc global IsProcessorFeaturePresent "IsProcessorFeaturePresent" int
; res = IsProcessorFeaturePresent(ProcessorFeature)
; ProcessorFeature : PROCESSOR_FEATURE_ID -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procIsProcessorFeaturePresent = kernel32.NewProc("IsProcessorFeaturePresent")
)
// ProcessorFeature (PROCESSOR_FEATURE_ID)
r1, _, err := procIsProcessorFeaturePresent.Call(
uintptr(ProcessorFeature),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction IsProcessorFeaturePresent(
ProcessorFeature: DWORD // PROCESSOR_FEATURE_ID
): BOOL; stdcall;
external 'KERNEL32.dll' name 'IsProcessorFeaturePresent';result := DllCall("KERNEL32\IsProcessorFeaturePresent"
, "UInt", ProcessorFeature ; PROCESSOR_FEATURE_ID
, "Int") ; return: BOOL●IsProcessorFeaturePresent(ProcessorFeature) = DLL("KERNEL32.dll", "bool IsProcessorFeaturePresent(dword)")
# 呼び出し: IsProcessorFeaturePresent(ProcessorFeature)
# ProcessorFeature : PROCESSOR_FEATURE_ID -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。