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

HcsGetOperationContext

関数
HCS操作に関連付けられたコンテキストを取得する。
DLLcomputecore.dll呼出規約winapi

シグネチャ

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

void* HcsGetOperationContext(
    HCS_OPERATION operation
);

パラメーター

名前方向
operationHCS_OPERATIONin

戻り値の型: void*

各言語での呼び出し定義

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

void* HcsGetOperationContext(
    HCS_OPERATION operation
);
[DllImport("computecore.dll", ExactSpelling = true)]
static extern IntPtr HcsGetOperationContext(
    IntPtr operation   // HCS_OPERATION
);
<DllImport("computecore.dll", ExactSpelling:=True)>
Public Shared Function HcsGetOperationContext(
    operation As IntPtr   ' HCS_OPERATION
) As IntPtr
End Function
' operation : HCS_OPERATION
Declare PtrSafe Function HcsGetOperationContext 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

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

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

var (
	computecore = windows.NewLazySystemDLL("computecore.dll")
	procHcsGetOperationContext = computecore.NewProc("HcsGetOperationContext")
)

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