InternetSetFilePointer
関数シグネチャ
// WININET.dll
#include <windows.h>
DWORD InternetSetFilePointer(
void* hFile,
INT lDistanceToMove,
INT* lpDistanceToMoveHigh, // optional
DWORD dwMoveMethod,
UINT_PTR dwContext // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| hFile | void* | in | 以前の InternetOpenUrl(HTTP または HTTPS の URL に対する)、または HttpOpenRequest(GET または HEAD の HTTP 動詞を使用し、 HttpSendRequest または HttpSendRequestEx に渡されたもの)の呼び出しから返されたハンドル。このハンドルは、 INTERNET_FLAG_DONT_CACHE または INTERNET_FLAG_NO_CACHE_WRITE の値を設定して作成されたものであってはなりません。 | ||||||||
| lDistanceToMove | INT | in | ファイルポインターを移動するバイト数を表す符号付き 64 ビット数値の下位 32 ビット。Internet Explorer 7 以前: InternetSetFilePointer は、ポインターを LONG の範囲内でのみ移動していました。この古いバージョンの関数を呼び出す場合、lpDistanceToMoveHigh は予約済みであり、0 に設定する必要があります。正の値はファイル内でポインターを前方へ移動し、負の値は後方へ移動します。 | ||||||||
| lpDistanceToMoveHigh | INT* | inoutoptional | 移動する符号付き 64 ビット距離の上位 32 ビットへのポインター。上位 32 ビットが不要な場合、このポインターは NULL に設定する必要があります。NULL でない場合、このパラメーターはファイルポインターの新しい値の上位 DWORD も受け取ります。正の値はファイル内でポインターを前方へ移動し、負の値は後方へ移動します。Internet Explorer 7 以前: InternetSetFilePointer は、ポインターを LONG の範囲内でのみ移動していました。この古いバージョンの関数を呼び出す場合、lpDistanceToMoveHigh は予約済みであり、0 に設定する必要があります。 | ||||||||
| dwMoveMethod | DWORD | in | ファイルポインター移動の起点。このパラメーターには、次のいずれかの値を指定できます。
| ||||||||
| dwContext | UINT_PTR | optional | このパラメーターは予約済みであり、0 にする必要があります。 |
戻り値の型: DWORD
公式ドキュメント
InternetReadFile のためのファイル位置を設定します。これは同期呼び出しですが、データがキャッシュから利用できず、かつサーバーがランダムアクセスをサポートしていない場合、後続の InternetReadFile の呼び出しはブロックされるか、保留状態を返すことがあります。
戻り値
関数が成功した場合、現在のファイル位置を返します。INVALID_SET_FILE_POINTER という戻り値は失敗の可能性を示しており、その後に GetLastError の呼び出しを続ける必要があります。
INVALID_SET_FILE_POINTER は新しいファイルポインターの下位 DWORD として有効な値でもあるため、呼び出し元はエラーが発生したかどうかを判断するために、関数の戻り値と GetLastError が返すエラーコードの両方を確認する必要があります。エラーが発生している場合、InternetSetFilePointer の戻り値は INVALID_SET_FILE_POINTER となり、GetLastError は NO_ERROR 以外の値を返します。
関数が成功し、lpDistanceToMoveHigh が NULL の場合、戻り値は新しいファイルポインターの下位 DWORD です。
関数が INVALID_SET_FILE_POINTER 以外の値を返した場合、InternetSetFilePointer の呼び出しは成功しており、GetLastError を呼び出す必要はないことに注意してください。
関数が成功し、lpDistanceToMoveHigh が NULL でない場合、戻り値は新しいファイルポインターの下位 DWORD であり、lpDistanceToMoveHigh には新しいファイルポインターの上位 DWORD が格納されます。
新しいファイルポインターが負の値である場合、関数は失敗し、ファイルポインターは移動されず、GetLastError が返すコードは ERROR_NEGATIVE_SEEK となります。
lpDistanceToMoveHigh が NULL であり、新しいファイル位置が 32 ビット値に収まらない場合、関数は失敗し、INVALID_SET_FILE_POINTER を返します。
解説(Remarks)
この関数は、 InternetReadFile によってファイルの終端に達した後は使用できません。
HttpOpenRequest によって作成され、 HttpSendRequestEx によって送信された HINTERNET ハンドルの場合、 InternetSetFilePointer を使用する前に、そのハンドルに対して HttpEndRequest を呼び出す必要があります。
コンテンツ長が不明な場合、InternetSetFilePointer を確実に使用することはできません。
WinINet API の他のすべての側面と同様に、この関数は DllMain 内やグローバルオブジェクトのコンストラクター・デストラクター内から安全に呼び出すことはできません。
InternetSetFilePointer は時間の経過とともに変化してきました。Internet Explorer 7 以前では、ポインターを LONG の範囲内でのみ移動していました。この古いバージョンの関数を呼び出す場合、lDistanceToMove に値全体が含まれます。正の値はファイル内でポインターを前方へ移動し、負の値は後方へ移動します。lpDistanceToMoveHigh は予約済みであり、0 に設定されます。現在のバージョンでは、lpDistanceToMoveHigh は意味を持つ値であり、負の値が示される箇所でも使用されます。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// WININET.dll
#include <windows.h>
DWORD InternetSetFilePointer(
void* hFile,
INT lDistanceToMove,
INT* lpDistanceToMoveHigh, // optional
DWORD dwMoveMethod,
UINT_PTR dwContext // optional
);[DllImport("WININET.dll", SetLastError = true, ExactSpelling = true)]
static extern uint InternetSetFilePointer(
IntPtr hFile, // void*
int lDistanceToMove, // INT
IntPtr lpDistanceToMoveHigh, // INT* optional, in/out
uint dwMoveMethod, // DWORD
UIntPtr dwContext // UINT_PTR optional
);<DllImport("WININET.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function InternetSetFilePointer(
hFile As IntPtr, ' void*
lDistanceToMove As Integer, ' INT
lpDistanceToMoveHigh As IntPtr, ' INT* optional, in/out
dwMoveMethod As UInteger, ' DWORD
dwContext As UIntPtr ' UINT_PTR optional
) As UInteger
End Function' hFile : void*
' lDistanceToMove : INT
' lpDistanceToMoveHigh : INT* optional, in/out
' dwMoveMethod : DWORD
' dwContext : UINT_PTR optional
Declare PtrSafe Function InternetSetFilePointer Lib "wininet" ( _
ByVal hFile As LongPtr, _
ByVal lDistanceToMove As Long, _
ByVal lpDistanceToMoveHigh As LongPtr, _
ByVal dwMoveMethod As Long, _
ByVal dwContext As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
InternetSetFilePointer = ctypes.windll.wininet.InternetSetFilePointer
InternetSetFilePointer.restype = wintypes.DWORD
InternetSetFilePointer.argtypes = [
ctypes.POINTER(None), # hFile : void*
ctypes.c_int, # lDistanceToMove : INT
ctypes.POINTER(ctypes.c_int), # lpDistanceToMoveHigh : INT* optional, in/out
wintypes.DWORD, # dwMoveMethod : DWORD
ctypes.c_size_t, # dwContext : UINT_PTR optional
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
InternetSetFilePointer = Fiddle::Function.new(
lib['InternetSetFilePointer'],
[
Fiddle::TYPE_VOIDP, # hFile : void*
Fiddle::TYPE_INT, # lDistanceToMove : INT
Fiddle::TYPE_VOIDP, # lpDistanceToMoveHigh : INT* optional, in/out
-Fiddle::TYPE_INT, # dwMoveMethod : DWORD
Fiddle::TYPE_UINTPTR_T, # dwContext : UINT_PTR optional
],
-Fiddle::TYPE_INT)#[link(name = "wininet")]
extern "system" {
fn InternetSetFilePointer(
hFile: *mut (), // void*
lDistanceToMove: i32, // INT
lpDistanceToMoveHigh: *mut i32, // INT* optional, in/out
dwMoveMethod: u32, // DWORD
dwContext: usize // UINT_PTR optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WININET.dll", SetLastError = true)]
public static extern uint InternetSetFilePointer(IntPtr hFile, int lDistanceToMove, IntPtr lpDistanceToMoveHigh, uint dwMoveMethod, UIntPtr dwContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_InternetSetFilePointer' -Namespace Win32 -PassThru
# $api::InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext)#uselib "WININET.dll"
#func global InternetSetFilePointer "InternetSetFilePointer" sptr, sptr, sptr, sptr, sptr
; InternetSetFilePointer hFile, lDistanceToMove, varptr(lpDistanceToMoveHigh), dwMoveMethod, dwContext ; 戻り値は stat
; hFile : void* -> "sptr"
; lDistanceToMove : INT -> "sptr"
; lpDistanceToMoveHigh : INT* optional, in/out -> "sptr"
; dwMoveMethod : DWORD -> "sptr"
; dwContext : UINT_PTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WININET.dll" #cfunc global InternetSetFilePointer "InternetSetFilePointer" sptr, int, var, int, sptr ; res = InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext) ; hFile : void* -> "sptr" ; lDistanceToMove : INT -> "int" ; lpDistanceToMoveHigh : INT* optional, in/out -> "var" ; dwMoveMethod : DWORD -> "int" ; dwContext : UINT_PTR optional -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WININET.dll" #cfunc global InternetSetFilePointer "InternetSetFilePointer" sptr, int, sptr, int, sptr ; res = InternetSetFilePointer(hFile, lDistanceToMove, varptr(lpDistanceToMoveHigh), dwMoveMethod, dwContext) ; hFile : void* -> "sptr" ; lDistanceToMove : INT -> "int" ; lpDistanceToMoveHigh : INT* optional, in/out -> "sptr" ; dwMoveMethod : DWORD -> "int" ; dwContext : UINT_PTR optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
; DWORD InternetSetFilePointer(void* hFile, INT lDistanceToMove, INT* lpDistanceToMoveHigh, DWORD dwMoveMethod, UINT_PTR dwContext) #uselib "WININET.dll" #cfunc global InternetSetFilePointer "InternetSetFilePointer" intptr, int, var, int, intptr ; res = InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext) ; hFile : void* -> "intptr" ; lDistanceToMove : INT -> "int" ; lpDistanceToMoveHigh : INT* optional, in/out -> "var" ; dwMoveMethod : DWORD -> "int" ; dwContext : UINT_PTR optional -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD InternetSetFilePointer(void* hFile, INT lDistanceToMove, INT* lpDistanceToMoveHigh, DWORD dwMoveMethod, UINT_PTR dwContext) #uselib "WININET.dll" #cfunc global InternetSetFilePointer "InternetSetFilePointer" intptr, int, intptr, int, intptr ; res = InternetSetFilePointer(hFile, lDistanceToMove, varptr(lpDistanceToMoveHigh), dwMoveMethod, dwContext) ; hFile : void* -> "intptr" ; lDistanceToMove : INT -> "int" ; lpDistanceToMoveHigh : INT* optional, in/out -> "intptr" ; dwMoveMethod : DWORD -> "int" ; dwContext : UINT_PTR optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procInternetSetFilePointer = wininet.NewProc("InternetSetFilePointer")
)
// hFile (void*), lDistanceToMove (INT), lpDistanceToMoveHigh (INT* optional, in/out), dwMoveMethod (DWORD), dwContext (UINT_PTR optional)
r1, _, err := procInternetSetFilePointer.Call(
uintptr(hFile),
uintptr(lDistanceToMove),
uintptr(lpDistanceToMoveHigh),
uintptr(dwMoveMethod),
uintptr(dwContext),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction InternetSetFilePointer(
hFile: Pointer; // void*
lDistanceToMove: Integer; // INT
lpDistanceToMoveHigh: Pointer; // INT* optional, in/out
dwMoveMethod: DWORD; // DWORD
dwContext: NativeUInt // UINT_PTR optional
): DWORD; stdcall;
external 'WININET.dll' name 'InternetSetFilePointer';result := DllCall("WININET\InternetSetFilePointer"
, "Ptr", hFile ; void*
, "Int", lDistanceToMove ; INT
, "Ptr", lpDistanceToMoveHigh ; INT* optional, in/out
, "UInt", dwMoveMethod ; DWORD
, "UPtr", dwContext ; UINT_PTR optional
, "UInt") ; return: DWORD●InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext) = DLL("WININET.dll", "dword InternetSetFilePointer(void*, int, void*, dword, int)")
# 呼び出し: InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext)
# hFile : void* -> "void*"
# lDistanceToMove : INT -> "int"
# lpDistanceToMoveHigh : INT* optional, in/out -> "void*"
# dwMoveMethod : DWORD -> "dword"
# dwContext : UINT_PTR optional -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wininet" fn InternetSetFilePointer(
hFile: ?*anyopaque, // void*
lDistanceToMove: i32, // INT
lpDistanceToMoveHigh: [*c]i32, // INT* optional, in/out
dwMoveMethod: u32, // DWORD
dwContext: usize // UINT_PTR optional
) callconv(std.os.windows.WINAPI) u32;proc InternetSetFilePointer(
hFile: pointer, # void*
lDistanceToMove: int32, # INT
lpDistanceToMoveHigh: ptr int32, # INT* optional, in/out
dwMoveMethod: uint32, # DWORD
dwContext: uint # UINT_PTR optional
): uint32 {.importc: "InternetSetFilePointer", stdcall, dynlib: "WININET.dll".}pragma(lib, "wininet");
extern(Windows)
uint InternetSetFilePointer(
void* hFile, // void*
int lDistanceToMove, // INT
int* lpDistanceToMoveHigh, // INT* optional, in/out
uint dwMoveMethod, // DWORD
size_t dwContext // UINT_PTR optional
);ccall((:InternetSetFilePointer, "WININET.dll"), stdcall, UInt32,
(Ptr{Cvoid}, Int32, Ptr{Int32}, UInt32, Csize_t),
hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext)
# hFile : void* -> Ptr{Cvoid}
# lDistanceToMove : INT -> Int32
# lpDistanceToMoveHigh : INT* optional, in/out -> Ptr{Int32}
# dwMoveMethod : DWORD -> UInt32
# dwContext : UINT_PTR optional -> Csize_t
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t InternetSetFilePointer(
void* hFile,
int32_t lDistanceToMove,
int32_t* lpDistanceToMoveHigh,
uint32_t dwMoveMethod,
uintptr_t dwContext);
]]
local wininet = ffi.load("wininet")
-- wininet.InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext)
-- hFile : void*
-- lDistanceToMove : INT
-- lpDistanceToMoveHigh : INT* optional, in/out
-- dwMoveMethod : DWORD
-- dwContext : UINT_PTR optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WININET.dll');
const InternetSetFilePointer = lib.func('__stdcall', 'InternetSetFilePointer', 'uint32_t', ['void *', 'int32_t', 'int32_t *', 'uint32_t', 'uintptr_t']);
// InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext)
// hFile : void* -> 'void *'
// lDistanceToMove : INT -> 'int32_t'
// lpDistanceToMoveHigh : INT* optional, in/out -> 'int32_t *'
// dwMoveMethod : DWORD -> 'uint32_t'
// dwContext : UINT_PTR optional -> 'uintptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WININET.dll", {
InternetSetFilePointer: { parameters: ["pointer", "i32", "pointer", "u32", "usize"], result: "u32" },
});
// lib.symbols.InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext)
// hFile : void* -> "pointer"
// lDistanceToMove : INT -> "i32"
// lpDistanceToMoveHigh : INT* optional, in/out -> "pointer"
// dwMoveMethod : DWORD -> "u32"
// dwContext : UINT_PTR optional -> "usize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t InternetSetFilePointer(
void* hFile,
int32_t lDistanceToMove,
int32_t* lpDistanceToMoveHigh,
uint32_t dwMoveMethod,
size_t dwContext);
C, "WININET.dll");
// $ffi->InternetSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, dwContext);
// hFile : void*
// lDistanceToMove : INT
// lpDistanceToMoveHigh : INT* optional, in/out
// dwMoveMethod : DWORD
// dwContext : 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);
int InternetSetFilePointer(
Pointer hFile, // void*
int lDistanceToMove, // INT
IntByReference lpDistanceToMoveHigh, // INT* optional, in/out
int dwMoveMethod, // DWORD
long dwContext // UINT_PTR optional
);
}@[Link("wininet")]
lib LibWININET
fun InternetSetFilePointer = InternetSetFilePointer(
hFile : Void*, # void*
lDistanceToMove : Int32, # INT
lpDistanceToMoveHigh : Int32*, # INT* optional, in/out
dwMoveMethod : UInt32, # DWORD
dwContext : LibC::SizeT # UINT_PTR optional
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef InternetSetFilePointerNative = Uint32 Function(Pointer<Void>, Int32, Pointer<Int32>, Uint32, UintPtr);
typedef InternetSetFilePointerDart = int Function(Pointer<Void>, int, Pointer<Int32>, int, int);
final InternetSetFilePointer = DynamicLibrary.open('WININET.dll')
.lookupFunction<InternetSetFilePointerNative, InternetSetFilePointerDart>('InternetSetFilePointer');
// hFile : void* -> Pointer<Void>
// lDistanceToMove : INT -> Int32
// lpDistanceToMoveHigh : INT* optional, in/out -> Pointer<Int32>
// dwMoveMethod : DWORD -> Uint32
// dwContext : UINT_PTR optional -> UintPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function InternetSetFilePointer(
hFile: Pointer; // void*
lDistanceToMove: Integer; // INT
lpDistanceToMoveHigh: Pointer; // INT* optional, in/out
dwMoveMethod: DWORD; // DWORD
dwContext: NativeUInt // UINT_PTR optional
): DWORD; stdcall;
external 'WININET.dll' name 'InternetSetFilePointer';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "InternetSetFilePointer"
c_InternetSetFilePointer :: Ptr () -> Int32 -> Ptr Int32 -> Word32 -> CUIntPtr -> IO Word32
-- hFile : void* -> Ptr ()
-- lDistanceToMove : INT -> Int32
-- lpDistanceToMoveHigh : INT* optional, in/out -> Ptr Int32
-- dwMoveMethod : DWORD -> Word32
-- dwContext : UINT_PTR optional -> CUIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let internetsetfilepointer =
foreign "InternetSetFilePointer"
((ptr void) @-> int32_t @-> (ptr int32_t) @-> uint32_t @-> size_t @-> returning uint32_t)
(* hFile : void* -> (ptr void) *)
(* lDistanceToMove : INT -> int32_t *)
(* lpDistanceToMoveHigh : INT* optional, in/out -> (ptr int32_t) *)
(* dwMoveMethod : DWORD -> uint32_t *)
(* dwContext : 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 ("InternetSetFilePointer" internet-set-file-pointer :convention :stdcall) :uint32
(h-file :pointer) ; void*
(l-distance-to-move :int32) ; INT
(lp-distance-to-move-high :pointer) ; INT* optional, in/out
(dw-move-method :uint32) ; DWORD
(dw-context :uint64)) ; UINT_PTR optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $InternetSetFilePointer = Win32::API::More->new('WININET',
'DWORD InternetSetFilePointer(LPVOID hFile, int lDistanceToMove, LPVOID lpDistanceToMoveHigh, DWORD dwMoveMethod, WPARAM dwContext)');
# my $ret = $InternetSetFilePointer->Call($hFile, $lDistanceToMove, $lpDistanceToMoveHigh, $dwMoveMethod, $dwContext);
# hFile : void* -> LPVOID
# lDistanceToMove : INT -> int
# lpDistanceToMoveHigh : INT* optional, in/out -> LPVOID
# dwMoveMethod : DWORD -> DWORD
# dwContext : UINT_PTR optional -> WPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。