Skip to content

Commit

Permalink
Opt, YY.Depends.Analyzer添加6.0、6.1、6.2、6.3数据库
Browse files Browse the repository at this point in the history
  • Loading branch information
mingkuang-Chuyu committed Jun 8, 2024
1 parent 9239a65 commit d905632
Show file tree
Hide file tree
Showing 14 changed files with 843,619 additions and 114,271 deletions.
11 changes: 6 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ as NuGet is designed to be foolproof and easier to use.
> Note: If your app needs to be compatible with Vista or later, please set `Additional Dependencies` to
`objs\$(PlatformShortName)\YY_Thunks_for_Vista.obj`。
#### 2.2.2. using lib files (LLD Link)
> LLD linkers using obj files will encounter duplicate symbol errors.
#### 2.2.2. using lib files (LLD-Link)
> LLD-Link linkers using obj files will encounter duplicate symbol errors.
1. Download and unzip [YY-Thunks-Lib](https://github.com/Chuyu-Team/YY-Thunks/releases) to project directory.
2. Add a parameter like `-L YY-Thunks_Root_Dir/lib/5.1.2600.0/x86` to the linker and make sure the order is higher than WinSDK.
3. 如If the project is a `Dynamic Link Library`, please add parameter `-e DllMainCRTStartupForYY_Thunks`
2. Add a parameter like `-LIBPATH:YY-Thunks_Root_Dir/lib/5.1.2600.0/x86` to the linker and make sure the order is higher than WinSDK.
3. Please add parameter `-SUBSYSTEM:WINDOWS",5.1"` or `-SUBSYSTEM:CONSOLE",5.1"` or `-SUBSYSTEM:WINDOWS",5.2"` or `-SUBSYSTEM:CONSOLE",5.2"` to linker.
4. If the project is a `Dynamic Link Library`, please add parameter `-ENTRY:DllMainCRTStartupForYY_Thunks` to linker
(If you ignore this step, the XP system may crash with `thread_local`).
4. Rebuild the solution.
5. Rebuild the solution.
## 3. Compatibility
Expand Down
14 changes: 9 additions & 5 deletions Readme.osc.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@ ULONGLONG WINAPI GetTickCount64(VOID)
> 温馨提示:如果需要兼容 Vista,【所需的最低版本】无需修改,但是【附加依赖项】请选择
`objs\$(PlatformShortName)\YY_Thunks_for_Vista.obj`。
#### 2.2.2. lib方式(适合LLD链接器
> LLD链接器无法使用obj方式,因为遇到重复符号会报告错误。
#### 2.2.2. lib方式(适合LLD-Link链接器
> LLD-Link链接器无法使用obj方式,因为遇到重复符号会报告错误。
1. 下载 [YY-Thunks-Lib](https://github.com/Chuyu-Team/YY-Thunks/releases),
然后解压到你的工程目录。
2. 将 `-L YY-Thunks根目录/Lib/5.1.2600.0/x86` 类似的参数添加到链接器参数中,并确保顺序比系统SDK靠前。
3. 如果是编译DLL,额外给链接器传递 `-e DllMainCRTStartupForYY_Thunks`,修改DLL入口点(不这样做XP下使用thread_local可能崩溃!)
4. 重新编译代码。
2. 将 `-LIBPATH:YY-Thunks根目录/Lib/5.1.2600.0/x86` 类似的参数添加到链接器参数中,并确保顺序比系统SDK靠前。
3. 链接器额外传递 `-SUBSYSTEM:WINDOWS",5.1"` 或者 `-SUBSYSTEM:CONSOLE",5.1"` 或者 `-SUBSYSTEM:WINDOWS",5.2"` 或者 `-SUBSYSTEM:CONSOLE",5.2"`。
4. 如果是编译DLL,额外给链接器传递 `-ENTRY:DllMainCRTStartupForYY_Thunks`,修改DLL入口点(不这样做XP下使用thread_local可能崩溃!)
5. 重新编译代码。
> 温馨提示:如果您看不懂链接器的配置指引那么请使用NuGet版!NuGet对新手友好。
## 3. 兼容性
Expand Down
8 changes: 6 additions & 2 deletions src/YY-Thunks.UnitTest/WS2_32.UintTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace WS2_32

~GetAddrInfoExCancel()
{
WSACleanup();
// WSACleanup();
}

struct GetAddrInfoEx_OVERLAPPED : public OVERLAPPED
Expand Down Expand Up @@ -118,6 +118,8 @@ namespace WS2_32
_Hints.ai_family = AF_UNSPEC;
GetAddrInfoEx_OVERLAPPED _QueryOverlapped = {};
_QueryOverlapped.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
Assert::IsNotNull(_QueryOverlapped.hEvent);

PADDRINFOEXW _QueryResults;

HANDLE _hHandle;
Expand Down Expand Up @@ -170,6 +172,8 @@ namespace WS2_32
_Hints.ai_family = AF_UNSPEC;
GetAddrInfoEx_OVERLAPPED _QueryOverlapped = {};
_QueryOverlapped.hEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
Assert::IsNotNull(_QueryOverlapped.hEvent);

PADDRINFOEXA _QueryResults;

HANDLE _hHandle;
Expand Down Expand Up @@ -237,7 +241,7 @@ namespace WS2_32

~GetAddrInfoEx()
{
WSACleanup();
// WSACleanup();
}

TEST_METHOD(Win2003_XPSP3模式)
Expand Down
Loading

0 comments on commit d905632

Please sign in to comment.