Win32 API 日本語リファレンス
ホームSystem.HostComputeSystem › HcsGetComputeSystemFromOperation

HcsGetComputeSystemFromOperation

関数
HCS操作からコンピュートシステムハンドルを取得する。
DLLcomputecore.dll呼出規約winapi

シグネチャ

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

HCS_SYSTEM HcsGetComputeSystemFromOperation(
    HCS_OPERATION operation
);

パラメーター

名前方向
operationHCS_OPERATIONin

戻り値の型: HCS_SYSTEM

各言語での呼び出し定義

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

HCS_SYSTEM HcsGetComputeSystemFromOperation(
    HCS_OPERATION operation
);
[DllImport("computecore.dll", ExactSpelling = true)]
static extern IntPtr HcsGetComputeSystemFromOperation(
    IntPtr operation   // HCS_OPERATION
);
<DllImport("computecore.dll", ExactSpelling:=True)>
Public Shared Function HcsGetComputeSystemFromOperation(
    operation As IntPtr   ' HCS_OPERATION
) As IntPtr
End Function
' operation : HCS_OPERATION
Declare PtrSafe Function HcsGetComputeSystemFromOperation Lib "computecore" ( _
    ByVal operation As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HcsGetComputeSystemFromOperation = ctypes.windll.computecore.HcsGetComputeSystemFromOperation
HcsGetComputeSystemFromOperation.restype = ctypes.c_void_p
HcsGetComputeSystemFromOperation.argtypes = [
    wintypes.HANDLE,  # operation : HCS_OPERATION
]
require 'fiddle'
require 'fiddle/import'

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

var (
	computecore = windows.NewLazySystemDLL("computecore.dll")
	procHcsGetComputeSystemFromOperation = computecore.NewProc("HcsGetComputeSystemFromOperation")
)

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