ホーム › NetworkManagement.Rras › RasGetConnectStatusA
RasGetConnectStatusA
関数指定RAS接続の現在の接続状態を取得する(ANSI版)。
シグネチャ
// RASAPI32.dll (ANSI / -A)
#include <windows.h>
DWORD RasGetConnectStatusA(
HRASCONN param0,
RASCONNSTATUSA* param1
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| param0 | HRASCONN | in |
| param1 | RASCONNSTATUSA* | inout |
戻り値の型: DWORD
各言語での呼び出し定義
// RASAPI32.dll (ANSI / -A)
#include <windows.h>
DWORD RasGetConnectStatusA(
HRASCONN param0,
RASCONNSTATUSA* param1
);[DllImport("RASAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint RasGetConnectStatusA(
IntPtr param0, // HRASCONN
IntPtr param1 // RASCONNSTATUSA* in/out
);<DllImport("RASAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RasGetConnectStatusA(
param0 As IntPtr, ' HRASCONN
param1 As IntPtr ' RASCONNSTATUSA* in/out
) As UInteger
End Function' param0 : HRASCONN
' param1 : RASCONNSTATUSA* in/out
Declare PtrSafe Function RasGetConnectStatusA Lib "rasapi32" ( _
ByVal param0 As LongPtr, _
ByVal param1 As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RasGetConnectStatusA = ctypes.windll.rasapi32.RasGetConnectStatusA
RasGetConnectStatusA.restype = wintypes.DWORD
RasGetConnectStatusA.argtypes = [
wintypes.HANDLE, # param0 : HRASCONN
ctypes.c_void_p, # param1 : RASCONNSTATUSA* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RASAPI32.dll')
RasGetConnectStatusA = Fiddle::Function.new(
lib['RasGetConnectStatusA'],
[
Fiddle::TYPE_VOIDP, # param0 : HRASCONN
Fiddle::TYPE_VOIDP, # param1 : RASCONNSTATUSA* in/out
],
-Fiddle::TYPE_INT)#[link(name = "rasapi32")]
extern "system" {
fn RasGetConnectStatusA(
param0: *mut core::ffi::c_void, // HRASCONN
param1: *mut RASCONNSTATUSA // RASCONNSTATUSA* in/out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RASAPI32.dll", CharSet = CharSet.Ansi)]
public static extern uint RasGetConnectStatusA(IntPtr param0, IntPtr param1);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RASAPI32_RasGetConnectStatusA' -Namespace Win32 -PassThru
# $api::RasGetConnectStatusA(param0, param1)#uselib "RASAPI32.dll"
#func global RasGetConnectStatusA "RasGetConnectStatusA" sptr, sptr
; RasGetConnectStatusA param0, varptr(param1) ; 戻り値は stat
; param0 : HRASCONN -> "sptr"
; param1 : RASCONNSTATUSA* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RASAPI32.dll" #cfunc global RasGetConnectStatusA "RasGetConnectStatusA" sptr, var ; res = RasGetConnectStatusA(param0, param1) ; param0 : HRASCONN -> "sptr" ; param1 : RASCONNSTATUSA* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RASAPI32.dll" #cfunc global RasGetConnectStatusA "RasGetConnectStatusA" sptr, sptr ; res = RasGetConnectStatusA(param0, varptr(param1)) ; param0 : HRASCONN -> "sptr" ; param1 : RASCONNSTATUSA* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD RasGetConnectStatusA(HRASCONN param0, RASCONNSTATUSA* param1) #uselib "RASAPI32.dll" #cfunc global RasGetConnectStatusA "RasGetConnectStatusA" intptr, var ; res = RasGetConnectStatusA(param0, param1) ; param0 : HRASCONN -> "intptr" ; param1 : RASCONNSTATUSA* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD RasGetConnectStatusA(HRASCONN param0, RASCONNSTATUSA* param1) #uselib "RASAPI32.dll" #cfunc global RasGetConnectStatusA "RasGetConnectStatusA" intptr, intptr ; res = RasGetConnectStatusA(param0, varptr(param1)) ; param0 : HRASCONN -> "intptr" ; param1 : RASCONNSTATUSA* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rasapi32 = windows.NewLazySystemDLL("RASAPI32.dll")
procRasGetConnectStatusA = rasapi32.NewProc("RasGetConnectStatusA")
)
// param0 (HRASCONN), param1 (RASCONNSTATUSA* in/out)
r1, _, err := procRasGetConnectStatusA.Call(
uintptr(param0),
uintptr(param1),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction RasGetConnectStatusA(
param0: THandle; // HRASCONN
param1: Pointer // RASCONNSTATUSA* in/out
): DWORD; stdcall;
external 'RASAPI32.dll' name 'RasGetConnectStatusA';result := DllCall("RASAPI32\RasGetConnectStatusA"
, "Ptr", param0 ; HRASCONN
, "Ptr", param1 ; RASCONNSTATUSA* in/out
, "UInt") ; return: DWORD●RasGetConnectStatusA(param0, param1) = DLL("RASAPI32.dll", "dword RasGetConnectStatusA(void*, void*)")
# 呼び出し: RasGetConnectStatusA(param0, param1)
# param0 : HRASCONN -> "void*"
# param1 : RASCONNSTATUSA* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。