Skip to content

Commit

Permalink
Fea, LoadLibrary添加LOAD_LIBRARY_SEARCH_USER_DIRS支持
Browse files Browse the repository at this point in the history
  - 添加 SetDllDirectoryW(A)
  - 添加 GetDllDirectoryW(A)
  - 添加 AddDllDirectory
  - 添加 RemoveDllDirectory
  • Loading branch information
mingkuang-Chuyu committed Jan 26, 2025
1 parent 98f7e93 commit 2772873
Show file tree
Hide file tree
Showing 7 changed files with 4,395 additions and 3,259 deletions.
1,650 changes: 827 additions & 823 deletions ThunksList.md

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions src/Shared/List.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#pragma once

namespace YY::Thunks
{
namespace
{
template<typename ListEntry>
struct ListEntryImpl
{
ListEntry* pPrior = nullptr;
ListEntry* pNext = nullptr;
};

template<typename ListEntry>
class ListImpl
{
public:
ListEntry* pFirst = nullptr;
ListEntry* pLast = nullptr;

void __fastcall PushBack(ListEntry* _pItem) noexcept
{
if (!_pItem)
return;

_pItem->pNext = nullptr;
_pItem->pPrior = pLast;
pLast = _pItem;

if (!pFirst)
pFirst = _pItem;
}

bool __fastcall Remove(ListEntry* _pItem) noexcept
{
if (!_pItem)
return false;

if (!pFirst)
return false;

auto _pPrior = _pItem->pPrior;
auto _pNext = _pItem->pNext;
if (_pPrior)
{
_pPrior->pNext = _pNext;
}

if (_pNext)
{
_pNext->pPrior = _pPrior;
}

if (pFirst == _pItem)
{
pFirst = _pNext;
}

if (pLast == _pItem)
{
pLast = _pPrior;
}

return true;
}
};
}
}
2,838 changes: 1,541 additions & 1,297 deletions src/Thunks/YY_Thunks.cpp

Large diffs are not rendered by default.

Loading

0 comments on commit 2772873

Please sign in to comment.