Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added code to output version info on debug level change #542

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion tr4w/src/MainUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ function DeviceIoControlHandler
ULONG; pOutputLength: PULONG
): Cardinal;

function IsWin64: Boolean;
function GetLocalComputerName : string;
procedure CheckNumber;
procedure RunPlugin(PluginNumber: integer);
Expand Down Expand Up @@ -8195,10 +8196,24 @@ procedure ProcessImportedSRX_String(fieldValue: string; var exch: ContestExchang
end;
end;
end; // case
end;

function IsWin64: Boolean;
var
IsWow64Process : function(hProcess : THandle; var Wow64Process : BOOL): BOOL; stdcall;
Wow64Process : BOOL;
begin
Result := False;
IsWow64Process := GetProcAddress(GetModuleHandle(Kernel32), 'IsWow64Process');
if Assigned(IsWow64Process) then begin
if IsWow64Process(GetCurrentProcess, Wow64Process) then begin
Result := Wow64Process;
end;
end;
end;



end;



Expand Down
14 changes: 14 additions & 0 deletions tr4w/src/trdos/tree.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5283,6 +5283,20 @@ function GoodLookingRDA(rda: Str20): boolean;
result := True;
end;

function IsWin64: Boolean;
var
IsWow64Process : function(hProcess : THandle; var Wow64Process : BOOL): BOOL; stdcall;
Wow64Process : BOOL;
begin
Result := False;
IsWow64Process := GetProcAddress(GetModuleHandle(Kernel32), 'IsWow64Process');
if Assigned(IsWow64Process) then begin
if IsWow64Process(GetCurrentProcess, Wow64Process) then begin
Result := Wow64Process;
end;
end;
end;

{
procedure Congrats;
var
Expand Down
13 changes: 13 additions & 0 deletions tr4w/src/uCFG.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1544,11 +1544,24 @@ procedure UpdateDebugLogLevel; // This is called when changed in the Config dial
llFatal: logger.level := Fatal;
llError: logger.Level := Error;
llWarn: logger.Level := Warn;
llInfo: logger.Level := Info;
llDebug: logger.Level := Debug;
llTrace: logger.Level := Trace;
else ;
end;

// Log the version of the program under debug
if logger.IsInfoEnabled then
begin
logger.Info('TR4W Program Version %s (%s)',[ TR4W_CURRENTVERSION, TR4W_CURRENTVERSIONDATE]);
if MainUnit.IsWin64 then
begin
logger.Info('Running on 64 bit Windows');
end;
logger.info('Windows version: %d',[tr4w_osverinfo.dwPlatformId]);
end;


end;

function F_UpdateWSJTXEnabled: boolean;
Expand Down