//FastMM4, ClientAPI in '..\Common\ClientAPI.pas', ClientType in '..\Common\ClientType.pas', PlugMain in 'PlugMain.pas'; function CInit(ClientAPI: pTClientAPI; APISize: Integer): Integer; stdcall; begin if APISize <> SizeOf(TClientAPI) then begin //大小不一样退出 Result := SizeOf(TClientAPI); Exit; end; ListAPI := ClientAPI.ListAPI; StringListAPI := ClientAPI.StringListAPI; TextureAPI := ClientAPI.TextureAPI; ImagesAPI := ClientAPI.ImagesAPI; DControlAPI := ClientAPI.InterfaceAPI.DControl; DWindowAPI := ClientAPI.InterfaceAPI.DWindow; DButtonAPI := ClientAPI.InterfaceAPI.DButton; DEditAPI := ClientAPI.InterfaceAPI.DEdit; DGridAPI := ClientAPI.InterfaceAPI.DGrid; DComboBoxAPI := ClientAPI.InterfaceAPI.DComboBox; DPopupMenuAPI := ClientAPI.InterfaceAPI.DPopupMenu; DrawAPI := ClientAPI.DrawAPI; ActorAPI := ClientAPI.ActorAPI; SocketAPI := ClientAPI.SocketAPI; HookAPI := ClientAPI.HookAPI; GameAPI := ClientAPI.GameAPI; GameInterfaceAPI := ClientAPI.GameInterfaceAPI; //-------------------------------------------------------------- InitPlug; Result := SizeOf(TClientAPI); end; procedure CUnInit(); stdcall; begin UnInitPlug; end; exports CInit, CUnInit; begin end.
时间: 2023-06-20 08:05:21 浏览: 130
FastMM497.zip_FastMM4_delphi 内存_fastmm
这段代码是一个 Delphi 的 DLL 插件,其中包含了 CInit 和 CUnInit 两个函数,用于初始化和销毁插件。在初始化时,它会检查传递进来的 ClientAPI 结构体的大小是否符合预期,然后将其中的各种接口函数指针存储到全局变量中,以便在后续的操作中使用。在最后,它还通过 exports 关键字将这两个函数导出,以便其他程序可以调用它们。
阅读全文