我使用了一些代码形式http://wiki.tcl.tk/1197,但我认为它可能与传递Data_Blob有关,而不支持FFidl数据类型。
package require Ffidl
set handle [ffidl::symbol [file join C:/ Windows System32 crypt32.dll] CryptProtectData]
ffidl::callout CryptProtectData_callout {pointer-utf8 pointer-utf8 pointer-utf8 pointer-utf8 pointer-utf8 int pointer-utf8} int $handle stdcall
proc CryptProtectData {data} {
set value ""
if [CryptProtectData_callout $data NULL NULL 0 NULL 0 $value] {
puts $value
} else {
puts "crypt returned 0: $value"
return {}
}
}
CryptProtectData "hello how are you"