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

HcnCloseNamespace

関数
名前空間ハンドルを閉じる。
DLLcomputenetwork.dll呼出規約winapi

シグネチャ

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

HRESULT HcnCloseNamespace(
    void* Namespace
);

パラメーター

名前方向
Namespacevoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

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

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

var (
	computenetwork = windows.NewLazySystemDLL("computenetwork.dll")
	procHcnCloseNamespace = computenetwork.NewProc("HcnCloseNamespace")
)

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