mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Disable module load/unload logging (#1948)
This commit is contained in:
parent
7707da079c
commit
5af935bbca
1 changed files with 17 additions and 10 deletions
|
|
@ -57,8 +57,22 @@ internal sealed unsafe partial class CurrentProcessModules : IInternalDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Gets all the loaded modules, up to date.</summary>
|
/// <summary>Gets all the loaded modules, up to date.</summary>
|
||||||
public static ProcessModuleCollection ModuleCollection =>
|
public static ProcessModuleCollection ModuleCollection
|
||||||
(cookie == 0 ? Process.GetCurrentProcess() : process ??= Process.GetCurrentProcess()).Modules;
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (cookie == 0)
|
||||||
|
{
|
||||||
|
// This service has not been initialized; return a fresh copy without storing it.
|
||||||
|
return Process.GetCurrentProcess().Modules;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process is null)
|
||||||
|
Log.Verbose("{what}: Fetchling fresh copy of current process modules.", nameof(CurrentProcessModules));
|
||||||
|
|
||||||
|
return (process ??= Process.GetCurrentProcess()).Modules;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
void IInternalDisposableService.DisposeService()
|
void IInternalDisposableService.DisposeService()
|
||||||
|
|
@ -77,14 +91,7 @@ internal sealed unsafe partial class CurrentProcessModules : IInternalDisposable
|
||||||
private static void DllNotificationCallback(
|
private static void DllNotificationCallback(
|
||||||
LdrDllNotificationReason reason,
|
LdrDllNotificationReason reason,
|
||||||
LdrDllNotificationData* data,
|
LdrDllNotificationData* data,
|
||||||
nint context)
|
nint context) => process = null;
|
||||||
{
|
|
||||||
process = null;
|
|
||||||
var name = new ReadOnlySpan<char>(data->FullDllName->Buffer, data->FullDllName->Length / 2);
|
|
||||||
LogQueue.Enqueue(
|
|
||||||
$"[{nameof(CurrentProcessModules)}]: {reason}: {name} @ 0x{data->DllBase:X} ({data->SizeOfImage}:X bytes)");
|
|
||||||
LogSemaphore.Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers for notification when a DLL is first loaded.
|
/// Registers for notification when a DLL is first loaded.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue