Win32 API 日本語リファレンス
ホームSystem.Search › SQLCopyDesc

SQLCopyDesc

関数
記述子ハンドルの内容を別の記述子へ複写する。
DLLODBC32.dll呼出規約winapi

シグネチャ

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

SHORT SQLCopyDesc(
    void* SourceDescHandle,
    void* TargetDescHandle
);

パラメーター

名前方向
SourceDescHandlevoid*inout
TargetDescHandlevoid*inout

戻り値の型: SHORT

各言語での呼び出し定義

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

SHORT SQLCopyDesc(
    void* SourceDescHandle,
    void* TargetDescHandle
);
[DllImport("ODBC32.dll", ExactSpelling = true)]
static extern short SQLCopyDesc(
    IntPtr SourceDescHandle,   // void* in/out
    IntPtr TargetDescHandle   // void* in/out
);
<DllImport("ODBC32.dll", ExactSpelling:=True)>
Public Shared Function SQLCopyDesc(
    SourceDescHandle As IntPtr,   ' void* in/out
    TargetDescHandle As IntPtr   ' void* in/out
) As Short
End Function
' SourceDescHandle : void* in/out
' TargetDescHandle : void* in/out
Declare PtrSafe Function SQLCopyDesc Lib "odbc32" ( _
    ByVal SourceDescHandle As LongPtr, _
    ByVal TargetDescHandle As LongPtr) As Integer
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SQLCopyDesc = ctypes.windll.odbc32.SQLCopyDesc
SQLCopyDesc.restype = ctypes.c_short
SQLCopyDesc.argtypes = [
    ctypes.POINTER(None),  # SourceDescHandle : void* in/out
    ctypes.POINTER(None),  # TargetDescHandle : void* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ODBC32.dll')
SQLCopyDesc = Fiddle::Function.new(
  lib['SQLCopyDesc'],
  [
    Fiddle::TYPE_VOIDP,  # SourceDescHandle : void* in/out
    Fiddle::TYPE_VOIDP,  # TargetDescHandle : void* in/out
  ],
  Fiddle::TYPE_SHORT)
#[link(name = "odbc32")]
extern "system" {
    fn SQLCopyDesc(
        SourceDescHandle: *mut (),  // void* in/out
        TargetDescHandle: *mut ()  // void* in/out
    ) -> i16;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ODBC32.dll")]
public static extern short SQLCopyDesc(IntPtr SourceDescHandle, IntPtr TargetDescHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ODBC32_SQLCopyDesc' -Namespace Win32 -PassThru
# $api::SQLCopyDesc(SourceDescHandle, TargetDescHandle)
#uselib "ODBC32.dll"
#func global SQLCopyDesc "SQLCopyDesc" sptr, sptr
; SQLCopyDesc SourceDescHandle, TargetDescHandle   ; 戻り値は stat
; SourceDescHandle : void* in/out -> "sptr"
; TargetDescHandle : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ODBC32.dll"
#cfunc global SQLCopyDesc "SQLCopyDesc" sptr, sptr
; res = SQLCopyDesc(SourceDescHandle, TargetDescHandle)
; SourceDescHandle : void* in/out -> "sptr"
; TargetDescHandle : void* in/out -> "sptr"
; SHORT SQLCopyDesc(void* SourceDescHandle, void* TargetDescHandle)
#uselib "ODBC32.dll"
#cfunc global SQLCopyDesc "SQLCopyDesc" intptr, intptr
; res = SQLCopyDesc(SourceDescHandle, TargetDescHandle)
; SourceDescHandle : void* in/out -> "intptr"
; TargetDescHandle : void* in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	odbc32 = windows.NewLazySystemDLL("ODBC32.dll")
	procSQLCopyDesc = odbc32.NewProc("SQLCopyDesc")
)

// SourceDescHandle (void* in/out), TargetDescHandle (void* in/out)
r1, _, err := procSQLCopyDesc.Call(
	uintptr(SourceDescHandle),
	uintptr(TargetDescHandle),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // SHORT
function SQLCopyDesc(
  SourceDescHandle: Pointer;   // void* in/out
  TargetDescHandle: Pointer   // void* in/out
): Smallint; stdcall;
  external 'ODBC32.dll' name 'SQLCopyDesc';
result := DllCall("ODBC32\SQLCopyDesc"
    , "Ptr", SourceDescHandle   ; void* in/out
    , "Ptr", TargetDescHandle   ; void* in/out
    , "Short")   ; return: SHORT
●SQLCopyDesc(SourceDescHandle, TargetDescHandle) = DLL("ODBC32.dll", "int SQLCopyDesc(void*, void*)")
# 呼び出し: SQLCopyDesc(SourceDescHandle, TargetDescHandle)
# SourceDescHandle : void* in/out -> "void*"
# TargetDescHandle : void* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。