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