ホーム › System.Search › SQLTablePrivilegesW
SQLTablePrivilegesW
関数指定テーブルに対するアクセス権限の一覧を返す(Unicode)。
シグネチャ
// ODBC32.dll (Unicode / -W)
#include <windows.h>
SHORT SQLTablePrivilegesW(
void* hstmt,
WORD* szCatalogName, // optional
SHORT cchCatalogName,
WORD* szSchemaName, // optional
SHORT cchSchemaName,
WORD* szTableName, // optional
SHORT cchTableName
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hstmt | void* | inout | ODBCのステートメントハンドル。テーブル権限の結果セットを返す。 |
| szCatalogName | WORD* | inoptional | 検索対象のカタログ名。NULL指定可。 |
| cchCatalogName | SHORT | in | szCatalogNameの文字数。SQL_NTSでNUL終端とみなす。 |
| szSchemaName | WORD* | inoptional | 検索対象のスキーマ名。NULLやパターンで絞り込む。 |
| cchSchemaName | SHORT | in | szSchemaNameの文字数。SQL_NTSでNUL終端とみなす。 |
| szTableName | WORD* | inoptional | 検索対象のテーブル名。NULLやパターンで絞り込む。 |
| cchTableName | SHORT | in | szTableNameの文字数。SQL_NTSでNUL終端とみなす。 |
戻り値の型: SHORT
各言語での呼び出し定義
// ODBC32.dll (Unicode / -W)
#include <windows.h>
SHORT SQLTablePrivilegesW(
void* hstmt,
WORD* szCatalogName, // optional
SHORT cchCatalogName,
WORD* szSchemaName, // optional
SHORT cchSchemaName,
WORD* szTableName, // optional
SHORT cchTableName
);[DllImport("ODBC32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern short SQLTablePrivilegesW(
IntPtr hstmt, // void* in/out
IntPtr szCatalogName, // WORD* optional
short cchCatalogName, // SHORT
IntPtr szSchemaName, // WORD* optional
short cchSchemaName, // SHORT
IntPtr szTableName, // WORD* optional
short cchTableName // SHORT
);<DllImport("ODBC32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function SQLTablePrivilegesW(
hstmt As IntPtr, ' void* in/out
szCatalogName As IntPtr, ' WORD* optional
cchCatalogName As Short, ' SHORT
szSchemaName As IntPtr, ' WORD* optional
cchSchemaName As Short, ' SHORT
szTableName As IntPtr, ' WORD* optional
cchTableName As Short ' SHORT
) As Short
End Function' hstmt : void* in/out
' szCatalogName : WORD* optional
' cchCatalogName : SHORT
' szSchemaName : WORD* optional
' cchSchemaName : SHORT
' szTableName : WORD* optional
' cchTableName : SHORT
Declare PtrSafe Function SQLTablePrivilegesW Lib "odbc32" ( _
ByVal hstmt As LongPtr, _
ByVal szCatalogName As LongPtr, _
ByVal cchCatalogName As Integer, _
ByVal szSchemaName As LongPtr, _
ByVal cchSchemaName As Integer, _
ByVal szTableName As LongPtr, _
ByVal cchTableName As Integer) As Integer
' 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
SQLTablePrivilegesW = ctypes.windll.odbc32.SQLTablePrivilegesW
SQLTablePrivilegesW.restype = ctypes.c_short
SQLTablePrivilegesW.argtypes = [
ctypes.POINTER(None), # hstmt : void* in/out
ctypes.POINTER(ctypes.c_ushort), # szCatalogName : WORD* optional
ctypes.c_short, # cchCatalogName : SHORT
ctypes.POINTER(ctypes.c_ushort), # szSchemaName : WORD* optional
ctypes.c_short, # cchSchemaName : SHORT
ctypes.POINTER(ctypes.c_ushort), # szTableName : WORD* optional
ctypes.c_short, # cchTableName : SHORT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ODBC32.dll')
SQLTablePrivilegesW = Fiddle::Function.new(
lib['SQLTablePrivilegesW'],
[
Fiddle::TYPE_VOIDP, # hstmt : void* in/out
Fiddle::TYPE_VOIDP, # szCatalogName : WORD* optional
Fiddle::TYPE_SHORT, # cchCatalogName : SHORT
Fiddle::TYPE_VOIDP, # szSchemaName : WORD* optional
Fiddle::TYPE_SHORT, # cchSchemaName : SHORT
Fiddle::TYPE_VOIDP, # szTableName : WORD* optional
Fiddle::TYPE_SHORT, # cchTableName : SHORT
],
Fiddle::TYPE_SHORT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "odbc32")]
extern "system" {
fn SQLTablePrivilegesW(
hstmt: *mut (), // void* in/out
szCatalogName: *mut u16, // WORD* optional
cchCatalogName: i16, // SHORT
szSchemaName: *mut u16, // WORD* optional
cchSchemaName: i16, // SHORT
szTableName: *mut u16, // WORD* optional
cchTableName: i16 // SHORT
) -> i16;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ODBC32.dll", CharSet = CharSet.Unicode)]
public static extern short SQLTablePrivilegesW(IntPtr hstmt, IntPtr szCatalogName, short cchCatalogName, IntPtr szSchemaName, short cchSchemaName, IntPtr szTableName, short cchTableName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ODBC32_SQLTablePrivilegesW' -Namespace Win32 -PassThru
# $api::SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName)#uselib "ODBC32.dll"
#func global SQLTablePrivilegesW "SQLTablePrivilegesW" wptr, wptr, wptr, wptr, wptr, wptr, wptr
; SQLTablePrivilegesW hstmt, varptr(szCatalogName), cchCatalogName, varptr(szSchemaName), cchSchemaName, varptr(szTableName), cchTableName ; 戻り値は stat
; hstmt : void* in/out -> "wptr"
; szCatalogName : WORD* optional -> "wptr"
; cchCatalogName : SHORT -> "wptr"
; szSchemaName : WORD* optional -> "wptr"
; cchSchemaName : SHORT -> "wptr"
; szTableName : WORD* optional -> "wptr"
; cchTableName : SHORT -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "ODBC32.dll" #cfunc global SQLTablePrivilegesW "SQLTablePrivilegesW" sptr, var, int, var, int, var, int ; res = SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName) ; hstmt : void* in/out -> "sptr" ; szCatalogName : WORD* optional -> "var" ; cchCatalogName : SHORT -> "int" ; szSchemaName : WORD* optional -> "var" ; cchSchemaName : SHORT -> "int" ; szTableName : WORD* optional -> "var" ; cchTableName : SHORT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "ODBC32.dll" #cfunc global SQLTablePrivilegesW "SQLTablePrivilegesW" sptr, sptr, int, sptr, int, sptr, int ; res = SQLTablePrivilegesW(hstmt, varptr(szCatalogName), cchCatalogName, varptr(szSchemaName), cchSchemaName, varptr(szTableName), cchTableName) ; hstmt : void* in/out -> "sptr" ; szCatalogName : WORD* optional -> "sptr" ; cchCatalogName : SHORT -> "int" ; szSchemaName : WORD* optional -> "sptr" ; cchSchemaName : SHORT -> "int" ; szTableName : WORD* optional -> "sptr" ; cchTableName : SHORT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; SHORT SQLTablePrivilegesW(void* hstmt, WORD* szCatalogName, SHORT cchCatalogName, WORD* szSchemaName, SHORT cchSchemaName, WORD* szTableName, SHORT cchTableName) #uselib "ODBC32.dll" #cfunc global SQLTablePrivilegesW "SQLTablePrivilegesW" intptr, var, int, var, int, var, int ; res = SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName) ; hstmt : void* in/out -> "intptr" ; szCatalogName : WORD* optional -> "var" ; cchCatalogName : SHORT -> "int" ; szSchemaName : WORD* optional -> "var" ; cchSchemaName : SHORT -> "int" ; szTableName : WORD* optional -> "var" ; cchTableName : SHORT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; SHORT SQLTablePrivilegesW(void* hstmt, WORD* szCatalogName, SHORT cchCatalogName, WORD* szSchemaName, SHORT cchSchemaName, WORD* szTableName, SHORT cchTableName) #uselib "ODBC32.dll" #cfunc global SQLTablePrivilegesW "SQLTablePrivilegesW" intptr, intptr, int, intptr, int, intptr, int ; res = SQLTablePrivilegesW(hstmt, varptr(szCatalogName), cchCatalogName, varptr(szSchemaName), cchSchemaName, varptr(szTableName), cchTableName) ; hstmt : void* in/out -> "intptr" ; szCatalogName : WORD* optional -> "intptr" ; cchCatalogName : SHORT -> "int" ; szSchemaName : WORD* optional -> "intptr" ; cchSchemaName : SHORT -> "int" ; szTableName : WORD* optional -> "intptr" ; cchTableName : SHORT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
odbc32 = windows.NewLazySystemDLL("ODBC32.dll")
procSQLTablePrivilegesW = odbc32.NewProc("SQLTablePrivilegesW")
)
// hstmt (void* in/out), szCatalogName (WORD* optional), cchCatalogName (SHORT), szSchemaName (WORD* optional), cchSchemaName (SHORT), szTableName (WORD* optional), cchTableName (SHORT)
r1, _, err := procSQLTablePrivilegesW.Call(
uintptr(hstmt),
uintptr(szCatalogName),
uintptr(cchCatalogName),
uintptr(szSchemaName),
uintptr(cchSchemaName),
uintptr(szTableName),
uintptr(cchTableName),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // SHORTfunction SQLTablePrivilegesW(
hstmt: Pointer; // void* in/out
szCatalogName: Pointer; // WORD* optional
cchCatalogName: Smallint; // SHORT
szSchemaName: Pointer; // WORD* optional
cchSchemaName: Smallint; // SHORT
szTableName: Pointer; // WORD* optional
cchTableName: Smallint // SHORT
): Smallint; stdcall;
external 'ODBC32.dll' name 'SQLTablePrivilegesW';result := DllCall("ODBC32\SQLTablePrivilegesW"
, "Ptr", hstmt ; void* in/out
, "Ptr", szCatalogName ; WORD* optional
, "Short", cchCatalogName ; SHORT
, "Ptr", szSchemaName ; WORD* optional
, "Short", cchSchemaName ; SHORT
, "Ptr", szTableName ; WORD* optional
, "Short", cchTableName ; SHORT
, "Short") ; return: SHORT●SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName) = DLL("ODBC32.dll", "int SQLTablePrivilegesW(void*, void*, int, void*, int, void*, int)")
# 呼び出し: SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName)
# hstmt : void* in/out -> "void*"
# szCatalogName : WORD* optional -> "void*"
# cchCatalogName : SHORT -> "int"
# szSchemaName : WORD* optional -> "void*"
# cchSchemaName : SHORT -> "int"
# szTableName : WORD* optional -> "void*"
# cchTableName : SHORT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。const std = @import("std");
extern "odbc32" fn SQLTablePrivilegesW(
hstmt: ?*anyopaque, // void* in/out
szCatalogName: [*c]u16, // WORD* optional
cchCatalogName: i16, // SHORT
szSchemaName: [*c]u16, // WORD* optional
cchSchemaName: i16, // SHORT
szTableName: [*c]u16, // WORD* optional
cchTableName: i16 // SHORT
) callconv(std.os.windows.WINAPI) i16;
// Unicode(-W): UTF-16LE のヌル終端バッファ([*c]const u16)を渡す。proc SQLTablePrivilegesW(
hstmt: pointer, # void* in/out
szCatalogName: ptr uint16, # WORD* optional
cchCatalogName: int16, # SHORT
szSchemaName: ptr uint16, # WORD* optional
cchSchemaName: int16, # SHORT
szTableName: ptr uint16, # WORD* optional
cchTableName: int16 # SHORT
): int16 {.importc: "SQLTablePrivilegesW", stdcall, dynlib: "ODBC32.dll".}
# Unicode(-W): WideCString は newWideCString("...") で生成。pragma(lib, "odbc32");
extern(Windows)
short SQLTablePrivilegesW(
void* hstmt, // void* in/out
ushort* szCatalogName, // WORD* optional
short cchCatalogName, // SHORT
ushort* szSchemaName, // WORD* optional
short cchSchemaName, // SHORT
ushort* szTableName, // WORD* optional
short cchTableName // SHORT
);ccall((:SQLTablePrivilegesW, "ODBC32.dll"), stdcall, Int16,
(Ptr{Cvoid}, Ptr{UInt16}, Int16, Ptr{UInt16}, Int16, Ptr{UInt16}, Int16),
hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName)
# hstmt : void* in/out -> Ptr{Cvoid}
# szCatalogName : WORD* optional -> Ptr{UInt16}
# cchCatalogName : SHORT -> Int16
# szSchemaName : WORD* optional -> Ptr{UInt16}
# cchSchemaName : SHORT -> Int16
# szTableName : WORD* optional -> Ptr{UInt16}
# cchTableName : SHORT -> Int16
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
# Unicode(-W): Cwstring には transcode(UInt16, "...") 等で UTF-16 を渡す。local ffi = require("ffi")
ffi.cdef[[
int16_t SQLTablePrivilegesW(
void* hstmt,
uint16_t* szCatalogName,
int16_t cchCatalogName,
uint16_t* szSchemaName,
int16_t cchSchemaName,
uint16_t* szTableName,
int16_t cchTableName);
]]
local odbc32 = ffi.load("odbc32")
-- odbc32.SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName)
-- hstmt : void* in/out
-- szCatalogName : WORD* optional
-- cchCatalogName : SHORT
-- szSchemaName : WORD* optional
-- cchSchemaName : SHORT
-- szTableName : WORD* optional
-- cchTableName : SHORT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
-- Unicode(-W): uint16_t* には UTF-16LE のバッファ(ffi.new("uint16_t[?]", ...))を渡す。const koffi = require('koffi');
const lib = koffi.load('ODBC32.dll');
const SQLTablePrivilegesW = lib.func('__stdcall', 'SQLTablePrivilegesW', 'int16_t', ['void *', 'uint16_t *', 'int16_t', 'uint16_t *', 'int16_t', 'uint16_t *', 'int16_t']);
// SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName)
// hstmt : void* in/out -> 'void *'
// szCatalogName : WORD* optional -> 'uint16_t *'
// cchCatalogName : SHORT -> 'int16_t'
// szSchemaName : WORD* optional -> 'uint16_t *'
// cchSchemaName : SHORT -> 'int16_t'
// szTableName : WORD* optional -> 'uint16_t *'
// cchTableName : SHORT -> 'int16_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("ODBC32.dll", {
SQLTablePrivilegesW: { parameters: ["pointer", "pointer", "i16", "pointer", "i16", "pointer", "i16"], result: "i16" },
});
// lib.symbols.SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName)
// hstmt : void* in/out -> "pointer"
// szCatalogName : WORD* optional -> "pointer"
// cchCatalogName : SHORT -> "i16"
// szSchemaName : WORD* optional -> "pointer"
// cchSchemaName : SHORT -> "i16"
// szTableName : WORD* optional -> "pointer"
// cchTableName : SHORT -> "i16"
// 文字列は "buffer"。Unicode(-W) は new TextEncoder() ではなく UTF-16LE のバイト列(末尾に \x00\x00)を Uint8Array で渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int16_t SQLTablePrivilegesW(
void* hstmt,
uint16_t* szCatalogName,
int16_t cchCatalogName,
uint16_t* szSchemaName,
int16_t cchSchemaName,
uint16_t* szTableName,
int16_t cchTableName);
C, "ODBC32.dll");
// $ffi->SQLTablePrivilegesW(hstmt, szCatalogName, cchCatalogName, szSchemaName, cchSchemaName, szTableName, cchTableName);
// hstmt : void* in/out
// szCatalogName : WORD* optional
// cchCatalogName : SHORT
// szSchemaName : WORD* optional
// cchSchemaName : SHORT
// szTableName : WORD* optional
// cchTableName : SHORT
// 構造体/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 Odbc32 extends StdCallLibrary {
Odbc32 INSTANCE = Native.load("odbc32", Odbc32.class, W32APIOptions.UNICODE_OPTIONS);
short SQLTablePrivilegesW(
Pointer hstmt, // void* in/out
ShortByReference szCatalogName, // WORD* optional
short cchCatalogName, // SHORT
ShortByReference szSchemaName, // WORD* optional
short cchSchemaName, // SHORT
ShortByReference szTableName, // WORD* optional
short cchTableName // SHORT
);
}
// Unicode(-W): WString(入力)/char[](出力)で UTF-16 をマーシャリング。@[Link("odbc32")]
lib LibODBC32
fun SQLTablePrivilegesW = SQLTablePrivilegesW(
hstmt : Void*, # void* in/out
szCatalogName : UInt16*, # WORD* optional
cchCatalogName : Int16, # SHORT
szSchemaName : UInt16*, # WORD* optional
cchSchemaName : Int16, # SHORT
szTableName : UInt16*, # WORD* optional
cchTableName : Int16 # SHORT
) : Int16
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef SQLTablePrivilegesWNative = Int16 Function(Pointer<Void>, Pointer<Uint16>, Int16, Pointer<Uint16>, Int16, Pointer<Uint16>, Int16);
typedef SQLTablePrivilegesWDart = int Function(Pointer<Void>, Pointer<Uint16>, int, Pointer<Uint16>, int, Pointer<Uint16>, int);
final SQLTablePrivilegesW = DynamicLibrary.open('ODBC32.dll')
.lookupFunction<SQLTablePrivilegesWNative, SQLTablePrivilegesWDart>('SQLTablePrivilegesW');
// hstmt : void* in/out -> Pointer<Void>
// szCatalogName : WORD* optional -> Pointer<Uint16>
// cchCatalogName : SHORT -> Int16
// szSchemaName : WORD* optional -> Pointer<Uint16>
// cchSchemaName : SHORT -> Int16
// szTableName : WORD* optional -> Pointer<Uint16>
// cchTableName : SHORT -> Int16
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function SQLTablePrivilegesW(
hstmt: Pointer; // void* in/out
szCatalogName: Pointer; // WORD* optional
cchCatalogName: Smallint; // SHORT
szSchemaName: Pointer; // WORD* optional
cchSchemaName: Smallint; // SHORT
szTableName: Pointer; // WORD* optional
cchTableName: Smallint // SHORT
): Smallint; stdcall;
external 'ODBC32.dll' name 'SQLTablePrivilegesW';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "SQLTablePrivilegesW"
c_SQLTablePrivilegesW :: Ptr () -> Ptr Word16 -> Int16 -> Ptr Word16 -> Int16 -> Ptr Word16 -> Int16 -> IO Int16
-- hstmt : void* in/out -> Ptr ()
-- szCatalogName : WORD* optional -> Ptr Word16
-- cchCatalogName : SHORT -> Int16
-- szSchemaName : WORD* optional -> Ptr Word16
-- cchSchemaName : SHORT -> Int16
-- szTableName : WORD* optional -> Ptr Word16
-- cchTableName : SHORT -> Int16
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let sqltableprivilegesw =
foreign "SQLTablePrivilegesW"
((ptr void) @-> (ptr uint16_t) @-> int16_t @-> (ptr uint16_t) @-> int16_t @-> (ptr uint16_t) @-> int16_t @-> returning int16_t)
(* hstmt : void* in/out -> (ptr void) *)
(* szCatalogName : WORD* optional -> (ptr uint16_t) *)
(* cchCatalogName : SHORT -> int16_t *)
(* szSchemaName : WORD* optional -> (ptr uint16_t) *)
(* cchSchemaName : SHORT -> int16_t *)
(* szTableName : WORD* optional -> (ptr uint16_t) *)
(* cchTableName : SHORT -> int16_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library odbc32 (t "ODBC32.dll"))
(cffi:use-foreign-library odbc32)
(cffi:defcfun ("SQLTablePrivilegesW" sqltable-privileges-w :convention :stdcall) :int16
(hstmt :pointer) ; void* in/out
(sz-catalog-name :pointer) ; WORD* optional
(cch-catalog-name :int16) ; SHORT
(sz-schema-name :pointer) ; WORD* optional
(cch-schema-name :int16) ; SHORT
(sz-table-name :pointer) ; WORD* optional
(cch-table-name :int16)) ; SHORT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $SQLTablePrivilegesW = Win32::API::More->new('ODBC32',
'short SQLTablePrivilegesW(LPVOID hstmt, LPVOID szCatalogName, short cchCatalogName, LPVOID szSchemaName, short cchSchemaName, LPVOID szTableName, short cchTableName)');
# my $ret = $SQLTablePrivilegesW->Call($hstmt, $szCatalogName, $cchCatalogName, $szSchemaName, $cchSchemaName, $szTableName, $cchTableName);
# hstmt : void* in/out -> LPVOID
# szCatalogName : WORD* optional -> LPVOID
# cchCatalogName : SHORT -> short
# szSchemaName : WORD* optional -> LPVOID
# cchSchemaName : SHORT -> short
# szTableName : WORD* optional -> LPVOID
# cchTableName : SHORT -> short
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# Unicode(-W): LPCWSTR/LPWSTR は Win32::API が UTF-16 変換を行う。関連項目
文字セット違い
- f SQLTablePrivilegesA (ANSI版) — テーブルに対するアクセス権限の一覧を取得する。