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