Skip to content

Commit

Permalink
Condense the logging of DLL function imports a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Oct 10, 2024
1 parent 53f5b3b commit 3d73f01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Projects/Src/Setup.ScriptRunner.pas
Original file line number Diff line number Diff line change
Expand Up @@ -241,20 +241,18 @@ function PSExecOnSpecialProcImport(Sender: TPSExec; p: TPSExternalProcRec; Tag:
end;
FunctionName := Copy(S, 1, I-1);

ScriptRunner.LogFmt('Function name: %s', [FunctionName]);
UnicodeDllName := UTF8ToString(DllName);
ScriptRunner.LogFmt('DLL name: %s', [UnicodeDllname]);
ScriptRunner.LogFmt('Function and DLL name: %s@%s', [FunctionName, UnicodeDllName]);

if Assigned(ScriptRunner.FOnDllImport) then begin
ScriptRunner.FOnDllImport(UnicodeDllName, ForceDelayLoad);
DllName := EncodeDLLFilenameForROPS(UnicodeDllName);
p.Decl := AnsiString('dll:') + DllName + Copy(p.Decl, Pos(AnsiString(#0), p.Decl), MaxInt);
end;

if DllName <> '' then begin
ScriptRunner.LogFmt('Dest DLL name: %s', [UnicodeDllName]);
ScriptRunner.Log('Importing the DLL function.');
end else
if DllName <> '' then
ScriptRunner.LogFmt('Importing the DLL function. Dest DLL name: %s', [UnicodeDllName])
else
ScriptRunner.Log('Skipping.'); { We're actually still going to call ProcessDllImport but this doesn't matter to the user. }

var DelayLoaded: Boolean;
Expand Down
1 change: 1 addition & 0 deletions whatsnew.htm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<li>Documented support functions <tt>VarArrayGet</tt> and <tt>VarArraySet</tt> which were already available but not documented.</li>
<li>Renamed the <tt>FileCopy</tt> support function to <tt>CopyFile</tt>. The old name is still supported, but it is recommended to update your scripts to the new name and the compiler will issue a warning if you don't.</li>
<li>Fixed support function <tt>TStream.CopyFrom</tt> by adding a <tt>BufferSize</tt> parameter which was required but missing. Using <tt>$100000</tt> as the value is recommended.</li>
<li>Condensed the logging of DLL function imports.</li>
<li>Added new <tt>Debugging</tt> support function.</li>
</ul>
</li>
Expand Down

0 comments on commit 3d73f01

Please sign in to comment.