小编eXX*_*tor的帖子

将 GlobalPlatform 从 C 转换为 Delphi - 访问冲突错误

我想在 Delphi 中使用kaoh Karsten Ohme的 GlobalPlatform.dll 。所以我尝试翻译标头,以便我可以在 Delphi 中使用 GlobalPlatform.dll。

我翻译的第一个是Connection.h,我将其上传到pastebin 这里
我翻译的第二个是Security.h,我将其上传到pastebin。

首先,我与该OPGP_establish_context函数建立了一个上下文,这似乎进展顺利,因为结果是 aOPGP_ERROR_STATUS_SUCCESS并且消息还指出“成功”。

但后来我尝试列出具有该OPGP_list_readers函数的读者,该函数也返回成功 - 但是当我尝试读取返回的名称时,我遇到了各种访问冲突(主要是在adress 00000000 and trying to read 00000000,但我的尝试之间存在差异)。

我的代码分配给按钮单击:

procedure TfrmFormatCard.Button1Click(Sender: TObject);
const
  BUFLEN = 1024;
var
  Status,
  Status2 : OPGP_ERROR_STATUS;
  Context : OPGP_CARD_CONTEXT;
  Names   : array [0..BUFLEN +1] of Char;
  Len     : DWord;
begin
  Context.libraryName    := 'gppcscconnectionplugin';
  Context.libraryVersion := '211';
  Status := OPGP_establish_context(Context);
  if Status.errorStatus = OPGP_ERROR_STATUS_SUCCESS then
  begin
    Len := …
Run Code Online (Sandbox Code Playgroud)

c++ delphi dll smartcard globalplatform

0
推荐指数
1
解决办法
118
查看次数

标签 统计

c++ ×1

delphi ×1

dll ×1

globalplatform ×1

smartcard ×1