Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Summpot committed Mar 25, 2024
1 parent 76114b0 commit b9d4ecd
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions tests/MinHook.Tests/DnsHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,13 @@ public struct NativeOverlapped
{
int result = Original(pName, pServiceName, dwNameSpace, lpNspId, hints, ppResult, timeout, lpOverlapped,
lpCompletionRoutine, lpHandle);
if (result != 0)
if (pName.Contains("pixiv"))
{
if (pName.Contains("pixiv"))
{
(*ppResult)->ai_addr->sa_data[0] = 210;
(*ppResult)->ai_addr->sa_data[1] = 140;
(*ppResult)->ai_addr->sa_data[2] = 92;
(*ppResult)->ai_addr->sa_data[3] = 183;
return 0;
}
(*ppResult)->ai_addr->sa_data[0] = 210;
(*ppResult)->ai_addr->sa_data[1] = 140;
(*ppResult)->ai_addr->sa_data[2] = 92;
(*ppResult)->ai_addr->sa_data[3] = 183;
return 0;
}
return result;
}
Expand All @@ -105,17 +102,14 @@ public struct NativeOverlapped
void OnComplete(uint error, uint bytes, NativeOverlapped* overlapped)
{
var complete = Marshal.GetDelegateForFunctionPointer<CompletionRoutineDelegate>(lpCompletionRoutine);
if (error != 0)
if (pName.Contains("pixiv"))
{
if (pName.Contains("pixiv"))
{
(*ppResult)->ai_addr->sa_data[0] = 210;
(*ppResult)->ai_addr->sa_data[1] = 140;
(*ppResult)->ai_addr->sa_data[2] = 92;
(*ppResult)->ai_addr->sa_data[3] = 183;
overlapped->Pointer = ppResult;
complete(0, 0, overlapped);
}
(*ppResult)->ai_addr->sa_data[0] = 210;
(*ppResult)->ai_addr->sa_data[1] = 140;
(*ppResult)->ai_addr->sa_data[2] = 92;
(*ppResult)->ai_addr->sa_data[3] = 183;
complete(0, 0, overlapped);
return;
}
complete(error, bytes, overlapped);
}
Expand Down

0 comments on commit b9d4ecd

Please sign in to comment.