ホーム › Networking.WinInet › InternetFortezzaCommand
InternetFortezzaCommand
関数Fortezzaカードに対するコマンドを実行する。
シグネチャ
// WININET.dll
#include <windows.h>
BOOL InternetFortezzaCommand(
DWORD dwCommand,
HWND hwnd,
UINT_PTR dwReserved // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| dwCommand | DWORD | in | 実行するFortezza暗号カードへのコマンドコード。 |
| hwnd | HWND | in | コマンド実行時に表示するUIの親ウィンドウのハンドル。 |
| dwReserved | UINT_PTR | optional | 将来の拡張用の予約引数。0を指定する。 |
戻り値の型: BOOL
各言語での呼び出し定義
// WININET.dll
#include <windows.h>
BOOL InternetFortezzaCommand(
DWORD dwCommand,
HWND hwnd,
UINT_PTR dwReserved // optional
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", ExactSpelling = true)]
static extern bool InternetFortezzaCommand(
uint dwCommand, // DWORD
IntPtr hwnd, // HWND
UIntPtr dwReserved // UINT_PTR optional
);<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function InternetFortezzaCommand(
dwCommand As UInteger, ' DWORD
hwnd As IntPtr, ' HWND
dwReserved As UIntPtr ' UINT_PTR optional
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' dwCommand : DWORD
' hwnd : HWND
' dwReserved : UINT_PTR optional
Declare PtrSafe Function InternetFortezzaCommand Lib "wininet" ( _
ByVal dwCommand As Long, _
ByVal hwnd As LongPtr, _
ByVal dwReserved As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
InternetFortezzaCommand = ctypes.windll.wininet.InternetFortezzaCommand
InternetFortezzaCommand.restype = wintypes.BOOL
InternetFortezzaCommand.argtypes = [
wintypes.DWORD, # dwCommand : DWORD
wintypes.HANDLE, # hwnd : HWND
ctypes.c_size_t, # dwReserved : UINT_PTR optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
InternetFortezzaCommand = Fiddle::Function.new(
lib['InternetFortezzaCommand'],
[
-Fiddle::TYPE_INT, # dwCommand : DWORD
Fiddle::TYPE_VOIDP, # hwnd : HWND
Fiddle::TYPE_UINTPTR_T, # dwReserved : UINT_PTR optional
],
Fiddle::TYPE_INT)#[link(name = "wininet")]
extern "system" {
fn InternetFortezzaCommand(
dwCommand: u32, // DWORD
hwnd: *mut core::ffi::c_void, // HWND
dwReserved: usize // UINT_PTR optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll")]
public static extern bool InternetFortezzaCommand(uint dwCommand, IntPtr hwnd, UIntPtr dwReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_InternetFortezzaCommand' -Namespace Win32 -PassThru
# $api::InternetFortezzaCommand(dwCommand, hwnd, dwReserved)#uselib "WININET.dll"
#func global InternetFortezzaCommand "InternetFortezzaCommand" sptr, sptr, sptr
; InternetFortezzaCommand dwCommand, hwnd, dwReserved ; 戻り値は stat
; dwCommand : DWORD -> "sptr"
; hwnd : HWND -> "sptr"
; dwReserved : UINT_PTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WININET.dll"
#cfunc global InternetFortezzaCommand "InternetFortezzaCommand" int, sptr, sptr
; res = InternetFortezzaCommand(dwCommand, hwnd, dwReserved)
; dwCommand : DWORD -> "int"
; hwnd : HWND -> "sptr"
; dwReserved : UINT_PTR optional -> "sptr"; BOOL InternetFortezzaCommand(DWORD dwCommand, HWND hwnd, UINT_PTR dwReserved)
#uselib "WININET.dll"
#cfunc global InternetFortezzaCommand "InternetFortezzaCommand" int, intptr, intptr
; res = InternetFortezzaCommand(dwCommand, hwnd, dwReserved)
; dwCommand : DWORD -> "int"
; hwnd : HWND -> "intptr"
; dwReserved : UINT_PTR optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procInternetFortezzaCommand = wininet.NewProc("InternetFortezzaCommand")
)
// dwCommand (DWORD), hwnd (HWND), dwReserved (UINT_PTR optional)
r1, _, err := procInternetFortezzaCommand.Call(
uintptr(dwCommand),
uintptr(hwnd),
uintptr(dwReserved),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction InternetFortezzaCommand(
dwCommand: DWORD; // DWORD
hwnd: THandle; // HWND
dwReserved: NativeUInt // UINT_PTR optional
): BOOL; stdcall;
external 'WININET.dll' name 'InternetFortezzaCommand';result := DllCall("WININET\InternetFortezzaCommand"
, "UInt", dwCommand ; DWORD
, "Ptr", hwnd ; HWND
, "UPtr", dwReserved ; UINT_PTR optional
, "Int") ; return: BOOL●InternetFortezzaCommand(dwCommand, hwnd, dwReserved) = DLL("WININET.dll", "bool InternetFortezzaCommand(dword, void*, int)")
# 呼び出し: InternetFortezzaCommand(dwCommand, hwnd, dwReserved)
# dwCommand : DWORD -> "dword"
# hwnd : HWND -> "void*"
# dwReserved : UINT_PTR optional -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wininet" fn InternetFortezzaCommand(
dwCommand: u32, // DWORD
hwnd: ?*anyopaque, // HWND
dwReserved: usize // UINT_PTR optional
) callconv(std.os.windows.WINAPI) i32;proc InternetFortezzaCommand(
dwCommand: uint32, # DWORD
hwnd: pointer, # HWND
dwReserved: uint # UINT_PTR optional
): int32 {.importc: "InternetFortezzaCommand", stdcall, dynlib: "WININET.dll".}pragma(lib, "wininet");
extern(Windows)
int InternetFortezzaCommand(
uint dwCommand, // DWORD
void* hwnd, // HWND
size_t dwReserved // UINT_PTR optional
);ccall((:InternetFortezzaCommand, "WININET.dll"), stdcall, Int32,
(UInt32, Ptr{Cvoid}, Csize_t),
dwCommand, hwnd, dwReserved)
# dwCommand : DWORD -> UInt32
# hwnd : HWND -> Ptr{Cvoid}
# dwReserved : UINT_PTR optional -> Csize_t
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t InternetFortezzaCommand(
uint32_t dwCommand,
void* hwnd,
uintptr_t dwReserved);
]]
local wininet = ffi.load("wininet")
-- wininet.InternetFortezzaCommand(dwCommand, hwnd, dwReserved)
-- dwCommand : DWORD
-- hwnd : HWND
-- dwReserved : UINT_PTR optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WININET.dll');
const InternetFortezzaCommand = lib.func('__stdcall', 'InternetFortezzaCommand', 'int32_t', ['uint32_t', 'void *', 'uintptr_t']);
// InternetFortezzaCommand(dwCommand, hwnd, dwReserved)
// dwCommand : DWORD -> 'uint32_t'
// hwnd : HWND -> 'void *'
// dwReserved : UINT_PTR optional -> 'uintptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WININET.dll", {
InternetFortezzaCommand: { parameters: ["u32", "pointer", "usize"], result: "i32" },
});
// lib.symbols.InternetFortezzaCommand(dwCommand, hwnd, dwReserved)
// dwCommand : DWORD -> "u32"
// hwnd : HWND -> "pointer"
// dwReserved : UINT_PTR optional -> "usize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t InternetFortezzaCommand(
uint32_t dwCommand,
void* hwnd,
size_t dwReserved);
C, "WININET.dll");
// $ffi->InternetFortezzaCommand(dwCommand, hwnd, dwReserved);
// dwCommand : DWORD
// hwnd : HWND
// dwReserved : UINT_PTR optional
// 構造体/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 Wininet extends StdCallLibrary {
Wininet INSTANCE = Native.load("wininet", Wininet.class);
boolean InternetFortezzaCommand(
int dwCommand, // DWORD
Pointer hwnd, // HWND
long dwReserved // UINT_PTR optional
);
}@[Link("wininet")]
lib LibWININET
fun InternetFortezzaCommand = InternetFortezzaCommand(
dwCommand : UInt32, # DWORD
hwnd : Void*, # HWND
dwReserved : LibC::SizeT # UINT_PTR optional
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef InternetFortezzaCommandNative = Int32 Function(Uint32, Pointer<Void>, UintPtr);
typedef InternetFortezzaCommandDart = int Function(int, Pointer<Void>, int);
final InternetFortezzaCommand = DynamicLibrary.open('WININET.dll')
.lookupFunction<InternetFortezzaCommandNative, InternetFortezzaCommandDart>('InternetFortezzaCommand');
// dwCommand : DWORD -> Uint32
// hwnd : HWND -> Pointer<Void>
// dwReserved : UINT_PTR optional -> UintPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function InternetFortezzaCommand(
dwCommand: DWORD; // DWORD
hwnd: THandle; // HWND
dwReserved: NativeUInt // UINT_PTR optional
): BOOL; stdcall;
external 'WININET.dll' name 'InternetFortezzaCommand';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "InternetFortezzaCommand"
c_InternetFortezzaCommand :: Word32 -> Ptr () -> CUIntPtr -> IO CInt
-- dwCommand : DWORD -> Word32
-- hwnd : HWND -> Ptr ()
-- dwReserved : UINT_PTR optional -> CUIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let internetfortezzacommand =
foreign "InternetFortezzaCommand"
(uint32_t @-> (ptr void) @-> size_t @-> returning int32_t)
(* dwCommand : DWORD -> uint32_t *)
(* hwnd : HWND -> (ptr void) *)
(* dwReserved : UINT_PTR optional -> size_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wininet (t "WININET.dll"))
(cffi:use-foreign-library wininet)
(cffi:defcfun ("InternetFortezzaCommand" internet-fortezza-command :convention :stdcall) :int32
(dw-command :uint32) ; DWORD
(hwnd :pointer) ; HWND
(dw-reserved :uint64)) ; UINT_PTR optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $InternetFortezzaCommand = Win32::API::More->new('WININET',
'BOOL InternetFortezzaCommand(DWORD dwCommand, HANDLE hwnd, WPARAM dwReserved)');
# my $ret = $InternetFortezzaCommand->Call($dwCommand, $hwnd, $dwReserved);
# dwCommand : DWORD -> DWORD
# hwnd : HWND -> HANDLE
# dwReserved : UINT_PTR optional -> WPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。