Skip to content

Commit

Permalink
Fix GetModuleFileName in GetProcessPath (dotnet#110888)
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan authored Dec 29, 2024
1 parent 670db5c commit 1da6bd7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private static unsafe bool IsPrivilegedProcessCore()
uint length;
while ((length = Interop.Kernel32.GetModuleFileName(IntPtr.Zero, ref builder.GetPinnableReference(), (uint)builder.Capacity)) >= builder.Capacity)
{
builder.EnsureCapacity((int)length);
builder.EnsureCapacity(builder.Capacity * 2);
}

if (length == 0)
Expand Down

0 comments on commit 1da6bd7

Please sign in to comment.