delphi 动态调用API
发布时间:2020-12-15 09:55:03 所属栏目:大数据 来源:网络整理
导读:好处没有这个API 也可以启动程序只是调用会出错. function __IsNativeVhdBoot: Boolean;type TIsNativeVhdBoot = function( NativeVhdBoot: pBOOL ): BOOL; stdcall;var bNativeVhdBoot: pBOOL; NativeVhdBoot : TIsNativeVhdBoot;begin Result := False; Na
好处没有这个API 也可以启动程序只是调用会出错. function __IsNativeVhdBoot: Boolean; type TIsNativeVhdBoot = function( NativeVhdBoot: pBOOL ): BOOL; stdcall; var bNativeVhdBoot: pBOOL; NativeVhdBoot : TIsNativeVhdBoot; begin Result := False; NativeVhdBoot := GetProcAddress(GetModuleHandle(kernel32),‘IsNativeVhdBoot‘); if (@NativeVhdBoot <> nil) then begin if not NativeVhdBoot(bNativeVhdBoot) then RaiseLastOSError; Result := bNativeVhdBoot^; end else RaiseLastOSError; end;
固态调用 (没有这个API启动会失败) function IsNativeVhdBoot(NativeVhdBoot:PBOOL):BOOL; external Kernel32 name ‘IsNativeVhdBoot‘; function _IsNativeVhdBoot:Boolean; var pB:PBOOL; begin Result := False; if IsNativeVhdBoot(pB) then Result := pB^ else RaiseLastOSError; end; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |