ホーム › System.WindowsProgramming › GdiEntry13
GdiEntry13
関数GDI内部のD3DKMTエントリポイント13を呼び出す。
シグネチャ
// api-ms-win-dx-d3dkmt-l1-1-0.dll
#include <windows.h>
DWORD GdiEntry13(void);パラメーターなし。戻り値: DWORD
各言語での呼び出し定義
// api-ms-win-dx-d3dkmt-l1-1-0.dll
#include <windows.h>
DWORD GdiEntry13(void);[DllImport("api-ms-win-dx-d3dkmt-l1-1-0.dll", ExactSpelling = true)]
static extern uint GdiEntry13();<DllImport("api-ms-win-dx-d3dkmt-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Function GdiEntry13() As UInteger
End FunctionDeclare PtrSafe Function GdiEntry13 Lib "api-ms-win-dx-d3dkmt-l1-1-0" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdiEntry13 = ctypes.windll.LoadLibrary("api-ms-win-dx-d3dkmt-l1-1-0.dll").GdiEntry13
GdiEntry13.restype = wintypes.DWORD
GdiEntry13.argtypes = []require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('api-ms-win-dx-d3dkmt-l1-1-0.dll')
GdiEntry13 = Fiddle::Function.new(
lib['GdiEntry13'],
[],
-Fiddle::TYPE_INT)#[link(name = "api-ms-win-dx-d3dkmt-l1-1-0")]
extern "system" {
fn GdiEntry13() -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("api-ms-win-dx-d3dkmt-l1-1-0.dll")]
public static extern uint GdiEntry13();
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-dx-d3dkmt-l1-1-0_GdiEntry13' -Namespace Win32 -PassThru
# $api::GdiEntry13()#uselib "api-ms-win-dx-d3dkmt-l1-1-0.dll"
#func global GdiEntry13 "GdiEntry13"
; GdiEntry13 ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "api-ms-win-dx-d3dkmt-l1-1-0.dll"
#cfunc global GdiEntry13 "GdiEntry13"
; res = GdiEntry13(); DWORD GdiEntry13()
#uselib "api-ms-win-dx-d3dkmt-l1-1-0.dll"
#cfunc global GdiEntry13 "GdiEntry13"
; res = GdiEntry13()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
api_ms_win_dx_d3dkmt_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-dx-d3dkmt-l1-1-0.dll")
procGdiEntry13 = api_ms_win_dx_d3dkmt_l1_1_0.NewProc("GdiEntry13")
)
r1, _, err := procGdiEntry13.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction GdiEntry13: DWORD; stdcall;
external 'api-ms-win-dx-d3dkmt-l1-1-0.dll' name 'GdiEntry13';result := DllCall("api-ms-win-dx-d3dkmt-l1-1-0\GdiEntry13", "UInt")●GdiEntry13() = DLL("api-ms-win-dx-d3dkmt-l1-1-0.dll", "dword GdiEntry13()")
# 呼び出し: GdiEntry13()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "api-ms-win-dx-d3dkmt-l1-1-0" fn GdiEntry13() callconv(std.os.windows.WINAPI) u32;proc GdiEntry13(): uint32 {.importc: "GdiEntry13", stdcall, dynlib: "api-ms-win-dx-d3dkmt-l1-1-0.dll".}pragma(lib, "api-ms-win-dx-d3dkmt-l1-1-0");
extern(Windows)
uint GdiEntry13();ccall((:GdiEntry13, "api-ms-win-dx-d3dkmt-l1-1-0.dll"), stdcall, UInt32,
(),
)
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t GdiEntry13(void);
]]
local api-ms-win-dx-d3dkmt-l1-1-0 = ffi.load("api-ms-win-dx-d3dkmt-l1-1-0")
-- api-ms-win-dx-d3dkmt-l1-1-0.GdiEntry13()
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('api-ms-win-dx-d3dkmt-l1-1-0.dll');
const GdiEntry13 = lib.func('__stdcall', 'GdiEntry13', 'uint32_t', []);
// GdiEntry13()
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("api-ms-win-dx-d3dkmt-l1-1-0.dll", {
GdiEntry13: { parameters: [], result: "u32" },
});
// lib.symbols.GdiEntry13()
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t GdiEntry13(void);
C, "api-ms-win-dx-d3dkmt-l1-1-0.dll");
// $ffi->GdiEntry13();
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Api-ms-win-dx-d3dkmt-l1-1-0 extends StdCallLibrary {
Api-ms-win-dx-d3dkmt-l1-1-0 INSTANCE = Native.load("api-ms-win-dx-d3dkmt-l1-1-0", Api-ms-win-dx-d3dkmt-l1-1-0.class);
int GdiEntry13();
}@[Link("api-ms-win-dx-d3dkmt-l1-1-0")]
lib Libapi-ms-win-dx-d3dkmt-l1-1-0
fun GdiEntry13 = GdiEntry13() : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GdiEntry13Native = Uint32 Function();
typedef GdiEntry13Dart = int Function();
final GdiEntry13 = DynamicLibrary.open('api-ms-win-dx-d3dkmt-l1-1-0.dll')
.lookupFunction<GdiEntry13Native, GdiEntry13Dart>('GdiEntry13');
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function GdiEntry13: DWORD; stdcall;
external 'api-ms-win-dx-d3dkmt-l1-1-0.dll' name 'GdiEntry13';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GdiEntry13"
c_GdiEntry13 :: IO Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let gdientry13 =
foreign "GdiEntry13"
(void @-> returning uint32_t)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library api-ms-win-dx-d3dkmt-l1-1-0 (t "api-ms-win-dx-d3dkmt-l1-1-0.dll"))
(cffi:use-foreign-library api-ms-win-dx-d3dkmt-l1-1-0)
(cffi:defcfun ("GdiEntry13" gdi-entry13 :convention :stdcall) :uint32)
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GdiEntry13 = Win32::API::More->new('api-ms-win-dx-d3dkmt-l1-1-0',
'DWORD GdiEntry13()');
# my $ret = $GdiEntry13->Call();
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。