mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
b02427417c
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@5614 21ef857c-d57f-4fe0-8362-d861dc6d29cd
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using ProcessHacker.Native.Api;
|
|
|
|
namespace ProcessHacker.Native
|
|
{
|
|
public static class Loader
|
|
{
|
|
public static IntPtr GetProcedure(string dllName, string procedureName)
|
|
{
|
|
return GetProcedure(GetDllHandle(dllName), procedureName);
|
|
}
|
|
|
|
public static IntPtr GetProcedure(IntPtr dllHandle, string procedureName)
|
|
{
|
|
return Win32.GetProcAddress(dllHandle, procedureName);
|
|
}
|
|
|
|
public static IntPtr GetProcedure(IntPtr dllHandle, int procedureNumber)
|
|
{
|
|
return Win32.GetProcAddress(dllHandle, (ushort)procedureNumber);
|
|
}
|
|
|
|
public static IntPtr GetDllHandle(string dllName)
|
|
{
|
|
return Win32.GetModuleHandle(dllName);
|
|
}
|
|
|
|
public static IntPtr LoadDll(string dllName)
|
|
{
|
|
return Win32.LoadLibrary(dllName);
|
|
}
|
|
|
|
public static bool UnloadDll(IntPtr dllHandle)
|
|
{
|
|
return Win32.FreeLibrary(dllHandle);
|
|
}
|
|
}
|
|
}
|