ホーム › System.WinRT › CoDecodeProxy
CoDecodeProxy
関数クライアントのプロキシアドレスからサーバー情報を取得する。
シグネチャ
// OLE32.dll
#include <windows.h>
HRESULT CoDecodeProxy(
DWORD dwClientPid,
ULONGLONG ui64ProxyAddress,
ServerInformation* pServerInformation
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| dwClientPid | DWORD | in |
| ui64ProxyAddress | ULONGLONG | in |
| pServerInformation | ServerInformation* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// OLE32.dll
#include <windows.h>
HRESULT CoDecodeProxy(
DWORD dwClientPid,
ULONGLONG ui64ProxyAddress,
ServerInformation* pServerInformation
);[DllImport("OLE32.dll", ExactSpelling = true)]
static extern int CoDecodeProxy(
uint dwClientPid, // DWORD
ulong ui64ProxyAddress, // ULONGLONG
IntPtr pServerInformation // ServerInformation* out
);<DllImport("OLE32.dll", ExactSpelling:=True)>
Public Shared Function CoDecodeProxy(
dwClientPid As UInteger, ' DWORD
ui64ProxyAddress As ULong, ' ULONGLONG
pServerInformation As IntPtr ' ServerInformation* out
) As Integer
End Function' dwClientPid : DWORD
' ui64ProxyAddress : ULONGLONG
' pServerInformation : ServerInformation* out
Declare PtrSafe Function CoDecodeProxy Lib "ole32" ( _
ByVal dwClientPid As Long, _
ByVal ui64ProxyAddress As LongLong, _
ByVal pServerInformation As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CoDecodeProxy = ctypes.windll.ole32.CoDecodeProxy
CoDecodeProxy.restype = ctypes.c_int
CoDecodeProxy.argtypes = [
wintypes.DWORD, # dwClientPid : DWORD
ctypes.c_ulonglong, # ui64ProxyAddress : ULONGLONG
ctypes.c_void_p, # pServerInformation : ServerInformation* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OLE32.dll')
CoDecodeProxy = Fiddle::Function.new(
lib['CoDecodeProxy'],
[
-Fiddle::TYPE_INT, # dwClientPid : DWORD
-Fiddle::TYPE_LONG_LONG, # ui64ProxyAddress : ULONGLONG
Fiddle::TYPE_VOIDP, # pServerInformation : ServerInformation* out
],
Fiddle::TYPE_INT)#[link(name = "ole32")]
extern "system" {
fn CoDecodeProxy(
dwClientPid: u32, // DWORD
ui64ProxyAddress: u64, // ULONGLONG
pServerInformation: *mut ServerInformation // ServerInformation* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OLE32.dll")]
public static extern int CoDecodeProxy(uint dwClientPid, ulong ui64ProxyAddress, IntPtr pServerInformation);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLE32_CoDecodeProxy' -Namespace Win32 -PassThru
# $api::CoDecodeProxy(dwClientPid, ui64ProxyAddress, pServerInformation)#uselib "OLE32.dll"
#func global CoDecodeProxy "CoDecodeProxy" sptr, sptr, sptr
; CoDecodeProxy dwClientPid, ui64ProxyAddress, varptr(pServerInformation) ; 戻り値は stat
; dwClientPid : DWORD -> "sptr"
; ui64ProxyAddress : ULONGLONG -> "sptr"
; pServerInformation : ServerInformation* out -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "OLE32.dll" #cfunc global CoDecodeProxy "CoDecodeProxy" int, int64, var ; res = CoDecodeProxy(dwClientPid, ui64ProxyAddress, pServerInformation) ; dwClientPid : DWORD -> "int" ; ui64ProxyAddress : ULONGLONG -> "int64" ; pServerInformation : ServerInformation* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。#uselib "OLE32.dll" #cfunc global CoDecodeProxy "CoDecodeProxy" int, int64, sptr ; res = CoDecodeProxy(dwClientPid, ui64ProxyAddress, varptr(pServerInformation)) ; dwClientPid : DWORD -> "int" ; ui64ProxyAddress : ULONGLONG -> "int64" ; pServerInformation : ServerInformation* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
出力引数:
; HRESULT CoDecodeProxy(DWORD dwClientPid, ULONGLONG ui64ProxyAddress, ServerInformation* pServerInformation) #uselib "OLE32.dll" #cfunc global CoDecodeProxy "CoDecodeProxy" int, int64, var ; res = CoDecodeProxy(dwClientPid, ui64ProxyAddress, pServerInformation) ; dwClientPid : DWORD -> "int" ; ui64ProxyAddress : ULONGLONG -> "int64" ; pServerInformation : ServerInformation* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT CoDecodeProxy(DWORD dwClientPid, ULONGLONG ui64ProxyAddress, ServerInformation* pServerInformation) #uselib "OLE32.dll" #cfunc global CoDecodeProxy "CoDecodeProxy" int, int64, intptr ; res = CoDecodeProxy(dwClientPid, ui64ProxyAddress, varptr(pServerInformation)) ; dwClientPid : DWORD -> "int" ; ui64ProxyAddress : ULONGLONG -> "int64" ; pServerInformation : ServerInformation* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ole32 = windows.NewLazySystemDLL("OLE32.dll")
procCoDecodeProxy = ole32.NewProc("CoDecodeProxy")
)
// dwClientPid (DWORD), ui64ProxyAddress (ULONGLONG), pServerInformation (ServerInformation* out)
r1, _, err := procCoDecodeProxy.Call(
uintptr(dwClientPid),
uintptr(ui64ProxyAddress),
uintptr(pServerInformation),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CoDecodeProxy(
dwClientPid: DWORD; // DWORD
ui64ProxyAddress: UInt64; // ULONGLONG
pServerInformation: Pointer // ServerInformation* out
): Integer; stdcall;
external 'OLE32.dll' name 'CoDecodeProxy';result := DllCall("OLE32\CoDecodeProxy"
, "UInt", dwClientPid ; DWORD
, "Int64", ui64ProxyAddress ; ULONGLONG
, "Ptr", pServerInformation ; ServerInformation* out
, "Int") ; return: HRESULT●CoDecodeProxy(dwClientPid, ui64ProxyAddress, pServerInformation) = DLL("OLE32.dll", "int CoDecodeProxy(dword, qword, void*)")
# 呼び出し: CoDecodeProxy(dwClientPid, ui64ProxyAddress, pServerInformation)
# dwClientPid : DWORD -> "dword"
# ui64ProxyAddress : ULONGLONG -> "qword"
# pServerInformation : ServerInformation* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。