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

FaxGetConfigurationA

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

シグネチャ

// WINFAX.dll  (ANSI / -A)
#include <windows.h>

BOOL FaxGetConfigurationA(
    HANDLE FaxHandle,
    FAX_CONFIGURATIONA** FaxConfig
);

パラメーター

名前方向
FaxHandleHANDLEin
FaxConfigFAX_CONFIGURATIONA**out

戻り値の型: BOOL

各言語での呼び出し定義

// WINFAX.dll  (ANSI / -A)
#include <windows.h>

BOOL FaxGetConfigurationA(
    HANDLE FaxHandle,
    FAX_CONFIGURATIONA** FaxConfig
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINFAX.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
static extern bool FaxGetConfigurationA(
    IntPtr FaxHandle,   // HANDLE
    IntPtr FaxConfig   // FAX_CONFIGURATIONA** out
);
<DllImport("WINFAX.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function FaxGetConfigurationA(
    FaxHandle As IntPtr,   ' HANDLE
    FaxConfig As IntPtr   ' FAX_CONFIGURATIONA** out
) As Boolean
End Function
' FaxHandle : HANDLE
' FaxConfig : FAX_CONFIGURATIONA** out
Declare PtrSafe Function FaxGetConfigurationA Lib "winfax" ( _
    ByVal FaxHandle As LongPtr, _
    ByVal FaxConfig As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

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

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

var (
	winfax = windows.NewLazySystemDLL("WINFAX.dll")
	procFaxGetConfigurationA = winfax.NewProc("FaxGetConfigurationA")
)

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