Win32 API 日本語リファレンス
ホームDevices.Sensors › CollectionsListGetSerializedSize

CollectionsListGetSerializedSize

関数
コレクションリストのシリアライズ後のサイズを取得する。
DLLSensorsUtilsV2.dll呼出規約winapi

シグネチャ

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

DWORD CollectionsListGetSerializedSize(
    const SENSOR_COLLECTION_LIST* Collection
);

パラメーター

名前方向
CollectionSENSOR_COLLECTION_LIST*in

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD CollectionsListGetSerializedSize(
    const SENSOR_COLLECTION_LIST* Collection
);
[DllImport("SensorsUtilsV2.dll", ExactSpelling = true)]
static extern uint CollectionsListGetSerializedSize(
    IntPtr Collection   // SENSOR_COLLECTION_LIST*
);
<DllImport("SensorsUtilsV2.dll", ExactSpelling:=True)>
Public Shared Function CollectionsListGetSerializedSize(
    Collection As IntPtr   ' SENSOR_COLLECTION_LIST*
) As UInteger
End Function
' Collection : SENSOR_COLLECTION_LIST*
Declare PtrSafe Function CollectionsListGetSerializedSize Lib "sensorsutilsv2" ( _
    ByVal Collection As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CollectionsListGetSerializedSize = ctypes.windll.sensorsutilsv2.CollectionsListGetSerializedSize
CollectionsListGetSerializedSize.restype = wintypes.DWORD
CollectionsListGetSerializedSize.argtypes = [
    ctypes.c_void_p,  # Collection : SENSOR_COLLECTION_LIST*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	sensorsutilsv2 = windows.NewLazySystemDLL("SensorsUtilsV2.dll")
	procCollectionsListGetSerializedSize = sensorsutilsv2.NewProc("CollectionsListGetSerializedSize")
)

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