Delphi-PRAXiS
Seite 1 von 4  1 23     Letzte »    

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Gigabyte dll functions (https://www.delphipraxis.net/97485-gigabyte-dll-functions.html)

Razor 11. Aug 2007 01:29


Gigabyte dll functions
 
Easy Tune 4 Download
After compiling just drop the project in easy tune 4 directory and voila you have a temperature reading(or something else) program!


This function works 100% TESTED! :)
Delphi-Quellcode:
function tform1.GetCpuTemp: cardinal;
type
  LX_Get_CPUTempValue = function(pCpuTemp: Pointer): cardinal stdcall;
var
  hInstDll: THandle;
  Get_CPUTempValue: LX_Get_CPUTempValue;
  Pfad: AnsiString;
begin
  Result := 0;
  Pfad := ExtractFilePath(application.ExeName) + 'w83781d.dll';
  if FileExists(Pfad) then
  begin
    hInstDll := LoadLibrary(PChar(Pfad));
    if hInstDll <> 0 then
    try
      Get_CPUTempValue:= GetProcAddress(hInstDll, 'LX_Get_CPUTempValue');
      if Assigned(Get_CPUTempValue) then
        Get_CPUTempValue(Addr(Result));
    finally
      FreeLibrary(hInstDll);
    end;
  end;
end;

But this dosent work!Please tell me whats wrong?Also if somebody can write about other functions how to call them?
Thanks!

Delphi-Quellcode:
function ismotherboard: boolean;
type
  LX_IsGigaMainBoard = function(pIsGigaMainBoard: Pointer): boolean stdcall;
var
  hInstDll: THandle;
  IsGigaMainBoard: LX_IsGigaMainBoard;
  Pfad: AnsiString;
begin

  Pfad := ExtractFilePath(application.ExeName) + 'w83781d.dll';
  if FileExists(Pfad) then
  begin
    hInstDll := LoadLibrary(PChar(Pfad));
    if hInstDll <> 0 then
    try
      IsGigaMainBoard:= GetProcAddress(hInstDll, 'LX_IsGigaMainBoard');
      if Assigned(IsGigaMainBoard) then
        IsGigaMainBoard(Addr(Result));
    finally
      FreeLibrary(hInstDll);
    end;
  end;


W83781D.DLL exported functions

Delphi-Quellcode:
LX_Admin_PWD_Setting   
LX_COM1Control   
LX_COM2Control   
LX_FloppyControl   
LX_Get_CaseOpenStatus   
LX_Get_CPUFanCount   
LX_Get_CPUTempValue   
LX_Get_PowerFanValue   
LX_Get_SystemFanValue   
LX_Get_VoltageCPUValue   
LX_Get_VoltageP12Value   
LX_Get_VoltageP33Value   
LX_Get_VoltageP5Value   
LX_IsGigaMainBoard   
LX_IsMSIMainBoard   
LX_IsQDIMainBoard   
LX_ParallelControl   
LX_Password_Control_Request   
LX_User_PWD_Setting   
W_CaseO_Clear   
W_Get_Battery_Status   
W_Get_Beep_Status   
W_Get_CaseO_Status   
W_Get_Fan1_Status   
W_Get_Fan2_Status   
W_Get_Fan3_Status   
W_Get_FanCount   
W_Get_FanLoLimit   
W_Get_Status   
W_Get_Temp1_Status   
W_Get_Temp23_Status   
W_Get_Temp2_Status   
W_Get_Temp3_Status   
W_Get_TempLimitValue   
W_Get_TempValue   
W_Get_Version   
W_Get_VIDVcore   
W_Get_VIDVcore1   
W_Get_VIDVcore2   
W_Get_VIN0_Status   
W_Get_VIN1_Status   
W_Get_VIN2_Status   
W_Get_VIN3_Status   
W_Get_VIN4_Status   
W_Get_VIN5_Status   
W_Get_VIN6_Status   
W_Get_VIN7_Status   
W_Get_VINLimitValue   
W_Get_VINValue   
W_hua_inp   
W_hua_inpd   
W_hua_inpw   
W_hua_outp   
W_hua_outpd   
W_hua_outpw   
W_IsDualCPU   
W_IsGBT   
W_IsHWM   
W_IsITE   
W_IsW83781D   
W_Set_Beep_Status   
W_Set_FanLoLimitValue   
W_Set_TempLimitValue   
W_Set_VINLimitValue   
W_SMI_Test   
W_Temp_RtoT   
W_Temp_TtoR

semo 11. Aug 2007 02:25

Re: Gigabyte dll functions
 
is it allowed to use the gigabyte dll?

and please specify "this doesnt work".
what do you mean with that?
what error appears?

Razor 11. Aug 2007 02:27

Re: Gigabyte dll functions
 
No error comes up until you dont drop it in easy tune 4 directory.It shows false on gigabyte motherboard.But it must show true becouse the board is gigabyte... :)

gsh 11. Aug 2007 08:12

Re: Gigabyte dll functions
 
try it so
Delphi-Quellcode:
function ismotherboard: boolean;
type
  LX_IsGigaMainBoard = function(pIsGigaMainBoard: Pointer): boolean stdcall;
var
  hInstDll: THandle;
  IsGigaMainBoard: LX_IsGigaMainBoard;
  Pfad: AnsiString;
begin

  Pfad := ExtractFilePath(application.ExeName) + 'w83781d.dll';
  if FileExists(Pfad) then
  begin
    hInstDll := LoadLibrary(PChar(Pfad));
    if hInstDll <> 0 then
    try
      IsGigaMainBoard:= GetProcAddress(hInstDll, 'LX_IsGigaMainBoard');
      if Assigned(IsGigaMainBoard) then
      begin
        IsGigaMainBoard(Addr(Result));
      end
      else ShowMessage('Error');
    finally
      FreeLibrary(hInstDll);
    end;
  end;
maybe der is an error while loding the dll

and do you know that this type deklaration is correct?
LX_IsGigaMainBoard = function(pIsGigaMainBoard: Pointer): boolean stdcall;

Razor 11. Aug 2007 10:57

Re: Gigabyte dll functions
 
Yes i think it is correct do we have someone here that has a Gigabyte board to test this? :)
I need this function as a sort of protect mechanism and it goes like this if you have a gigabyte motherboard then it will show cpu temperature.So if ismotherboard then cputemp... :P

Der_Unwissende 11. Aug 2007 11:37

Re: Gigabyte dll functions
 
Zitat:

Zitat von gsh
and do you know that this type deklaration is correct?
LX_IsGigaMainBoard = function(pIsGigaMainBoard: Pointer): boolean stdcall;

Zitat:

Zitat von Razor
Yes i think it is correct do we have someone here that has a Gigabyte board to test this? :)

Hi,
well to me it seems to be much easier if you just explain where you've got the signature from. Is there some SDK/Specification published by Gigabyte?

And if so, I don't think that they will use the Pointer to an Delphi-Boolean as an argument of the function, neither they will use this Type for the return-parameter. Because of Portability the might have used something like an C-Bool (an Integervalue, if 0 = false, true otherwise). But why should this method return the result by an argument and as a result of the function?

Regards Der Unwissende

Razor 11. Aug 2007 11:47

Re: Gigabyte dll functions
 
Well i got the info from Delphi Praxis :lol:

Link

Der_Unwissende 11. Aug 2007 13:41

Re: Gigabyte dll functions
 
Zitat:

Zitat von Razor
Well i got the info from Delphi Praxis :lol:

Link

I see. So the signature of LX_Get_CPUTempValue is well known and testet, and hopefully other functions work similar, but this can't be assured by one known signature.
Well, I guess that you should change the boolean in the DLL-Function Call (as parameter and result) to LongBool. This is the more convenient way do return a True or False, because most languages supports a generic Integer Type (int in C, Integer in Delphi, ...), while boolean might be implemented in different ways.

Muetze1 11. Aug 2007 13:43

Re: Gigabyte dll functions
 
Zitat:

Zitat von Der_Unwissende
well to me it seems to be much easier if you just explain where you've got the signature from. Is there some SDK/Specification published by Gigabyte?

And if so, I don't think that they will use the Pointer to an Delphi-Boolean as an argument of the function, neither they will use this Type for the return-parameter. Because of Portability the might have used something like an C-Bool (an Integervalue, if 0 = false, true otherwise). But why should this method return the result by an argument and as a result of the function?

As you can see, he just copy & paste from the working temperature code. He renamed the parameter and that's all. He has no knowledge about the things he does - but he also don't want to know. He only wants it running (and getting the code)...

Razor 11. Aug 2007 16:45

Re: Gigabyte dll functions
 
Nobody knows and now you are deleting my posts?Oh thats nice!


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:06 Uhr.
Seite 1 von 4  1 23     Letzte »    

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz