⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 herclib.pas

📁 delphi的源代码:查找通信设备的mac地址
💻 PAS
📖 第 1 页 / 共 2 页
字号:
  GetNVRamType: function(DevID: LongWord; NVRamType: PLongWord): LongWord; stdcall;
  GetNVRamTypeNic: function(NICID: LongWord; NVRamType: PLongWord): LongWord; stdcall;
  GetFlashInfo: function(DevID: LongWord; FlashInfo: PFlashInfoRec): LongWord; stdcall;
  MD5Hash: function(Data: PChar; Result: PByte): LongWord; stdcall;
  GetSpeed: function(Buffer: Pointer; BufSize: LongWord; ToneMapEntryIndex: LongWord; Speed: PLongWord): LongWord; stdcall;
  GetStatistics: function(DevID: LongWord; Statistics: PStatisticsRec): LongWord; stdcall;

  GetSEInfo: function(DevID: LongWord): LongWord; stdcall;
  GetSEValue: function(ToneIndex: LongWord; Value: PByte): LongWord; stdcall;
  GetTEInfo: function(DevID: LongWord): LongWord; stdcall;
  GetTEValue: function(ToneIndex: LongWord; Value: PByte): LongWord; stdcall;
  WriteFirmware: function(DevID: LongWord; FileName: PChar): LongWord; stdcall;

  GetToneMapTable: function(DevID: LongWord; Buffer: Pointer; BufSize: PLongWord): LongWord; stdcall;
  GetToneMapEntryList: function(Buffer: Pointer; BufSize: LongWord; ToneMapEntryListStr: PChar; Len: PLongWord): LongWord; stdcall;
  GetToneFlag: function(Buffer: Pointer; BufSize: LongWord; ToneMapEntryIndex: LongWord; ToneIndex: LongWord; Flag: PLongWord): LongWord; stdcall;
  GetToneMapEntryInfo: function(Buffer: Pointer; BufSize: LongWord; ToneMapEntryIndex: LongWord; ToneMapEntryInfo: PToneMapEntryInfoRec): LongWord; stdcall;

  ListNiCard: function(NiCardListStr: PChar; Len: PLongWord; Count: PLongWord): LongWord; stdcall;
  WriteFlashNic: function(NICID: LongWord; FileName: PChar): LongWord; stdcall;
  VerifyFlashNic: function(NICID: LongWord; FileName: PChar): LongWord; stdcall;
  SetConfigNic: function(NICID: LongWord; DeviceConfig: PDeviceConfigRec): LongWord; stdcall;
  GetConfigNic: function(NICID: LongWord; DeviceConfig: PDeviceConfigRec): LongWord; stdcall;

  Eload: function(NICID: LongWord; PebPromFileName: PChar; PebDataFileName: PChar; MacPromFileName: PChar; MacDataFileName: PChar): LongWord; stdcall;
  DetectDevice: function(NICID: LongWord): LongWord; stdcall;
  Reset: function(NICID: LongWord): LongWord; stdcall;

  GetNICIDFromDeviceID: function(DevID: LongWord; NICID: PLongWord): LongWord; stdcall;

  GetThreshold: function(NICID: LongWord; Threshold: PThresholdRec): LongWord; stdcall;
  ReadMemoryValue: function(DevID: LongWord; WType: Byte; High: Byte; Low: Byte; Length: Byte; Data: PByte): LongWord; stdcall;
  ReadMemoryValueNic: function(NICID: LongWord; WType: Byte; High: Byte; Low: Byte; Length: Byte; Data: PByte): LongWord; stdcall;
  WriteMemoryValue: function(DevID: LongWord; WType: Byte; High: Byte; Low: Byte; Length: Byte; Data: PByte): LongWord; stdcall;
  WriteMemoryValueNic: function(NICID: LongWord; WType: Byte; High: Byte; Low: Byte; Length: Byte; Data: PByte): LongWord; stdcall;

  UpdateTonemapTableNic: function(NICID: LongWord): LongWord; stdcall;
  GetTonemapTableNic: function(NICID: LongWord; Buffer: Pointer; BufSize: PLongWord): LongWord; stdcall;

  InitContainer: function(ContainerType: LongWord): LongWord; stdcall;
  ListDevice: function(Device: PDeviceRec; DeviceNum: PLongWord): LongWord; stdcall;
  ListDeviceStr: function(DataStr: PChar; StrLen: PLongWord; DeviceNum: PLongWord): LongWord; stdcall;
  ListNiCardStr: function(NiCardList: PChar; Len: PLongWord; Count: PLongWord): LongWord; stdcall;
  EraseFirmwareNic: function(NiCardID: LongWord): LongWord; stdcall;
  SetDevName: function(FileName: PChar; MacAddr: PByte; DevName: PChar): LongWord; stdcall;
  GetDevName: function(FileName: PChar; MacAddr: PByte; DevName: PChar; Len: PLongWord): LongWord; stdcall;
  SetLocalKey: function(DeviceID: LongWord; Password: PChar): LongWord; stdcall;
  SetRemoteKey: function(DeviceID: LongWord; Password: PChar; RemoteID: PChar; RemoteMac: PByte): LongWord; stdcall;
  GetPowerdownTimeout: function(DeviceID: LongWord; Value: PByte): LongWord; stdcall;
  SetPowerdownTimeout: function(DeviceID: LongWord; Value: Byte): LongWord; stdcall;
  SetPriorityNic: function(NiCardID: LongWord; VlanPriority: Byte; Value: Byte): LongWord; stdcall;
  GetEstimativeSpeed: function(ModType: LongWord; FECRate: LongWord; OpenedToneCount: LongWord; Speed: PDouble): LongWord; stdcall;
  DLLLoaded: Boolean = False;

implementation

uses
  SysUtils, Forms;

var
  SaveExit: pointer;
  DLLHandle: THandle;
  ErrorMode: Integer;

  procedure NewExit; far;
  begin
    ExitProc := SaveExit;
    FreeLibrary(DLLHandle)
  end;

procedure LoadDLL;
begin
  if DLLLoaded then Exit;

  ErrorMode := SetErrorMode($8000{SEM_NoOpenFileErrorBox});
  DLLHandle := LoadLibrary(PChar(ExtractFilePath(Application.ExeName) + 'HercLib.dll'));
  if DLLHandle >= 32 then
  begin
    DLLLoaded := True;
    SaveExit := ExitProc;
    ExitProc := @NewExit;

    @ScanDevice := GetProcAddress(DLLHandle, 'ScanDevice');
    Assert(@ScanDevice <> nil);
    @ScanDeviceEx := GetProcAddress(DLLHandle, 'ScanDeviceEx');
    Assert(@ScanDevice <> nil);
    @SetScanProgressCallback := GetProcAddress(DLLHandle, 'SetScanProgressCallback');
    Assert(@SetScanProgressCallback <> nil);
    @WriteFlash := GetProcAddress(DLLHandle, 'WriteFlash');
    Assert(@WriteFlash <> nil);
    @SetFlashProgressCallback := GetProcAddress(DLLHandle, 'SetFlashProgressCallback');
    Assert(@SetFlashProgressCallback <> nil);
    @GetConfig := GetProcAddress(DLLHandle, 'GetConfig');
    Assert(@GetConfig <> nil);
    @SetConfig := GetProcAddress(DLLHandle, 'SetConfig');
    Assert(@SetConfig <> nil);
    @ReadFlash := GetProcAddress(DLLHandle, 'ReadFlash');
    Assert(@ReadFlash <> nil);
    @VerifyFlash := GetProcAddress(DLLHandle, 'VerifyFlash');
    Assert(@VerifyFlash <> nil);
    @GetNVRamType := GetProcAddress(DLLHandle, 'GetNVRamType');
    Assert(@GetNVRamType <> nil);
    @GetNVRamTypeNic := GetProcAddress(DLLHandle, 'GetNVRamTypeNic');
    Assert(@GetNVRamTypeNic <> nil);
    @GetFlashInfo := GetProcAddress(DLLHandle, 'GetFlashInfo');
    Assert(@GetFlashInfo <> nil);
    @MD5Hash := GetProcAddress(DLLHandle, 'MD5Hash');
    Assert(@MD5Hash <> nil);
    @GetSpeed := GetProcAddress(DLLHandle, 'GetSpeed');
    Assert(@GetSpeed <> nil);
    @GetStatistics := GetProcAddress(DLLHandle, 'GetStatistics');
    Assert(@GetStatistics <> nil);

    @GetSEInfo := GetProcAddress(DLLHandle, 'GetSEInfo');
    Assert(@GetSEInfo <> nil);
    @GetSEValue := GetProcAddress(DLLHandle, 'GetSEValue');
    Assert(@GetSEValue <> nil);
    @GetTEInfo := GetProcAddress(DLLHandle, 'GetTEInfo');
    Assert(@GetTEInfo <> nil);
    @GetTEValue := GetProcAddress(DLLHandle, 'GetTEValue');
    Assert(@GetTEValue <> nil);
    @WriteFirmware := GetProcAddress(DLLHandle, 'WriteFirmware');
    Assert(@WriteFirmware <> nil);

    @GetToneMapTable := GetProcAddress(DLLHandle, 'GetTonemapTable');
    Assert(@GetToneMapTable <> nil);
    @GetToneMapEntryList := GetProcAddress(DLLHandle, 'GetTonemapEntryList');
    Assert(@GetToneMapEntryList <> nil);
    @GetToneFlag := GetProcAddress(DLLHandle, 'GetToneFlag');
    Assert(@GetToneFlag <> nil);
    @GetToneMapEntryInfo := GetProcAddress(DLLHandle, 'GetTonemapEntryInfo');
    Assert(@GetToneMapEntryInfo <> nil);

    @ListNiCard := GetProcAddress(DLLHandle, 'ListNiCard');
    Assert(@ListNiCard <> nil);
    @WriteFlashNic := GetProcAddress(DLLHandle, 'WriteFlashNic');
    Assert(@WriteFlashNic <> nil);
    @VerifyFlashNic := GetProcAddress(DLLHandle, 'VerifyFlashNic');
    Assert(@VerifyFlashNic <> nil);
    @SetConfigNic := GetProcAddress(DLLHandle, 'SetConfigNic');
    Assert(@SetConfigNic <> nil);
    @GetConfigNic := GetProcAddress(DLLHandle, 'GetConfigNic');
    Assert(@GetConfigNic <> nil);

    @Eload := GetProcAddress(DLLHandle, 'Eload');
    Assert(@Eload <> nil);
    @DetectDevice := GetProcAddress(DLLHandle, 'DetectDevice');
    Assert(@DetectDevice <> nil);
    @Reset := GetProcAddress(DLLHandle, 'Reset');
    Assert(@Reset <> nil);

    @GetNICIDFromDeviceID := GetProcAddress(DLLHandle, 'GetNICIDFromDeviceID');
    Assert(@GetNICIDFromDeviceID <> nil);

    @GetThreshold := GetProcAddress(DLLHandle, 'GetThreshold');
    Assert(@GetThreshold <> nil);
    @ReadMemoryValue := GetProcAddress(DLLHandle, 'ReadMemoryValue');
    Assert(@ReadMemoryValue <> nil);
    @ReadMemoryValueNic := GetProcAddress(DLLHandle, 'ReadMemoryValueNic');
    Assert(@ReadMemoryValueNic <> nil);
    @WriteMemoryValue := GetProcAddress(DLLHandle, 'WriteMemoryValue');
    Assert(@WriteMemoryValue <> nil);
    @WriteMemoryValueNic := GetProcAddress(DLLHandle, 'WriteMemoryValueNic');
    Assert(@WriteMemoryValueNic <> nil);

    @UpdateTonemapTableNic := GetProcAddress(DLLHandle, 'UpdateTonemapTableNic');
    Assert(@UpdateTonemapTableNic <> nil);
    @GetTonemapTableNic := GetProcAddress(DLLHandle, 'GetTonemapTableNic');
    Assert(@GetTonemapTableNic <> nil);

    @InitContainer := GetProcAddress(DLLHandle, 'InitContainer');
    Assert(@InitContainer <> nil);
    @ListDevice := GetProcAddress(DLLHandle, 'ListDevice');
    Assert(@ListDevice <> nil);
    @ListDeviceStr := GetProcAddress(DLLHandle, 'ListDeviceStr');
    Assert(@ListDeviceStr <> nil);
    @ListNiCardStr := GetProcAddress(DLLHandle, 'ListNiCardStr');
    Assert(@ListNiCardStr <> nil);
    @EraseFirmwareNic := GetProcAddress(DLLHandle, 'EraseFirmwareNic');
    Assert(@EraseFirmwareNic <> nil);
    @SetDevName := GetProcAddress(DLLHandle, 'SetDevName');
    Assert(@SetDevName <> nil);
    @GetDevName := GetProcAddress(DLLHandle, 'GetDevName');
    Assert(@GetDevName <> nil);
    @SetLocalKey := GetProcAddress(DLLHandle, 'SetLocalKey');
    Assert(@SetLocalKey <> nil);
    @SetRemoteKey := GetProcAddress(DLLHandle, 'SetRemoteKey');
    Assert(@SetRemoteKey <> nil);
    @GetPowerdownTimeout := GetProcAddress(DLLHandle, 'GetPowerdownTimeout');
    Assert(@GetPowerdownTimeout <> nil);
    @SetPowerdownTimeout := GetProcAddress(DLLHandle, 'SetPowerdownTimeout');
    Assert(@SetPowerdownTimeout <> nil);
    @SetPriorityNic := GetProcAddress(DLLHandle, 'SetPriorityNic');
    Assert(@SetPriorityNic <> nil);
    @GetEstimativeSpeed := GetProcAddress(DLLHandle, 'GetEstimativeSpeed');
    Assert(@GetEstimativeSpeed <> nil);

  end else
  begin
    DLLLoaded := False;
  end;

  SetErrorMode(ErrorMode)
end;

begin
  LoadDLL;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -