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

HcnCloseGuestNetworkService

関数
ゲストネットワークサービスのハンドルを閉じる。
DLLcomputenetwork.dll呼出規約winapi

シグネチャ

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

HRESULT HcnCloseGuestNetworkService(
    void* GuestNetworkService
);

パラメーター

名前方向
GuestNetworkServicevoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

HcnCloseGuestNetworkService = ctypes.windll.computenetwork.HcnCloseGuestNetworkService
HcnCloseGuestNetworkService.restype = ctypes.c_int
HcnCloseGuestNetworkService.argtypes = [
    ctypes.POINTER(None),  # GuestNetworkService : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	computenetwork = windows.NewLazySystemDLL("computenetwork.dll")
	procHcnCloseGuestNetworkService = computenetwork.NewProc("HcnCloseGuestNetworkService")
)

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