ホーム › NetworkManagement.WindowsFirewall › NetworkIsolationDiagnoseConnectFailureAndGetInfo
NetworkIsolationDiagnoseConnectFailureAndGetInfo
関数ネットワーク分離による接続失敗を診断して原因情報を取得する。
シグネチャ
// api-ms-win-net-isolation-l1-1-0.dll
#include <windows.h>
DWORD NetworkIsolationDiagnoseConnectFailureAndGetInfo(
LPCWSTR wszServerName,
NETISO_ERROR_TYPE* netIsoError
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| wszServerName | LPCWSTR | in |
| netIsoError | NETISO_ERROR_TYPE* | out |
戻り値の型: DWORD
各言語での呼び出し定義
// api-ms-win-net-isolation-l1-1-0.dll
#include <windows.h>
DWORD NetworkIsolationDiagnoseConnectFailureAndGetInfo(
LPCWSTR wszServerName,
NETISO_ERROR_TYPE* netIsoError
);[DllImport("api-ms-win-net-isolation-l1-1-0.dll", ExactSpelling = true)]
static extern uint NetworkIsolationDiagnoseConnectFailureAndGetInfo(
[MarshalAs(UnmanagedType.LPWStr)] string wszServerName, // LPCWSTR
out int netIsoError // NETISO_ERROR_TYPE* out
);<DllImport("api-ms-win-net-isolation-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Function NetworkIsolationDiagnoseConnectFailureAndGetInfo(
<MarshalAs(UnmanagedType.LPWStr)> wszServerName As String, ' LPCWSTR
<Out> ByRef netIsoError As Integer ' NETISO_ERROR_TYPE* out
) As UInteger
End Function' wszServerName : LPCWSTR
' netIsoError : NETISO_ERROR_TYPE* out
Declare PtrSafe Function NetworkIsolationDiagnoseConnectFailureAndGetInfo Lib "api-ms-win-net-isolation-l1-1-0" ( _
ByVal wszServerName As LongPtr, _
ByRef netIsoError As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
NetworkIsolationDiagnoseConnectFailureAndGetInfo = ctypes.windll.LoadLibrary("api-ms-win-net-isolation-l1-1-0.dll").NetworkIsolationDiagnoseConnectFailureAndGetInfo
NetworkIsolationDiagnoseConnectFailureAndGetInfo.restype = wintypes.DWORD
NetworkIsolationDiagnoseConnectFailureAndGetInfo.argtypes = [
wintypes.LPCWSTR, # wszServerName : LPCWSTR
ctypes.c_void_p, # netIsoError : NETISO_ERROR_TYPE* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('api-ms-win-net-isolation-l1-1-0.dll')
NetworkIsolationDiagnoseConnectFailureAndGetInfo = Fiddle::Function.new(
lib['NetworkIsolationDiagnoseConnectFailureAndGetInfo'],
[
Fiddle::TYPE_VOIDP, # wszServerName : LPCWSTR
Fiddle::TYPE_VOIDP, # netIsoError : NETISO_ERROR_TYPE* out
],
-Fiddle::TYPE_INT)#[link(name = "api-ms-win-net-isolation-l1-1-0")]
extern "system" {
fn NetworkIsolationDiagnoseConnectFailureAndGetInfo(
wszServerName: *const u16, // LPCWSTR
netIsoError: *mut i32 // NETISO_ERROR_TYPE* out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("api-ms-win-net-isolation-l1-1-0.dll")]
public static extern uint NetworkIsolationDiagnoseConnectFailureAndGetInfo([MarshalAs(UnmanagedType.LPWStr)] string wszServerName, out int netIsoError);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-net-isolation-l1-1-0_NetworkIsolationDiagnoseConnectFailureAndGetInfo' -Namespace Win32 -PassThru
# $api::NetworkIsolationDiagnoseConnectFailureAndGetInfo(wszServerName, netIsoError)#uselib "api-ms-win-net-isolation-l1-1-0.dll"
#func global NetworkIsolationDiagnoseConnectFailureAndGetInfo "NetworkIsolationDiagnoseConnectFailureAndGetInfo" sptr, sptr
; NetworkIsolationDiagnoseConnectFailureAndGetInfo wszServerName, netIsoError ; 戻り値は stat
; wszServerName : LPCWSTR -> "sptr"
; netIsoError : NETISO_ERROR_TYPE* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "api-ms-win-net-isolation-l1-1-0.dll"
#cfunc global NetworkIsolationDiagnoseConnectFailureAndGetInfo "NetworkIsolationDiagnoseConnectFailureAndGetInfo" wstr, int
; res = NetworkIsolationDiagnoseConnectFailureAndGetInfo(wszServerName, netIsoError)
; wszServerName : LPCWSTR -> "wstr"
; netIsoError : NETISO_ERROR_TYPE* out -> "int"; DWORD NetworkIsolationDiagnoseConnectFailureAndGetInfo(LPCWSTR wszServerName, NETISO_ERROR_TYPE* netIsoError)
#uselib "api-ms-win-net-isolation-l1-1-0.dll"
#cfunc global NetworkIsolationDiagnoseConnectFailureAndGetInfo "NetworkIsolationDiagnoseConnectFailureAndGetInfo" wstr, int
; res = NetworkIsolationDiagnoseConnectFailureAndGetInfo(wszServerName, netIsoError)
; wszServerName : LPCWSTR -> "wstr"
; netIsoError : NETISO_ERROR_TYPE* out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
api_ms_win_net_isolation_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-net-isolation-l1-1-0.dll")
procNetworkIsolationDiagnoseConnectFailureAndGetInfo = api_ms_win_net_isolation_l1_1_0.NewProc("NetworkIsolationDiagnoseConnectFailureAndGetInfo")
)
// wszServerName (LPCWSTR), netIsoError (NETISO_ERROR_TYPE* out)
r1, _, err := procNetworkIsolationDiagnoseConnectFailureAndGetInfo.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(wszServerName))),
uintptr(netIsoError),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction NetworkIsolationDiagnoseConnectFailureAndGetInfo(
wszServerName: PWideChar; // LPCWSTR
netIsoError: Pointer // NETISO_ERROR_TYPE* out
): DWORD; stdcall;
external 'api-ms-win-net-isolation-l1-1-0.dll' name 'NetworkIsolationDiagnoseConnectFailureAndGetInfo';result := DllCall("api-ms-win-net-isolation-l1-1-0\NetworkIsolationDiagnoseConnectFailureAndGetInfo"
, "WStr", wszServerName ; LPCWSTR
, "Ptr", netIsoError ; NETISO_ERROR_TYPE* out
, "UInt") ; return: DWORD●NetworkIsolationDiagnoseConnectFailureAndGetInfo(wszServerName, netIsoError) = DLL("api-ms-win-net-isolation-l1-1-0.dll", "dword NetworkIsolationDiagnoseConnectFailureAndGetInfo(char*, void*)")
# 呼び出し: NetworkIsolationDiagnoseConnectFailureAndGetInfo(wszServerName, netIsoError)
# wszServerName : LPCWSTR -> "char*"
# netIsoError : NETISO_ERROR_TYPE* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。