ホーム › System.DistributedTransactionCoordinator › DtcGetTransactionManagerExW
DtcGetTransactionManagerExW
関数オプションを指定しDTCトランザクションマネージャーを取得する(Unicode版)。
シグネチャ
// XOLEHLP.dll (Unicode / -W)
#include <windows.h>
HRESULT DtcGetTransactionManagerExW(
LPWSTR i_pwszHost, // optional
LPWSTR i_pwszTmName, // optional
const GUID* i_riid,
DWORD i_grfOptions,
void* i_pvConfigParams,
void** o_ppvObject
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| i_pwszHost | LPWSTR | inoptional |
| i_pwszTmName | LPWSTR | inoptional |
| i_riid | GUID* | in |
| i_grfOptions | DWORD | in |
| i_pvConfigParams | void* | inout |
| o_ppvObject | void** | inout |
戻り値の型: HRESULT
各言語での呼び出し定義
// XOLEHLP.dll (Unicode / -W)
#include <windows.h>
HRESULT DtcGetTransactionManagerExW(
LPWSTR i_pwszHost, // optional
LPWSTR i_pwszTmName, // optional
const GUID* i_riid,
DWORD i_grfOptions,
void* i_pvConfigParams,
void** o_ppvObject
);[DllImport("XOLEHLP.dll", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern int DtcGetTransactionManagerExW(
[MarshalAs(UnmanagedType.LPWStr)] string i_pwszHost, // LPWSTR optional
[MarshalAs(UnmanagedType.LPWStr)] string i_pwszTmName, // LPWSTR optional
ref Guid i_riid, // GUID*
uint i_grfOptions, // DWORD
IntPtr i_pvConfigParams, // void* in/out
IntPtr o_ppvObject // void** in/out
);<DllImport("XOLEHLP.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function DtcGetTransactionManagerExW(
<MarshalAs(UnmanagedType.LPWStr)> i_pwszHost As String, ' LPWSTR optional
<MarshalAs(UnmanagedType.LPWStr)> i_pwszTmName As String, ' LPWSTR optional
ByRef i_riid As Guid, ' GUID*
i_grfOptions As UInteger, ' DWORD
i_pvConfigParams As IntPtr, ' void* in/out
o_ppvObject As IntPtr ' void** in/out
) As Integer
End Function' i_pwszHost : LPWSTR optional
' i_pwszTmName : LPWSTR optional
' i_riid : GUID*
' i_grfOptions : DWORD
' i_pvConfigParams : void* in/out
' o_ppvObject : void** in/out
Declare PtrSafe Function DtcGetTransactionManagerExW Lib "xolehlp" ( _
ByVal i_pwszHost As LongPtr, _
ByVal i_pwszTmName As LongPtr, _
ByVal i_riid As LongPtr, _
ByVal i_grfOptions As Long, _
ByVal i_pvConfigParams As LongPtr, _
ByVal o_ppvObject As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DtcGetTransactionManagerExW = ctypes.cdll.xolehlp.DtcGetTransactionManagerExW
DtcGetTransactionManagerExW.restype = ctypes.c_int
DtcGetTransactionManagerExW.argtypes = [
wintypes.LPCWSTR, # i_pwszHost : LPWSTR optional
wintypes.LPCWSTR, # i_pwszTmName : LPWSTR optional
ctypes.c_void_p, # i_riid : GUID*
wintypes.DWORD, # i_grfOptions : DWORD
ctypes.POINTER(None), # i_pvConfigParams : void* in/out
ctypes.c_void_p, # o_ppvObject : void** in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('XOLEHLP.dll')
DtcGetTransactionManagerExW = Fiddle::Function.new(
lib['DtcGetTransactionManagerExW'],
[
Fiddle::TYPE_VOIDP, # i_pwszHost : LPWSTR optional
Fiddle::TYPE_VOIDP, # i_pwszTmName : LPWSTR optional
Fiddle::TYPE_VOIDP, # i_riid : GUID*
-Fiddle::TYPE_INT, # i_grfOptions : DWORD
Fiddle::TYPE_VOIDP, # i_pvConfigParams : void* in/out
Fiddle::TYPE_VOIDP, # o_ppvObject : void** in/out
],
Fiddle::TYPE_INT, Fiddle::Function::CDECL)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "xolehlp")]
extern "C" {
fn DtcGetTransactionManagerExW(
i_pwszHost: *mut u16, // LPWSTR optional
i_pwszTmName: *mut u16, // LPWSTR optional
i_riid: *const GUID, // GUID*
i_grfOptions: u32, // DWORD
i_pvConfigParams: *mut (), // void* in/out
o_ppvObject: *mut *mut () // void** in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("XOLEHLP.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int DtcGetTransactionManagerExW([MarshalAs(UnmanagedType.LPWStr)] string i_pwszHost, [MarshalAs(UnmanagedType.LPWStr)] string i_pwszTmName, ref Guid i_riid, uint i_grfOptions, IntPtr i_pvConfigParams, IntPtr o_ppvObject);
"@
$api = Add-Type -MemberDefinition $sig -Name 'XOLEHLP_DtcGetTransactionManagerExW' -Namespace Win32 -PassThru
# $api::DtcGetTransactionManagerExW(i_pwszHost, i_pwszTmName, i_riid, i_grfOptions, i_pvConfigParams, o_ppvObject)#uselib "XOLEHLP.dll"
#func global DtcGetTransactionManagerExW "DtcGetTransactionManagerExW" wptr, wptr, wptr, wptr, wptr, wptr
; DtcGetTransactionManagerExW i_pwszHost, i_pwszTmName, varptr(i_riid), i_grfOptions, i_pvConfigParams, o_ppvObject ; 戻り値は stat
; i_pwszHost : LPWSTR optional -> "wptr"
; i_pwszTmName : LPWSTR optional -> "wptr"
; i_riid : GUID* -> "wptr"
; i_grfOptions : DWORD -> "wptr"
; i_pvConfigParams : void* in/out -> "wptr"
; o_ppvObject : void** in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "XOLEHLP.dll" #cfunc global DtcGetTransactionManagerExW "DtcGetTransactionManagerExW" wstr, wstr, var, int, sptr, sptr ; res = DtcGetTransactionManagerExW(i_pwszHost, i_pwszTmName, i_riid, i_grfOptions, i_pvConfigParams, o_ppvObject) ; i_pwszHost : LPWSTR optional -> "wstr" ; i_pwszTmName : LPWSTR optional -> "wstr" ; i_riid : GUID* -> "var" ; i_grfOptions : DWORD -> "int" ; i_pvConfigParams : void* in/out -> "sptr" ; o_ppvObject : void** in/out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "XOLEHLP.dll" #cfunc global DtcGetTransactionManagerExW "DtcGetTransactionManagerExW" wstr, wstr, sptr, int, sptr, sptr ; res = DtcGetTransactionManagerExW(i_pwszHost, i_pwszTmName, varptr(i_riid), i_grfOptions, i_pvConfigParams, o_ppvObject) ; i_pwszHost : LPWSTR optional -> "wstr" ; i_pwszTmName : LPWSTR optional -> "wstr" ; i_riid : GUID* -> "sptr" ; i_grfOptions : DWORD -> "int" ; i_pvConfigParams : void* in/out -> "sptr" ; o_ppvObject : void** in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT DtcGetTransactionManagerExW(LPWSTR i_pwszHost, LPWSTR i_pwszTmName, GUID* i_riid, DWORD i_grfOptions, void* i_pvConfigParams, void** o_ppvObject) #uselib "XOLEHLP.dll" #cfunc global DtcGetTransactionManagerExW "DtcGetTransactionManagerExW" wstr, wstr, var, int, intptr, intptr ; res = DtcGetTransactionManagerExW(i_pwszHost, i_pwszTmName, i_riid, i_grfOptions, i_pvConfigParams, o_ppvObject) ; i_pwszHost : LPWSTR optional -> "wstr" ; i_pwszTmName : LPWSTR optional -> "wstr" ; i_riid : GUID* -> "var" ; i_grfOptions : DWORD -> "int" ; i_pvConfigParams : void* in/out -> "intptr" ; o_ppvObject : void** in/out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT DtcGetTransactionManagerExW(LPWSTR i_pwszHost, LPWSTR i_pwszTmName, GUID* i_riid, DWORD i_grfOptions, void* i_pvConfigParams, void** o_ppvObject) #uselib "XOLEHLP.dll" #cfunc global DtcGetTransactionManagerExW "DtcGetTransactionManagerExW" wstr, wstr, intptr, int, intptr, intptr ; res = DtcGetTransactionManagerExW(i_pwszHost, i_pwszTmName, varptr(i_riid), i_grfOptions, i_pvConfigParams, o_ppvObject) ; i_pwszHost : LPWSTR optional -> "wstr" ; i_pwszTmName : LPWSTR optional -> "wstr" ; i_riid : GUID* -> "intptr" ; i_grfOptions : DWORD -> "int" ; i_pvConfigParams : void* in/out -> "intptr" ; o_ppvObject : void** in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
xolehlp = windows.NewLazySystemDLL("XOLEHLP.dll")
procDtcGetTransactionManagerExW = xolehlp.NewProc("DtcGetTransactionManagerExW")
)
// i_pwszHost (LPWSTR optional), i_pwszTmName (LPWSTR optional), i_riid (GUID*), i_grfOptions (DWORD), i_pvConfigParams (void* in/out), o_ppvObject (void** in/out)
r1, _, err := procDtcGetTransactionManagerExW.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(i_pwszHost))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(i_pwszTmName))),
uintptr(i_riid),
uintptr(i_grfOptions),
uintptr(i_pvConfigParams),
uintptr(o_ppvObject),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction DtcGetTransactionManagerExW(
i_pwszHost: PWideChar; // LPWSTR optional
i_pwszTmName: PWideChar; // LPWSTR optional
i_riid: PGUID; // GUID*
i_grfOptions: DWORD; // DWORD
i_pvConfigParams: Pointer; // void* in/out
o_ppvObject: Pointer // void** in/out
): Integer; cdecl;
external 'XOLEHLP.dll' name 'DtcGetTransactionManagerExW';result := DllCall("XOLEHLP\DtcGetTransactionManagerExW"
, "WStr", i_pwszHost ; LPWSTR optional
, "WStr", i_pwszTmName ; LPWSTR optional
, "Ptr", i_riid ; GUID*
, "UInt", i_grfOptions ; DWORD
, "Ptr", i_pvConfigParams ; void* in/out
, "Ptr", o_ppvObject ; void** in/out
, "Cdecl Int") ; return: HRESULT●DtcGetTransactionManagerExW(i_pwszHost, i_pwszTmName, i_riid, i_grfOptions, i_pvConfigParams, o_ppvObject) = DLL("XOLEHLP.dll", "int DtcGetTransactionManagerExW(char*, char*, void*, dword, void*, void*)")
# 呼び出し: DtcGetTransactionManagerExW(i_pwszHost, i_pwszTmName, i_riid, i_grfOptions, i_pvConfigParams, o_ppvObject)
# i_pwszHost : LPWSTR optional -> "char*"
# i_pwszTmName : LPWSTR optional -> "char*"
# i_riid : GUID* -> "void*"
# i_grfOptions : DWORD -> "dword"
# i_pvConfigParams : void* in/out -> "void*"
# o_ppvObject : void** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。