Win32 API 日本語リファレンス
ホームSystem.WindowsProgramming › IsApiSetImplemented

IsApiSetImplemented

関数
指定したAPIセット契約が実装済みかを判定する。
DLLapi-ms-win-core-apiquery-l2-1-0.dll呼出規約winapi

シグネチャ

// api-ms-win-core-apiquery-l2-1-0.dll
#include <windows.h>

BOOL IsApiSetImplemented(
    LPCSTR Contract
);

パラメーター

名前方向
ContractLPCSTRin

戻り値の型: BOOL

各言語での呼び出し定義

// api-ms-win-core-apiquery-l2-1-0.dll
#include <windows.h>

BOOL IsApiSetImplemented(
    LPCSTR Contract
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-apiquery-l2-1-0.dll", ExactSpelling = true)]
static extern bool IsApiSetImplemented(
    [MarshalAs(UnmanagedType.LPStr)] string Contract   // LPCSTR
);
<DllImport("api-ms-win-core-apiquery-l2-1-0.dll", ExactSpelling:=True)>
Public Shared Function IsApiSetImplemented(
    <MarshalAs(UnmanagedType.LPStr)> Contract As String   ' LPCSTR
) As Boolean
End Function
' Contract : LPCSTR
Declare PtrSafe Function IsApiSetImplemented Lib "api-ms-win-core-apiquery-l2-1-0" ( _
    ByVal Contract As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

IsApiSetImplemented = ctypes.windll.LoadLibrary("api-ms-win-core-apiquery-l2-1-0.dll").IsApiSetImplemented
IsApiSetImplemented.restype = wintypes.BOOL
IsApiSetImplemented.argtypes = [
    wintypes.LPCSTR,  # Contract : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-core-apiquery-l2-1-0.dll')
IsApiSetImplemented = Fiddle::Function.new(
  lib['IsApiSetImplemented'],
  [
    Fiddle::TYPE_VOIDP,  # Contract : LPCSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-core-apiquery-l2-1-0")]
extern "system" {
    fn IsApiSetImplemented(
        Contract: *const u8  // LPCSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-apiquery-l2-1-0.dll")]
public static extern bool IsApiSetImplemented([MarshalAs(UnmanagedType.LPStr)] string Contract);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-apiquery-l2-1-0_IsApiSetImplemented' -Namespace Win32 -PassThru
# $api::IsApiSetImplemented(Contract)
#uselib "api-ms-win-core-apiquery-l2-1-0.dll"
#func global IsApiSetImplemented "IsApiSetImplemented" sptr
; IsApiSetImplemented Contract   ; 戻り値は stat
; Contract : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "api-ms-win-core-apiquery-l2-1-0.dll"
#cfunc global IsApiSetImplemented "IsApiSetImplemented" str
; res = IsApiSetImplemented(Contract)
; Contract : LPCSTR -> "str"
; BOOL IsApiSetImplemented(LPCSTR Contract)
#uselib "api-ms-win-core-apiquery-l2-1-0.dll"
#cfunc global IsApiSetImplemented "IsApiSetImplemented" str
; res = IsApiSetImplemented(Contract)
; Contract : LPCSTR -> "str"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_core_apiquery_l2_1_0 = windows.NewLazySystemDLL("api-ms-win-core-apiquery-l2-1-0.dll")
	procIsApiSetImplemented = api_ms_win_core_apiquery_l2_1_0.NewProc("IsApiSetImplemented")
)

// Contract (LPCSTR)
r1, _, err := procIsApiSetImplemented.Call(
	uintptr(unsafe.Pointer(windows.BytePtrFromString(Contract))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function IsApiSetImplemented(
  Contract: PAnsiChar   // LPCSTR
): BOOL; stdcall;
  external 'api-ms-win-core-apiquery-l2-1-0.dll' name 'IsApiSetImplemented';
result := DllCall("api-ms-win-core-apiquery-l2-1-0\IsApiSetImplemented"
    , "AStr", Contract   ; LPCSTR
    , "Int")   ; return: BOOL
●IsApiSetImplemented(Contract) = DLL("api-ms-win-core-apiquery-l2-1-0.dll", "bool IsApiSetImplemented(char*)")
# 呼び出し: IsApiSetImplemented(Contract)
# Contract : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。