Skip to content

Commit

Permalink
don't shorten file names unless necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
lostmsu committed Aug 25, 2023
1 parent e6e3236 commit c7e645e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/NDetours.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!-- Package stuff -->
<Version>0.0.10</Version>
<Version>0.0.11</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Managed package that simplifies injection of Detours-based DLLs</Description>
Expand Down
8 changes: 6 additions & 2 deletions src/ProcessDetour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ public static unsafe Process Start(StartInfo startInfo) {
try {
for (int i = 0; i < startInfo.InjectDlls.Count; i++) {
string unicodePath = startInfo.InjectDlls[i];
string shortPath = UnicodePaths.GetShortPath(unicodePath);
dlls[i] = new(shortPath, Encoding.ASCII);
string compatiblePath =
unicodePath.Any(c => c > 127)
? UnicodePaths.GetShortPath(unicodePath)
: unicodePath;
Debug.WriteLine(compatiblePath);
dlls[i] = new(compatiblePath, Encoding.ASCII);
dllsMarked[i] = (byte*)dlls[i].RawPointer;
}

Expand Down

0 comments on commit c7e645e

Please sign in to comment.