Win32 API 日本語リファレンス
ホームDevices.Fax › FaxGetConfigurationW

FaxGetConfigurationW

関数
ファクスサーバーの構成設定を取得する。
DLLWINFAX.dll文字セットUnicode (-W)呼出規約winapiSetLastErrorあり対応OSWindows 2000 以降

シグネチャ

// WINFAX.dll  (Unicode / -W)
#include <windows.h>

BOOL FaxGetConfigurationW(
    HANDLE FaxHandle,
    FAX_CONFIGURATIONW** FaxConfig
);

パラメーター

名前方向
FaxHandleHANDLEin
FaxConfigFAX_CONFIGURATIONW**out

戻り値の型: BOOL

各言語での呼び出し定義

// WINFAX.dll  (Unicode / -W)
#include <windows.h>

BOOL FaxGetConfigurationW(
    HANDLE FaxHandle,
    FAX_CONFIGURATIONW** FaxConfig
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINFAX.dll", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
static extern bool FaxGetConfigurationW(
    IntPtr FaxHandle,   // HANDLE
    IntPtr FaxConfig   // FAX_CONFIGURATIONW** out
);
<DllImport("WINFAX.dll", CharSet:=CharSet.Unicode, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function FaxGetConfigurationW(
    FaxHandle As IntPtr,   ' HANDLE
    FaxConfig As IntPtr   ' FAX_CONFIGURATIONW** out
) As Boolean
End Function
' FaxHandle : HANDLE
' FaxConfig : FAX_CONFIGURATIONW** out
Declare PtrSafe Function FaxGetConfigurationW Lib "winfax" ( _
    ByVal FaxHandle As LongPtr, _
    ByVal FaxConfig As LongPtr) 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

FaxGetConfigurationW = ctypes.windll.winfax.FaxGetConfigurationW
FaxGetConfigurationW.restype = wintypes.BOOL
FaxGetConfigurationW.argtypes = [
    wintypes.HANDLE,  # FaxHandle : HANDLE
    ctypes.c_void_p,  # FaxConfig : FAX_CONFIGURATIONW** out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WINFAX.dll')
FaxGetConfigurationW = Fiddle::Function.new(
  lib['FaxGetConfigurationW'],
  [
    Fiddle::TYPE_VOIDP,  # FaxHandle : HANDLE
    Fiddle::TYPE_VOIDP,  # FaxConfig : FAX_CONFIGURATIONW** out
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "winfax")]
extern "system" {
    fn FaxGetConfigurationW(
        FaxHandle: *mut core::ffi::c_void,  // HANDLE
        FaxConfig: *mut *mut FAX_CONFIGURATIONW  // FAX_CONFIGURATIONW** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINFAX.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool FaxGetConfigurationW(IntPtr FaxHandle, IntPtr FaxConfig);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINFAX_FaxGetConfigurationW' -Namespace Win32 -PassThru
# $api::FaxGetConfigurationW(FaxHandle, FaxConfig)
#uselib "WINFAX.dll"
#func global FaxGetConfigurationW "FaxGetConfigurationW" wptr, wptr
; FaxGetConfigurationW FaxHandle, varptr(FaxConfig)   ; 戻り値は stat
; FaxHandle : HANDLE -> "wptr"
; FaxConfig : FAX_CONFIGURATIONW** out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WINFAX.dll"
#cfunc global FaxGetConfigurationW "FaxGetConfigurationW" sptr, var
; res = FaxGetConfigurationW(FaxHandle, FaxConfig)
; FaxHandle : HANDLE -> "sptr"
; FaxConfig : FAX_CONFIGURATIONW** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL FaxGetConfigurationW(HANDLE FaxHandle, FAX_CONFIGURATIONW** FaxConfig)
#uselib "WINFAX.dll"
#cfunc global FaxGetConfigurationW "FaxGetConfigurationW" intptr, var
; res = FaxGetConfigurationW(FaxHandle, FaxConfig)
; FaxHandle : HANDLE -> "intptr"
; FaxConfig : FAX_CONFIGURATIONW** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winfax = windows.NewLazySystemDLL("WINFAX.dll")
	procFaxGetConfigurationW = winfax.NewProc("FaxGetConfigurationW")
)

// FaxHandle (HANDLE), FaxConfig (FAX_CONFIGURATIONW** out)
r1, _, err := procFaxGetConfigurationW.Call(
	uintptr(FaxHandle),
	uintptr(FaxConfig),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function FaxGetConfigurationW(
  FaxHandle: THandle;   // HANDLE
  FaxConfig: Pointer   // FAX_CONFIGURATIONW** out
): BOOL; stdcall;
  external 'WINFAX.dll' name 'FaxGetConfigurationW';
result := DllCall("WINFAX\FaxGetConfigurationW"
    , "Ptr", FaxHandle   ; HANDLE
    , "Ptr", FaxConfig   ; FAX_CONFIGURATIONW** out
    , "Int")   ; return: BOOL
●FaxGetConfigurationW(FaxHandle, FaxConfig) = DLL("WINFAX.dll", "bool FaxGetConfigurationW(void*, void*)")
# 呼び出し: FaxGetConfigurationW(FaxHandle, FaxConfig)
# FaxHandle : HANDLE -> "void*"
# FaxConfig : FAX_CONFIGURATIONW** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。