Win32 API 日本語リファレンス
ホームGraphics.Direct3D10 › D3D10StateBlockMaskIntersect

D3D10StateBlockMaskIntersect

関数
2つのステートブロックマスクの積集合を計算する。
DLLd3d10.dll呼出規約winapi

シグネチャ

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

HRESULT D3D10StateBlockMaskIntersect(
    D3D10_STATE_BLOCK_MASK* pA,
    D3D10_STATE_BLOCK_MASK* pB,
    D3D10_STATE_BLOCK_MASK* pResult
);

パラメーター

名前方向説明
pAD3D10_STATE_BLOCK_MASK*in積を取る一方の入力ステートブロックマスク。
pBD3D10_STATE_BLOCK_MASK*in積を取るもう一方の入力ステートブロックマスク。
pResultD3D10_STATE_BLOCK_MASK*outpAとpBの論理積を格納する出力マスク。

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

D3D10StateBlockMaskIntersect = ctypes.windll.d3d10.D3D10StateBlockMaskIntersect
D3D10StateBlockMaskIntersect.restype = ctypes.c_int
D3D10StateBlockMaskIntersect.argtypes = [
    ctypes.c_void_p,  # pA : D3D10_STATE_BLOCK_MASK*
    ctypes.c_void_p,  # pB : D3D10_STATE_BLOCK_MASK*
    ctypes.c_void_p,  # pResult : D3D10_STATE_BLOCK_MASK* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('d3d10.dll')
D3D10StateBlockMaskIntersect = Fiddle::Function.new(
  lib['D3D10StateBlockMaskIntersect'],
  [
    Fiddle::TYPE_VOIDP,  # pA : D3D10_STATE_BLOCK_MASK*
    Fiddle::TYPE_VOIDP,  # pB : D3D10_STATE_BLOCK_MASK*
    Fiddle::TYPE_VOIDP,  # pResult : D3D10_STATE_BLOCK_MASK* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "d3d10")]
extern "system" {
    fn D3D10StateBlockMaskIntersect(
        pA: *mut D3D10_STATE_BLOCK_MASK,  // D3D10_STATE_BLOCK_MASK*
        pB: *mut D3D10_STATE_BLOCK_MASK,  // D3D10_STATE_BLOCK_MASK*
        pResult: *mut D3D10_STATE_BLOCK_MASK  // D3D10_STATE_BLOCK_MASK* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("d3d10.dll")]
public static extern int D3D10StateBlockMaskIntersect(IntPtr pA, IntPtr pB, IntPtr pResult);
"@
$api = Add-Type -MemberDefinition $sig -Name 'd3d10_D3D10StateBlockMaskIntersect' -Namespace Win32 -PassThru
# $api::D3D10StateBlockMaskIntersect(pA, pB, pResult)
#uselib "d3d10.dll"
#func global D3D10StateBlockMaskIntersect "D3D10StateBlockMaskIntersect" sptr, sptr, sptr
; D3D10StateBlockMaskIntersect varptr(pA), varptr(pB), varptr(pResult)   ; 戻り値は stat
; pA : D3D10_STATE_BLOCK_MASK* -> "sptr"
; pB : D3D10_STATE_BLOCK_MASK* -> "sptr"
; pResult : D3D10_STATE_BLOCK_MASK* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "d3d10.dll"
#cfunc global D3D10StateBlockMaskIntersect "D3D10StateBlockMaskIntersect" var, var, var
; res = D3D10StateBlockMaskIntersect(pA, pB, pResult)
; pA : D3D10_STATE_BLOCK_MASK* -> "var"
; pB : D3D10_STATE_BLOCK_MASK* -> "var"
; pResult : D3D10_STATE_BLOCK_MASK* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT D3D10StateBlockMaskIntersect(D3D10_STATE_BLOCK_MASK* pA, D3D10_STATE_BLOCK_MASK* pB, D3D10_STATE_BLOCK_MASK* pResult)
#uselib "d3d10.dll"
#cfunc global D3D10StateBlockMaskIntersect "D3D10StateBlockMaskIntersect" var, var, var
; res = D3D10StateBlockMaskIntersect(pA, pB, pResult)
; pA : D3D10_STATE_BLOCK_MASK* -> "var"
; pB : D3D10_STATE_BLOCK_MASK* -> "var"
; pResult : D3D10_STATE_BLOCK_MASK* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	d3d10 = windows.NewLazySystemDLL("d3d10.dll")
	procD3D10StateBlockMaskIntersect = d3d10.NewProc("D3D10StateBlockMaskIntersect")
)

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

extern "d3d10" fn D3D10StateBlockMaskIntersect(
    pA: [*c]D3D10_STATE_BLOCK_MASK, // D3D10_STATE_BLOCK_MASK*
    pB: [*c]D3D10_STATE_BLOCK_MASK, // D3D10_STATE_BLOCK_MASK*
    pResult: [*c]D3D10_STATE_BLOCK_MASK // D3D10_STATE_BLOCK_MASK* out
) callconv(std.os.windows.WINAPI) i32;
proc D3D10StateBlockMaskIntersect(
    pA: ptr D3D10_STATE_BLOCK_MASK,  # D3D10_STATE_BLOCK_MASK*
    pB: ptr D3D10_STATE_BLOCK_MASK,  # D3D10_STATE_BLOCK_MASK*
    pResult: ptr D3D10_STATE_BLOCK_MASK  # D3D10_STATE_BLOCK_MASK* out
): int32 {.importc: "D3D10StateBlockMaskIntersect", stdcall, dynlib: "d3d10.dll".}
pragma(lib, "d3d10");
extern(Windows)
int D3D10StateBlockMaskIntersect(
    D3D10_STATE_BLOCK_MASK* pA,   // D3D10_STATE_BLOCK_MASK*
    D3D10_STATE_BLOCK_MASK* pB,   // D3D10_STATE_BLOCK_MASK*
    D3D10_STATE_BLOCK_MASK* pResult   // D3D10_STATE_BLOCK_MASK* out
);
ccall((:D3D10StateBlockMaskIntersect, "d3d10.dll"), stdcall, Int32,
      (Ptr{D3D10_STATE_BLOCK_MASK}, Ptr{D3D10_STATE_BLOCK_MASK}, Ptr{D3D10_STATE_BLOCK_MASK}),
      pA, pB, pResult)
# pA : D3D10_STATE_BLOCK_MASK* -> Ptr{D3D10_STATE_BLOCK_MASK}
# pB : D3D10_STATE_BLOCK_MASK* -> Ptr{D3D10_STATE_BLOCK_MASK}
# pResult : D3D10_STATE_BLOCK_MASK* out -> Ptr{D3D10_STATE_BLOCK_MASK}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t D3D10StateBlockMaskIntersect(
    void* pA,
    void* pB,
    void* pResult);
]]
local d3d10 = ffi.load("d3d10")
-- d3d10.D3D10StateBlockMaskIntersect(pA, pB, pResult)
-- pA : D3D10_STATE_BLOCK_MASK*
-- pB : D3D10_STATE_BLOCK_MASK*
-- pResult : D3D10_STATE_BLOCK_MASK* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('d3d10.dll');
const D3D10StateBlockMaskIntersect = lib.func('__stdcall', 'D3D10StateBlockMaskIntersect', 'int32_t', ['void *', 'void *', 'void *']);
// D3D10StateBlockMaskIntersect(pA, pB, pResult)
// pA : D3D10_STATE_BLOCK_MASK* -> 'void *'
// pB : D3D10_STATE_BLOCK_MASK* -> 'void *'
// pResult : D3D10_STATE_BLOCK_MASK* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("d3d10.dll", {
  D3D10StateBlockMaskIntersect: { parameters: ["pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.D3D10StateBlockMaskIntersect(pA, pB, pResult)
// pA : D3D10_STATE_BLOCK_MASK* -> "pointer"
// pB : D3D10_STATE_BLOCK_MASK* -> "pointer"
// pResult : D3D10_STATE_BLOCK_MASK* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t D3D10StateBlockMaskIntersect(
    void* pA,
    void* pB,
    void* pResult);
C, "d3d10.dll");
// $ffi->D3D10StateBlockMaskIntersect(pA, pB, pResult);
// pA : D3D10_STATE_BLOCK_MASK*
// pB : D3D10_STATE_BLOCK_MASK*
// pResult : D3D10_STATE_BLOCK_MASK* out
// 構造体/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 D3d10 extends StdCallLibrary {
    D3d10 INSTANCE = Native.load("d3d10", D3d10.class);
    int D3D10StateBlockMaskIntersect(
        Pointer pA,   // D3D10_STATE_BLOCK_MASK*
        Pointer pB,   // D3D10_STATE_BLOCK_MASK*
        Pointer pResult   // D3D10_STATE_BLOCK_MASK* out
    );
}
@[Link("d3d10")]
lib Libd3d10
  fun D3D10StateBlockMaskIntersect = D3D10StateBlockMaskIntersect(
    pA : D3D10_STATE_BLOCK_MASK*,   # D3D10_STATE_BLOCK_MASK*
    pB : D3D10_STATE_BLOCK_MASK*,   # D3D10_STATE_BLOCK_MASK*
    pResult : D3D10_STATE_BLOCK_MASK*   # D3D10_STATE_BLOCK_MASK* out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef D3D10StateBlockMaskIntersectNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>);
typedef D3D10StateBlockMaskIntersectDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>);
final D3D10StateBlockMaskIntersect = DynamicLibrary.open('d3d10.dll')
    .lookupFunction<D3D10StateBlockMaskIntersectNative, D3D10StateBlockMaskIntersectDart>('D3D10StateBlockMaskIntersect');
