mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
[Application]
- Added some codes to avoid loading a dll from current directory. [Library] - Added new functions to avoid loading a dll from current directory. (CSystem::RmSetDllDirectory(), CSystem::RmLoadLibrary())
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "MeasureNet.h"
|
||||
#include "Rainmeter.h"
|
||||
#include "System.h"
|
||||
|
||||
BYTE* CMeasureNet::c_Table = NULL;
|
||||
UINT CMeasureNet::c_NumOfTables = 0;
|
||||
@ -662,7 +663,7 @@ void CMeasureNet::InitializeNewApi()
|
||||
{
|
||||
if (c_IpHlpApiLibrary == NULL)
|
||||
{
|
||||
c_IpHlpApiLibrary = LoadLibrary(L"IpHlpApi.dll");
|
||||
c_IpHlpApiLibrary = GetModuleHandle(L"IpHlpApi.dll");
|
||||
if (c_IpHlpApiLibrary)
|
||||
{
|
||||
c_GetIfTable2Ex = (FPGETIFTABLE2EX)GetProcAddress(c_IpHlpApiLibrary, "GetIfTable2Ex");
|
||||
@ -675,7 +676,6 @@ void CMeasureNet::InitializeNewApi()
|
||||
{
|
||||
if (c_IpHlpApiLibrary)
|
||||
{
|
||||
FreeLibrary(c_IpHlpApiLibrary);
|
||||
c_IpHlpApiLibrary = NULL;
|
||||
}
|
||||
c_GetIfTable2Ex = NULL;
|
||||
@ -701,7 +701,6 @@ void CMeasureNet::FinalizeNewApi()
|
||||
{
|
||||
c_FreeMibTable(c_Table);
|
||||
|
||||
FreeLibrary(c_IpHlpApiLibrary);
|
||||
c_IpHlpApiLibrary = NULL;
|
||||
c_GetIfTable2Ex = NULL;
|
||||
c_FreeMibTable = NULL;
|
||||
|
Reference in New Issue
Block a user