Win32 API 日本語リファレンス
ホームStorage.CloudFilters › CfGetPlaceholderRangeInfoForHydration

CfGetPlaceholderRangeInfoForHydration

関数
実体化処理向けにプレースホルダー範囲情報を取得する。
DLLcldapi.dll呼出規約winapi

シグネチャ

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

HRESULT CfGetPlaceholderRangeInfoForHydration(
    CF_CONNECTION_KEY ConnectionKey,
    LONGLONG TransferKey,
    LONGLONG FileId,
    CF_PLACEHOLDER_RANGE_INFO_CLASS InfoClass,
    LONGLONG StartingOffset,
    LONGLONG RangeLength,
    void* InfoBuffer,
    DWORD InfoBufferSize,
    DWORD* InfoBufferWritten   // optional
);

パラメーター

名前方向
ConnectionKeyCF_CONNECTION_KEYin
TransferKeyLONGLONGin
FileIdLONGLONGin
InfoClassCF_PLACEHOLDER_RANGE_INFO_CLASSin
StartingOffsetLONGLONGin
RangeLengthLONGLONGin
InfoBuffervoid*out
InfoBufferSizeDWORDin
InfoBufferWrittenDWORD*outoptional

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT CfGetPlaceholderRangeInfoForHydration(
    CF_CONNECTION_KEY ConnectionKey,
    LONGLONG TransferKey,
    LONGLONG FileId,
    CF_PLACEHOLDER_RANGE_INFO_CLASS InfoClass,
    LONGLONG StartingOffset,
    LONGLONG RangeLength,
    void* InfoBuffer,
    DWORD InfoBufferSize,
    DWORD* InfoBufferWritten   // optional
);
[DllImport("cldapi.dll", ExactSpelling = true)]
static extern int CfGetPlaceholderRangeInfoForHydration(
    long ConnectionKey,   // CF_CONNECTION_KEY
    long TransferKey,   // LONGLONG
    long FileId,   // LONGLONG
    int InfoClass,   // CF_PLACEHOLDER_RANGE_INFO_CLASS
    long StartingOffset,   // LONGLONG
    long RangeLength,   // LONGLONG
    IntPtr InfoBuffer,   // void* out
    uint InfoBufferSize,   // DWORD
    IntPtr InfoBufferWritten   // DWORD* optional, out
);
<DllImport("cldapi.dll", ExactSpelling:=True)>
Public Shared Function CfGetPlaceholderRangeInfoForHydration(
    ConnectionKey As Long,   ' CF_CONNECTION_KEY
    TransferKey As Long,   ' LONGLONG
    FileId As Long,   ' LONGLONG
    InfoClass As Integer,   ' CF_PLACEHOLDER_RANGE_INFO_CLASS
    StartingOffset As Long,   ' LONGLONG
    RangeLength As Long,   ' LONGLONG
    InfoBuffer As IntPtr,   ' void* out
    InfoBufferSize As UInteger,   ' DWORD
    InfoBufferWritten As IntPtr   ' DWORD* optional, out
) As Integer
End Function
' ConnectionKey : CF_CONNECTION_KEY
' TransferKey : LONGLONG
' FileId : LONGLONG
' InfoClass : CF_PLACEHOLDER_RANGE_INFO_CLASS
' StartingOffset : LONGLONG
' RangeLength : LONGLONG
' InfoBuffer : void* out
' InfoBufferSize : DWORD
' InfoBufferWritten : DWORD* optional, out
Declare PtrSafe Function CfGetPlaceholderRangeInfoForHydration Lib "cldapi" ( _
    ByVal ConnectionKey As LongLong, _
    ByVal TransferKey As LongLong, _
    ByVal FileId As LongLong, _
    ByVal InfoClass As Long, _
    ByVal StartingOffset As LongLong, _
    ByVal RangeLength As LongLong, _
    ByVal InfoBuffer As LongPtr, _
    ByVal InfoBufferSize As Long, _
    ByVal InfoBufferWritten As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CfGetPlaceholderRangeInfoForHydration = ctypes.windll.cldapi.CfGetPlaceholderRangeInfoForHydration
CfGetPlaceholderRangeInfoForHydration.restype = ctypes.c_int
CfGetPlaceholderRangeInfoForHydration.argtypes = [
    ctypes.c_longlong,  # ConnectionKey : CF_CONNECTION_KEY
    ctypes.c_longlong,  # TransferKey : LONGLONG
    ctypes.c_longlong,  # FileId : LONGLONG
    ctypes.c_int,  # InfoClass : CF_PLACEHOLDER_RANGE_INFO_CLASS
    ctypes.c_longlong,  # StartingOffset : LONGLONG
    ctypes.c_longlong,  # RangeLength : LONGLONG
    ctypes.POINTER(None),  # InfoBuffer : void* out
    wintypes.DWORD,  # InfoBufferSize : DWORD
    ctypes.POINTER(wintypes.DWORD),  # InfoBufferWritten : DWORD* optional, out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('cldapi.dll')
CfGetPlaceholderRangeInfoForHydration = Fiddle::Function.new(
  lib['CfGetPlaceholderRangeInfoForHydration'],
  [
    Fiddle::TYPE_LONG_LONG,  # ConnectionKey : CF_CONNECTION_KEY
    Fiddle::TYPE_LONG_LONG,  # TransferKey : LONGLONG
    Fiddle::TYPE_LONG_LONG,  # FileId : LONGLONG
    Fiddle::TYPE_INT,  # InfoClass : CF_PLACEHOLDER_RANGE_INFO_CLASS
    Fiddle::TYPE_LONG_LONG,  # StartingOffset : LONGLONG
    Fiddle::TYPE_LONG_LONG,  # RangeLength : LONGLONG
    Fiddle::TYPE_VOIDP,  # InfoBuffer : void* out
    -Fiddle::TYPE_INT,  # InfoBufferSize : DWORD
    Fiddle::TYPE_VOIDP,  # InfoBufferWritten : DWORD* optional, out
  ],
  Fiddle::TYPE_INT)
#[link(name = "cldapi")]
extern "system" {
    fn CfGetPlaceholderRangeInfoForHydration(
        ConnectionKey: i64,  // CF_CONNECTION_KEY
        TransferKey: i64,  // LONGLONG
        FileId: i64,  // LONGLONG
        InfoClass: i32,  // CF_PLACEHOLDER_RANGE_INFO_CLASS
        StartingOffset: i64,  // LONGLONG
        RangeLength: i64,  // LONGLONG
        InfoBuffer: *mut (),  // void* out
        InfoBufferSize: u32,  // DWORD
        InfoBufferWritten: *mut u32  // DWORD* optional, out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("cldapi.dll")]
public static extern int CfGetPlaceholderRangeInfoForHydration(long ConnectionKey, long TransferKey, long FileId, int InfoClass, long StartingOffset, long RangeLength, IntPtr InfoBuffer, uint InfoBufferSize, IntPtr InfoBufferWritten);
"@
$api = Add-Type -MemberDefinition $sig -Name 'cldapi_CfGetPlaceholderRangeInfoForHydration' -Namespace Win32 -PassThru
# $api::CfGetPlaceholderRangeInfoForHydration(ConnectionKey, TransferKey, FileId, InfoClass, StartingOffset, RangeLength, InfoBuffer, InfoBufferSize, InfoBufferWritten)
#uselib "cldapi.dll"
#func global CfGetPlaceholderRangeInfoForHydration "CfGetPlaceholderRangeInfoForHydration" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; CfGetPlaceholderRangeInfoForHydration ConnectionKey, TransferKey, FileId, InfoClass, StartingOffset, RangeLength, InfoBuffer, InfoBufferSize, varptr(InfoBufferWritten)   ; 戻り値は stat
; ConnectionKey : CF_CONNECTION_KEY -> "sptr"
; TransferKey : LONGLONG -> "sptr"
; FileId : LONGLONG -> "sptr"
; InfoClass : CF_PLACEHOLDER_RANGE_INFO_CLASS -> "sptr"
; StartingOffset : LONGLONG -> "sptr"
; RangeLength : LONGLONG -> "sptr"
; InfoBuffer : void* out -> "sptr"
; InfoBufferSize : DWORD -> "sptr"
; InfoBufferWritten : DWORD* optional, out -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "cldapi.dll"
#cfunc global CfGetPlaceholderRangeInfoForHydration "CfGetPlaceholderRangeInfoForHydration" int64, int64, int64, int, int64, int64, sptr, int, var
; res = CfGetPlaceholderRangeInfoForHydration(ConnectionKey, TransferKey, FileId, InfoClass, StartingOffset, RangeLength, InfoBuffer, InfoBufferSize, InfoBufferWritten)
; ConnectionKey : CF_CONNECTION_KEY -> "int64"
; TransferKey : LONGLONG -> "int64"
; FileId : LONGLONG -> "int64"
; InfoClass : CF_PLACEHOLDER_RANGE_INFO_CLASS -> "int"
; StartingOffset : LONGLONG -> "int64"
; RangeLength : LONGLONG -> "int64"
; InfoBuffer : void* out -> "sptr"
; InfoBufferSize : DWORD -> "int"
; InfoBufferWritten : DWORD* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
出力引数:
; HRESULT CfGetPlaceholderRangeInfoForHydration(CF_CONNECTION_KEY ConnectionKey, LONGLONG TransferKey, LONGLONG FileId, CF_PLACEHOLDER_RANGE_INFO_CLASS InfoClass, LONGLONG StartingOffset, LONGLONG RangeLength, void* InfoBuffer, DWORD InfoBufferSize, DWORD* InfoBufferWritten)
#uselib "cldapi.dll"
#cfunc global CfGetPlaceholderRangeInfoForHydration "CfGetPlaceholderRangeInfoForHydration" int64, int64, int64, int, int64, int64, intptr, int, var
; res = CfGetPlaceholderRangeInfoForHydration(ConnectionKey, TransferKey, FileId, InfoClass, StartingOffset, RangeLength, InfoBuffer, InfoBufferSize, InfoBufferWritten)
; ConnectionKey : CF_CONNECTION_KEY -> "int64"
; TransferKey : LONGLONG -> "int64"
; FileId : LONGLONG -> "int64"
; InfoClass : CF_PLACEHOLDER_RANGE_INFO_CLASS -> "int"
; StartingOffset : LONGLONG -> "int64"
; RangeLength : LONGLONG -> "int64"
; InfoBuffer : void* out -> "intptr"
; InfoBufferSize : DWORD -> "int"
; InfoBufferWritten : DWORD* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	cldapi = windows.NewLazySystemDLL("cldapi.dll")
	procCfGetPlaceholderRangeInfoForHydration = cldapi.NewProc("CfGetPlaceholderRangeInfoForHydration")
)

// ConnectionKey (CF_CONNECTION_KEY), TransferKey (LONGLONG), FileId (LONGLONG), InfoClass (CF_PLACEHOLDER_RANGE_INFO_CLASS), StartingOffset (LONGLONG), RangeLength (LONGLONG), InfoBuffer (void* out), InfoBufferSize (DWORD), InfoBufferWritten (DWORD* optional, out)
r1, _, err := procCfGetPlaceholderRangeInfoForHydration.Call(
	uintptr(ConnectionKey),
	uintptr(TransferKey),
	uintptr(FileId),
	uintptr(InfoClass),
	uintptr(StartingOffset),
	uintptr(RangeLength),
	uintptr(InfoBuffer),
	uintptr(InfoBufferSize),
	uintptr(InfoBufferWritten),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function CfGetPlaceholderRangeInfoForHydration(
  ConnectionKey: Int64;   // CF_CONNECTION_KEY
  TransferKey: Int64;   // LONGLONG
  FileId: Int64;   // LONGLONG
  InfoClass: Integer;   // CF_PLACEHOLDER_RANGE_INFO_CLASS
  StartingOffset: Int64;   // LONGLONG
  RangeLength: Int64;   // LONGLONG
  InfoBuffer: Pointer;   // void* out
  InfoBufferSize: DWORD;   // DWORD
  InfoBufferWritten: Pointer   // DWORD* optional, out
): Integer; stdcall;
  external 'cldapi.dll' name 'CfGetPlaceholderRangeInfoForHydration';
result := DllCall("cldapi\CfGetPlaceholderRangeInfoForHydration"
    , "Int64", ConnectionKey   ; CF_CONNECTION_KEY
    , "Int64", TransferKey   ; LONGLONG
    , "Int64", FileId   ; LONGLONG
    , "Int", InfoClass   ; CF_PLACEHOLDER_RANGE_INFO_CLASS
    , "Int64", StartingOffset   ; LONGLONG
    , "Int64", RangeLength   ; LONGLONG
    , "Ptr", InfoBuffer   ; void* out
    , "UInt", InfoBufferSize   ; DWORD
    , "Ptr", InfoBufferWritten   ; DWORD* optional, out
    , "Int")   ; return: HRESULT
●CfGetPlaceholderRangeInfoForHydration(ConnectionKey, TransferKey, FileId, InfoClass, StartingOffset, RangeLength, InfoBuffer, InfoBufferSize, InfoBufferWritten) = DLL("cldapi.dll", "int CfGetPlaceholderRangeInfoForHydration(int64, int64, int64, int, int64, int64, void*, dword, void*)")
# 呼び出し: CfGetPlaceholderRangeInfoForHydration(ConnectionKey, TransferKey, FileId, InfoClass, StartingOffset, RangeLength, InfoBuffer, InfoBufferSize, InfoBufferWritten)
# ConnectionKey : CF_CONNECTION_KEY -> "int64"
# TransferKey : LONGLONG -> "int64"
# FileId : LONGLONG -> "int64"
# InfoClass : CF_PLACEHOLDER_RANGE_INFO_CLASS -> "int"
# StartingOffset : LONGLONG -> "int64"
# RangeLength : LONGLONG -> "int64"
# InfoBuffer : void* out -> "void*"
# InfoBufferSize : DWORD -> "dword"
# InfoBufferWritten : DWORD* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。