mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-12-05 13:54:09 +00:00
Improve the loader policy
Improve the loader policy
This commit is contained in:
parent
cb41c92eab
commit
7abf705c6e
|
|
@ -223,7 +223,9 @@ namespace WelsonJS.Launcher
|
|||
IntPtr h = LoadLibrary(localPath);
|
||||
if (h == IntPtr.Zero)
|
||||
{
|
||||
Logger.Error("LoadLibrary failed for {0}", localPath);
|
||||
int errorCode = Marshal.GetLastWin32Error();
|
||||
Logger.Error("LoadLibrary failed for {0} with error code {1}", localPath, errorCode);
|
||||
throw new InvalidOperationException($"Failed to load native module: {fileName} (error: {errorCode})");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -372,6 +374,12 @@ namespace WelsonJS.Launcher
|
|||
|
||||
private static void EnsureSignedFileOrThrow(string path, string logicalName)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
Logger.Error("File does not exist for signature verification: {0}", logicalName);
|
||||
throw new FileNotFoundException("File not found for signature verification: " + logicalName, path);
|
||||
}
|
||||
|
||||
FileSignatureStatus status = VerifySignature(path);
|
||||
|
||||
if (status == FileSignatureStatus.Valid)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user