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

lineProxyResponse

関数
プロキシ要求に対する処理結果を応答する。
DLLTAPI32.dll呼出規約winapi

シグネチャ

// TAPI32.dll
#include <windows.h>

INT lineProxyResponse(
    DWORD hLine,
    LINEPROXYREQUEST* lpProxyRequest,
    DWORD dwResult
);

パラメーター

名前方向説明
hLineDWORDinプロキシ応答を返す対象の開いた回線のハンドル。
lpProxyRequestLINEPROXYREQUEST*inout応答対象となるプロキシ要求のLINEPROXYREQUEST構造体へのポインタ。
dwResultDWORDinプロキシ要求の処理結果を示す値。成功・失敗のコードを指定する。

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll
#include <windows.h>

INT lineProxyResponse(
    DWORD hLine,
    LINEPROXYREQUEST* lpProxyRequest,
    DWORD dwResult
);
[DllImport("TAPI32.dll", ExactSpelling = true)]
static extern int lineProxyResponse(
    uint hLine,   // DWORD
    IntPtr lpProxyRequest,   // LINEPROXYREQUEST* in/out
    uint dwResult   // DWORD
);
<DllImport("TAPI32.dll", ExactSpelling:=True)>
Public Shared Function lineProxyResponse(
    hLine As UInteger,   ' DWORD
    lpProxyRequest As IntPtr,   ' LINEPROXYREQUEST* in/out
    dwResult As UInteger   ' DWORD
) As Integer
End Function
' hLine : DWORD
' lpProxyRequest : LINEPROXYREQUEST* in/out
' dwResult : DWORD
Declare PtrSafe Function lineProxyResponse Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByVal lpProxyRequest As LongPtr, _
    ByVal dwResult As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

lineProxyResponse = ctypes.windll.tapi32.lineProxyResponse
lineProxyResponse.restype = ctypes.c_int
lineProxyResponse.argtypes = [
    wintypes.DWORD,  # hLine : DWORD
    ctypes.c_void_p,  # lpProxyRequest : LINEPROXYREQUEST* in/out
    wintypes.DWORD,  # dwResult : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
lineProxyResponse = Fiddle::Function.new(
  lib['lineProxyResponse'],
  [
    -Fiddle::TYPE_INT,  # hLine : DWORD
    Fiddle::TYPE_VOIDP,  # lpProxyRequest : LINEPROXYREQUEST* in/out
    -Fiddle::TYPE_INT,  # dwResult : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn lineProxyResponse(
        hLine: u32,  // DWORD
        lpProxyRequest: *mut LINEPROXYREQUEST,  // LINEPROXYREQUEST* in/out
        dwResult: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("TAPI32.dll")]
public static extern int lineProxyResponse(uint hLine, IntPtr lpProxyRequest, uint dwResult);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineProxyResponse' -Namespace Win32 -PassThru
# $api::lineProxyResponse(hLine, lpProxyRequest, dwResult)
#uselib "TAPI32.dll"
#func global lineProxyResponse "lineProxyResponse" sptr, sptr, sptr
; lineProxyResponse hLine, varptr(lpProxyRequest), dwResult   ; 戻り値は stat
; hLine : DWORD -> "sptr"
; lpProxyRequest : LINEPROXYREQUEST* in/out -> "sptr"
; dwResult : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global lineProxyResponse "lineProxyResponse" int, var, int
; res = lineProxyResponse(hLine, lpProxyRequest, dwResult)
; hLine : DWORD -> "int"
; lpProxyRequest : LINEPROXYREQUEST* in/out -> "var"
; dwResult : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineProxyResponse(DWORD hLine, LINEPROXYREQUEST* lpProxyRequest, DWORD dwResult)
#uselib "TAPI32.dll"
#cfunc global lineProxyResponse "lineProxyResponse" int, var, int
; res = lineProxyResponse(hLine, lpProxyRequest, dwResult)
; hLine : DWORD -> "int"
; lpProxyRequest : LINEPROXYREQUEST* in/out -> "var"
; dwResult : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineProxyResponse = tapi32.NewProc("lineProxyResponse")
)

// hLine (DWORD), lpProxyRequest (LINEPROXYREQUEST* in/out), dwResult (DWORD)
r1, _, err := proclineProxyResponse.Call(
	uintptr(hLine),
	uintptr(lpProxyRequest),
	uintptr(dwResult),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function lineProxyResponse(
  hLine: DWORD;   // DWORD
  lpProxyRequest: Pointer;   // LINEPROXYREQUEST* in/out
  dwResult: DWORD   // DWORD
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineProxyResponse';
result := DllCall("TAPI32\lineProxyResponse"
    , "UInt", hLine   ; DWORD
    , "Ptr", lpProxyRequest   ; LINEPROXYREQUEST* in/out
    , "UInt", dwResult   ; DWORD
    , "Int")   ; return: INT
●lineProxyResponse(hLine, lpProxyRequest, dwResult) = DLL("TAPI32.dll", "int lineProxyResponse(dword, void*, dword)")
# 呼び出し: lineProxyResponse(hLine, lpProxyRequest, dwResult)
# hLine : DWORD -> "dword"
# lpProxyRequest : LINEPROXYREQUEST* in/out -> "void*"
# dwResult : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "tapi32" fn lineProxyResponse(
    hLine: u32, // DWORD
    lpProxyRequest: [*c]LINEPROXYREQUEST, // LINEPROXYREQUEST* in/out
    dwResult: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;
proc lineProxyResponse(
    hLine: uint32,  # DWORD
    lpProxyRequest: ptr LINEPROXYREQUEST,  # LINEPROXYREQUEST* in/out
    dwResult: uint32  # DWORD
): int32 {.importc: "lineProxyResponse", stdcall, dynlib: "TAPI32.dll".}
pragma(lib, "tapi32");
extern(Windows)
int lineProxyResponse(
    uint hLine,   // DWORD
    LINEPROXYREQUEST* lpProxyRequest,   // LINEPROXYREQUEST* in/out
    uint dwResult   // DWORD
);
ccall((:lineProxyResponse, "TAPI32.dll"), stdcall, Int32,
      (UInt32, Ptr{LINEPROXYREQUEST}, UInt32),
      hLine, lpProxyRequest, dwResult)
# hLine : DWORD -> UInt32
# lpProxyRequest : LINEPROXYREQUEST* in/out -> Ptr{LINEPROXYREQUEST}
# dwResult : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t lineProxyResponse(
    uint32_t hLine,
    void* lpProxyRequest,
    uint32_t dwResult);
]]
local tapi32 = ffi.load("tapi32")
-- tapi32.lineProxyResponse(hLine, lpProxyRequest, dwResult)
-- hLine : DWORD
-- lpProxyRequest : LINEPROXYREQUEST* in/out
-- dwResult : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('TAPI32.dll');
const lineProxyResponse = lib.func('__stdcall', 'lineProxyResponse', 'int32_t', ['uint32_t', 'void *', 'uint32_t']);
// lineProxyResponse(hLine, lpProxyRequest, dwResult)
// hLine : DWORD -> 'uint32_t'
// lpProxyRequest : LINEPROXYREQUEST* in/out -> 'void *'
// dwResult : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("TAPI32.dll", {
  lineProxyResponse: { parameters: ["u32", "pointer", "u32"], result: "i32" },
});
// lib.symbols.lineProxyResponse(hLine, lpProxyRequest, dwResult)
// hLine : DWORD -> "u32"
// lpProxyRequest : LINEPROXYREQUEST* in/out -> "pointer"
// dwResult : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t lineProxyResponse(
    uint32_t hLine,
    void* lpProxyRequest,
    uint32_t dwResult);
