Win32 API 日本語リファレンス
ホームNetworkManagement.WindowsNetworkVirtualization › WnvOpen

WnvOpen

関数
Windowsネットワーク仮想化(WNV)へのハンドルを開く。
DLLwnvapi.dll呼出規約winapi対応OSwindowsserver2012

シグネチャ

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

HANDLE WnvOpen(void);

パラメーターなし。戻り値: HANDLE

各言語での呼び出し定義

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

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

WnvOpen = ctypes.windll.wnvapi.WnvOpen
WnvOpen.restype = ctypes.c_void_p
WnvOpen.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	wnvapi = windows.NewLazySystemDLL("wnvapi.dll")
	procWnvOpen = wnvapi.NewProc("WnvOpen")
)

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