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

DirectDrawCreateClipper

関数
サーフェス描画用のDirectDrawクリッパーを作成する。
DLLDDRAW.dll呼出規約winapi

シグネチャ

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

HRESULT DirectDrawCreateClipper(
    DWORD dwFlags,
    IDirectDrawClipper** lplpDDClipper,
    IUnknown* pUnkOuter
);

パラメーター

名前方向
dwFlagsDWORDin
lplpDDClipperIDirectDrawClipper**out
pUnkOuterIUnknown*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DirectDrawCreateClipper(
    DWORD dwFlags,
    IDirectDrawClipper** lplpDDClipper,
    IUnknown* pUnkOuter
);
[DllImport("DDRAW.dll", ExactSpelling = true)]
static extern int DirectDrawCreateClipper(
    uint dwFlags,   // DWORD
    IntPtr lplpDDClipper,   // IDirectDrawClipper** out
    IntPtr pUnkOuter   // IUnknown*
);
<DllImport("DDRAW.dll", ExactSpelling:=True)>
Public Shared Function DirectDrawCreateClipper(
    dwFlags As UInteger,   ' DWORD
    lplpDDClipper As IntPtr,   ' IDirectDrawClipper** out
    pUnkOuter As IntPtr   ' IUnknown*
) As Integer
End Function
' dwFlags : DWORD
' lplpDDClipper : IDirectDrawClipper** out
' pUnkOuter : IUnknown*
Declare PtrSafe Function DirectDrawCreateClipper Lib "ddraw" ( _
    ByVal dwFlags As Long, _
    ByVal lplpDDClipper As LongPtr, _
    ByVal pUnkOuter As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DirectDrawCreateClipper = ctypes.windll.ddraw.DirectDrawCreateClipper
DirectDrawCreateClipper.restype = ctypes.c_int
DirectDrawCreateClipper.argtypes = [
    wintypes.DWORD,  # dwFlags : DWORD
    ctypes.c_void_p,  # lplpDDClipper : IDirectDrawClipper** out
    ctypes.c_void_p,  # pUnkOuter : IUnknown*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	ddraw = windows.NewLazySystemDLL("DDRAW.dll")
	procDirectDrawCreateClipper = ddraw.NewProc("DirectDrawCreateClipper")
)

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