// pA : D3D10_STATE_BLOCK_MASK* -> Pointer<Void>
// pB : D3D10_STATE_BLOCK_MASK* -> Pointer<Void>
// pResult : D3D10_STATE_BLOCK_MASK* out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function D3D10StateBlockMaskIntersect(
  pA: Pointer;   // D3D10_STATE_BLOCK_MASK*
  pB: Pointer;   // D3D10_STATE_BLOCK_MASK*
  pResult: Pointer   // D3D10_STATE_BLOCK_MASK* out
): Integer; stdcall;
  external 'd3d10.dll' name 'D3D10StateBlockMaskIntersect';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "D3D10StateBlockMaskIntersect"
  c_D3D10StateBlockMaskIntersect :: Ptr () -> Ptr () -> Ptr () -> IO Int32
-- pA : D3D10_STATE_BLOCK_MASK* -> Ptr ()
-- pB : D3D10_STATE_BLOCK_MASK* -> Ptr ()
-- pResult : D3D10_STATE_BLOCK_MASK* out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let d3d10stateblockmaskintersect =
  foreign "D3D10StateBlockMaskIntersect"
    ((ptr void) @-> (ptr void) @-> (ptr void) @-> returning int32_t)
(* pA : D3D10_STATE_BLOCK_MASK* -> (ptr void) *)
(* pB : D3D10_STATE_BLOCK_MASK* -> (ptr void) *)
(* pResult : D3D10_STATE_BLOCK_MASK* out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library d3d10 (t "d3d10.dll"))
(cffi:use-foreign-library d3d10)

(cffi:defcfun ("D3D10StateBlockMaskIntersect" d3-d10-state-block-mask-intersect :convention :stdcall) :int32
  (p-a :pointer)   ; D3D10_STATE_BLOCK_MASK*
  (p-b :pointer)   ; D3D10_STATE_BLOCK_MASK*
  (p-result :pointer))   ; D3D10_STATE_BLOCK_MASK* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $D3D10StateBlockMaskIntersect = Win32::API::More->new('d3d10',
    'int D3D10StateBlockMaskIntersect(LPVOID pA, LPVOID pB, LPVOID pResult)');
# my $ret = $D3D10StateBlockMaskIntersect->Call($pA, $pB, $pResult);
# pA : D3D10_STATE_BLOCK_MASK* -> LPVOID
# pB : D3D10_STATE_BLOCK_MASK* -> LPVOID
# pResult : D3D10_STATE_BLOCK_MASK* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型