Win32 API 日本語リファレンス
ホームGraphics.Direct3D.Fxc › D3DCreateLinker

D3DCreateLinker

関数
シェーダーリンカオブジェクトを生成する。
DLLD3DCOMPILER_47.dll呼出規約winapi

シグネチャ

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

HRESULT D3DCreateLinker(
    ID3D11Linker** ppLinker
);

パラメーター

名前方向
ppLinkerID3D11Linker**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT D3DCreateLinker(
    ID3D11Linker** ppLinker
);
[DllImport("D3DCOMPILER_47.dll", ExactSpelling = true)]
static extern int D3DCreateLinker(
    IntPtr ppLinker   // ID3D11Linker** out
);
<DllImport("D3DCOMPILER_47.dll", ExactSpelling:=True)>
Public Shared Function D3DCreateLinker(
    ppLinker As IntPtr   ' ID3D11Linker** out
) As Integer
End Function
' ppLinker : ID3D11Linker** out
Declare PtrSafe Function D3DCreateLinker Lib "d3dcompiler_47" ( _
    ByVal ppLinker As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

D3DCreateLinker = ctypes.windll.d3dcompiler_47.D3DCreateLinker
D3DCreateLinker.restype = ctypes.c_int
D3DCreateLinker.argtypes = [
    ctypes.c_void_p,  # ppLinker : ID3D11Linker** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('D3DCOMPILER_47.dll')
D3DCreateLinker = Fiddle::Function.new(
  lib['D3DCreateLinker'],
  [
    Fiddle::TYPE_VOIDP,  # ppLinker : ID3D11Linker** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "d3dcompiler_47")]
extern "system" {
    fn D3DCreateLinker(
        ppLinker: *mut *mut core::ffi::c_void  // ID3D11Linker** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("D3DCOMPILER_47.dll")]
public static extern int D3DCreateLinker(IntPtr ppLinker);
"@
$api = Add-Type -MemberDefinition $sig -Name 'D3DCOMPILER_47_D3DCreateLinker' -Namespace Win32 -PassThru
# $api::D3DCreateLinker(ppLinker)
#uselib "D3DCOMPILER_47.dll"
#func global D3DCreateLinker "D3DCreateLinker" sptr
; D3DCreateLinker ppLinker   ; 戻り値は stat
; ppLinker : ID3D11Linker** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "D3DCOMPILER_47.dll"
#cfunc global D3DCreateLinker "D3DCreateLinker" sptr
; res = D3DCreateLinker(ppLinker)
; ppLinker : ID3D11Linker** out -> "sptr"
; HRESULT D3DCreateLinker(ID3D11Linker** ppLinker)
#uselib "D3DCOMPILER_47.dll"
#cfunc global D3DCreateLinker "D3DCreateLinker" intptr
; res = D3DCreateLinker(ppLinker)
; ppLinker : ID3D11Linker** out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	d3dcompiler_47 = windows.NewLazySystemDLL("D3DCOMPILER_47.dll")
	procD3DCreateLinker = d3dcompiler_47.NewProc("D3DCreateLinker")
)

// ppLinker (ID3D11Linker** out)
r1, _, err := procD3DCreateLinker.Call(
	uintptr(ppLinker),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function D3DCreateLinker(
  ppLinker: Pointer   // ID3D11Linker** out
): Integer; stdcall;
  external 'D3DCOMPILER_47.dll' name 'D3DCreateLinker';
result := DllCall("D3DCOMPILER_47\D3DCreateLinker"
    , "Ptr", ppLinker   ; ID3D11Linker** out
    , "Int")   ; return: HRESULT
●D3DCreateLinker(ppLinker) = DLL("D3DCOMPILER_47.dll", "int D3DCreateLinker(void*)")
# 呼び出し: D3DCreateLinker(ppLinker)
# ppLinker : ID3D11Linker** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。