daily update on 20231104 by nitload youmu
This commit is contained in:
@@ -20,12 +20,13 @@ namespace StgSharp
|
||||
|
||||
internal static unsafe partial class InternalIO
|
||||
{
|
||||
internal static IntPtr SSClibPtr = IntPtr.Zero;
|
||||
|
||||
internal const string SSGC_libname =
|
||||
"StgSharpGraphic";
|
||||
internal const string SS_errorlog =
|
||||
"SS_errorlog.log";
|
||||
|
||||
internal const string SSG_errorlog =
|
||||
"SSG_errorlog.log";
|
||||
internal const string SSC_libname =
|
||||
"StgSharpC";
|
||||
|
||||
static InternalIO()
|
||||
{
|
||||
@@ -38,51 +39,76 @@ namespace StgSharp
|
||||
GLtype.Add(typeof(byte), GLconst.UNSIGNED_BYTE);
|
||||
}
|
||||
|
||||
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
|
||||
internal static T InternalLoadProc<T>(IntPtr libPtr, string name) where T : Delegate
|
||||
{
|
||||
if (!File.Exists(InternalIO.SSG_errorlog))
|
||||
try
|
||||
{
|
||||
FileStream stream = File.Create(InternalIO.SSG_errorlog);
|
||||
IntPtr procPtr = InternalGetWINproc(libPtr, name);
|
||||
T ret = Marshal.GetDelegateForFunctionPointer<T>(procPtr);
|
||||
return ret;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void InternalAppendLog(string log)
|
||||
{
|
||||
if (!File.Exists(SS_errorlog))
|
||||
{
|
||||
FileStream stream = File.Create(SS_errorlog);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
|
||||
using (StreamWriter logStream = File.AppendText(SS_errorlog))
|
||||
{
|
||||
logStream.WriteLine(log);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("kernal32.dll", EntryPoint = "FreeLibrary",
|
||||
CharSet = CharSet.Ansi)]
|
||||
internal extern static IntPtr InternalFreeWINlib(IntPtr libPtr);
|
||||
|
||||
[DllImport("kernel32.dll", EntryPoint = "GetPeocAddress",
|
||||
CharSet = CharSet.Ansi)]
|
||||
internal extern static IntPtr InternalGetWINproc(IntPtr libPtr, string procName);
|
||||
|
||||
[DllImport("kernel32.dll", EntryPoint = "LoadLibrary",
|
||||
CharSet = CharSet.Ansi)]
|
||||
internal extern static IntPtr InternalLoadWINlib(string name);
|
||||
|
||||
internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType)
|
||||
{
|
||||
if (!File.Exists(InternalIO.SS_errorlog))
|
||||
{
|
||||
FileStream stream = File.Create(InternalIO.SS_errorlog);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
using (StreamWriter logStream = File.AppendText(SS_errorlog))
|
||||
{
|
||||
logStream.WriteLine(beforeTime);
|
||||
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
|
||||
logStream.WriteLine(logLine);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void InternalWriteLog(string logLine, LogType logType)
|
||||
{
|
||||
if (!File.Exists(InternalIO.SSG_errorlog))
|
||||
if (!File.Exists(InternalIO.SS_errorlog))
|
||||
{
|
||||
FileStream stream = File.Create(InternalIO.SSG_errorlog);
|
||||
FileStream stream = File.Create(InternalIO.SS_errorlog);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
|
||||
using (StreamWriter logStream = File.AppendText(SS_errorlog))
|
||||
{
|
||||
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
|
||||
|
||||
logStream.WriteLine(logLine);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void InternalAppendLog(string log)
|
||||
{
|
||||
if (!File.Exists(InternalIO.SSG_errorlog))
|
||||
{
|
||||
FileStream stream = File.Create(InternalIO.SSG_errorlog);
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
using (StreamWriter logStream = File.AppendText(SSG_errorlog))
|
||||
{
|
||||
logStream.WriteLine(log);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user