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

HcsRevokeVmGroupAccess

関数
指定ファイルへのVMグループアクセス権を取り消す。
DLLcomputecore.dll呼出規約winapi

シグネチャ

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

HRESULT HcsRevokeVmGroupAccess(
    LPCWSTR filePath
);

パラメーター

名前方向
filePathLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT HcsRevokeVmGroupAccess(
    LPCWSTR filePath
);
[DllImport("computecore.dll", ExactSpelling = true)]
static extern int HcsRevokeVmGroupAccess(
    [MarshalAs(UnmanagedType.LPWStr)] string filePath   // LPCWSTR
);
<DllImport("computecore.dll", ExactSpelling:=True)>
Public Shared Function HcsRevokeVmGroupAccess(
    <MarshalAs(UnmanagedType.LPWStr)> filePath As String   ' LPCWSTR
) As Integer
End Function
' filePath : LPCWSTR
Declare PtrSafe Function HcsRevokeVmGroupAccess Lib "computecore" ( _
    ByVal filePath As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HcsRevokeVmGroupAccess = ctypes.windll.computecore.HcsRevokeVmGroupAccess
HcsRevokeVmGroupAccess.restype = ctypes.c_int
HcsRevokeVmGroupAccess.argtypes = [
    wintypes.LPCWSTR,  # filePath : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('computecore.dll')
HcsRevokeVmGroupAccess = Fiddle::Function.new(
  lib['HcsRevokeVmGroupAccess'],
  [
    Fiddle::TYPE_VOIDP,  # filePath : LPCWSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "computecore")]
extern "system" {
    fn HcsRevokeVmGroupAccess(
        filePath: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("computecore.dll")]
public static extern int HcsRevokeVmGroupAccess([MarshalAs(UnmanagedType.LPWStr)] string filePath);
"@
$api = Add-Type -MemberDefinition $sig -Name 'computecore_HcsRevokeVmGroupAccess' -Namespace Win32 -PassThru
# $api::HcsRevokeVmGroupAccess(filePath)
#uselib "computecore.dll"
#func global HcsRevokeVmGroupAccess "HcsRevokeVmGroupAccess" sptr
; HcsRevokeVmGroupAccess filePath   ; 戻り値は stat
; filePath : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "computecore.dll"
#cfunc global HcsRevokeVmGroupAccess "HcsRevokeVmGroupAccess" wstr
; res = HcsRevokeVmGroupAccess(filePath)
; filePath : LPCWSTR -> "wstr"
; HRESULT HcsRevokeVmGroupAccess(LPCWSTR filePath)
#uselib "computecore.dll"
#cfunc global HcsRevokeVmGroupAccess "HcsRevokeVmGroupAccess" wstr
; res = HcsRevokeVmGroupAccess(filePath)
; filePath : LPCWSTR -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	computecore = windows.NewLazySystemDLL("computecore.dll")
	procHcsRevokeVmGroupAccess = computecore.NewProc("HcsRevokeVmGroupAccess")
)

// filePath (LPCWSTR)
r1, _, err := procHcsRevokeVmGroupAccess.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(filePath))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function HcsRevokeVmGroupAccess(
  filePath: PWideChar   // LPCWSTR
): Integer; stdcall;
  external 'computecore.dll' name 'HcsRevokeVmGroupAccess';
result := DllCall("computecore\HcsRevokeVmGroupAccess"
    , "WStr", filePath   ; LPCWSTR
    , "Int")   ; return: HRESULT
●HcsRevokeVmGroupAccess(filePath) = DLL("computecore.dll", "int HcsRevokeVmGroupAccess(char*)")
# 呼び出し: HcsRevokeVmGroupAccess(filePath)
# filePath : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。