C, "TAPI32.dll");
// $ffi->lineProxyResponse(hLine, lpProxyRequest, dwResult);
// hLine : DWORD
// lpProxyRequest : LINEPROXYREQUEST* in/out
// dwResult : DWORD
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Tapi32 extends StdCallLibrary {
    Tapi32 INSTANCE = Native.load("tapi32", Tapi32.class);
    int lineProxyResponse(
        int hLine,   // DWORD
        Pointer lpProxyRequest,   // LINEPROXYREQUEST* in/out
        int dwResult   // DWORD
    );
}
@[Link("tapi32")]
lib LibTAPI32
  fun lineProxyResponse = lineProxyResponse(
    hLine : UInt32,   # DWORD
    lpProxyRequest : LINEPROXYREQUEST*,   # LINEPROXYREQUEST* in/out
    dwResult : UInt32   # DWORD
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef lineProxyResponseNative = Int32 Function(Uint32, Pointer<Void>, Uint32);
typedef lineProxyResponseDart = int Function(int, Pointer<Void>, int);
final lineProxyResponse = DynamicLibrary.open('TAPI32.dll')
    .lookupFunction<lineProxyResponseNative, lineProxyResponseDart>('lineProxyResponse');
// hLine : DWORD -> Uint32
// lpProxyRequest : LINEPROXYREQUEST* in/out -> Pointer<Void>
// dwResult : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function lineProxyResponse(
  hLine: DWORD;   // DWORD
  lpProxyRequest: Pointer;   // LINEPROXYREQUEST* in/out
  dwResult: DWORD   // DWORD
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineProxyResponse';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "lineProxyResponse"
  c_lineProxyResponse :: Word32 -> Ptr () -> Word32 -> IO Int32
-- hLine : DWORD -> Word32
-- lpProxyRequest : LINEPROXYREQUEST* in/out -> Ptr ()
-- dwResult : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let lineproxyresponse =
  foreign "lineProxyResponse"
    (uint32_t @-> (ptr void) @-> uint32_t @-> returning int32_t)
(* hLine : DWORD -> uint32_t *)
(* lpProxyRequest : LINEPROXYREQUEST* in/out -> (ptr void) *)
(* dwResult : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library tapi32 (t "TAPI32.dll"))
(cffi:use-foreign-library tapi32)

(cffi:defcfun ("lineProxyResponse" line-proxy-response :convention :stdcall) :int32
  (h-line :uint32)   ; DWORD
  (lp-proxy-request :pointer)   ; LINEPROXYREQUEST* in/out
  (dw-result :uint32))   ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $lineProxyResponse = Win32::API::More->new('TAPI32',
    'int lineProxyResponse(DWORD hLine, LPVOID lpProxyRequest, DWORD dwResult)');
# my $ret = $lineProxyResponse->Call($hLine, $lpProxyRequest, $dwResult);
# hLine : DWORD -> DWORD
# lpProxyRequest : LINEPROXYREQUEST* in/out -> LPVOID
# dwResult : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型