ホーム › Storage.CloudFilters › CfGetPlatformInfo
CfGetPlatformInfo
関数クラウドファイルAPIのプラットフォームバージョン情報を取得する。
シグネチャ
// cldapi.dll
#include <windows.h>
HRESULT CfGetPlatformInfo(
CF_PLATFORM_INFO* PlatformVersion
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| PlatformVersion | CF_PLATFORM_INFO* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// cldapi.dll
#include <windows.h>
HRESULT CfGetPlatformInfo(
CF_PLATFORM_INFO* PlatformVersion
);[DllImport("cldapi.dll", ExactSpelling = true)]
static extern int CfGetPlatformInfo(
IntPtr PlatformVersion // CF_PLATFORM_INFO* out
);<DllImport("cldapi.dll", ExactSpelling:=True)>
Public Shared Function CfGetPlatformInfo(
PlatformVersion As IntPtr ' CF_PLATFORM_INFO* out
) As Integer
End Function' PlatformVersion : CF_PLATFORM_INFO* out
Declare PtrSafe Function CfGetPlatformInfo Lib "cldapi" ( _
ByVal PlatformVersion As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CfGetPlatformInfo = ctypes.windll.cldapi.CfGetPlatformInfo
CfGetPlatformInfo.restype = ctypes.c_int
CfGetPlatformInfo.argtypes = [
ctypes.c_void_p, # PlatformVersion : CF_PLATFORM_INFO* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('cldapi.dll')
CfGetPlatformInfo = Fiddle::Function.new(
lib['CfGetPlatformInfo'],
[
Fiddle::TYPE_VOIDP, # PlatformVersion : CF_PLATFORM_INFO* out
],
Fiddle::TYPE_INT)#[link(name = "cldapi")]
extern "system" {
fn CfGetPlatformInfo(
PlatformVersion: *mut CF_PLATFORM_INFO // CF_PLATFORM_INFO* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("cldapi.dll")]
public static extern int CfGetPlatformInfo(IntPtr PlatformVersion);
"@
$api = Add-Type -MemberDefinition $sig -Name 'cldapi_CfGetPlatformInfo' -Namespace Win32 -PassThru
# $api::CfGetPlatformInfo(PlatformVersion)#uselib "cldapi.dll"
#func global CfGetPlatformInfo "CfGetPlatformInfo" sptr
; CfGetPlatformInfo varptr(PlatformVersion) ; 戻り値は stat
; PlatformVersion : CF_PLATFORM_INFO* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "cldapi.dll" #cfunc global CfGetPlatformInfo "CfGetPlatformInfo" var ; res = CfGetPlatformInfo(PlatformVersion) ; PlatformVersion : CF_PLATFORM_INFO* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "cldapi.dll" #cfunc global CfGetPlatformInfo "CfGetPlatformInfo" sptr ; res = CfGetPlatformInfo(varptr(PlatformVersion)) ; PlatformVersion : CF_PLATFORM_INFO* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT CfGetPlatformInfo(CF_PLATFORM_INFO* PlatformVersion) #uselib "cldapi.dll" #cfunc global CfGetPlatformInfo "CfGetPlatformInfo" var ; res = CfGetPlatformInfo(PlatformVersion) ; PlatformVersion : CF_PLATFORM_INFO* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT CfGetPlatformInfo(CF_PLATFORM_INFO* PlatformVersion) #uselib "cldapi.dll" #cfunc global CfGetPlatformInfo "CfGetPlatformInfo" intptr ; res = CfGetPlatformInfo(varptr(PlatformVersion)) ; PlatformVersion : CF_PLATFORM_INFO* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
cldapi = windows.NewLazySystemDLL("cldapi.dll")
procCfGetPlatformInfo = cldapi.NewProc("CfGetPlatformInfo")
)
// PlatformVersion (CF_PLATFORM_INFO* out)
r1, _, err := procCfGetPlatformInfo.Call(
uintptr(PlatformVersion),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CfGetPlatformInfo(
PlatformVersion: Pointer // CF_PLATFORM_INFO* out
): Integer; stdcall;
external 'cldapi.dll' name 'CfGetPlatformInfo';result := DllCall("cldapi\CfGetPlatformInfo"
, "Ptr", PlatformVersion ; CF_PLATFORM_INFO* out
, "Int") ; return: HRESULT●CfGetPlatformInfo(PlatformVersion) = DLL("cldapi.dll", "int CfGetPlatformInfo(void*)")
# 呼び出し: CfGetPlatformInfo(PlatformVersion)
# PlatformVersion : CF_PLATFORM_INFO* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。