Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
revert "Work around MCG bug around ref char marshalling #5481" (#5656)
Browse files Browse the repository at this point in the history
  • Loading branch information
luqunl authored and jkotas committed Apr 6, 2018
1 parent 18dee6b commit f3e58aa
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ internal partial class Kernel32
/// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper.
/// </summary>
[DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)]
#if PROJECTN
internal static extern unsafe uint GetFullPathNameW(char* lpFileName, uint nBufferLength, char* lpBuffer, IntPtr lpFilePart);

// Works around https://devdiv.visualstudio.com/web/wi.aspx?pcguid=011b8bdf-6d56-4f87-be0d-0092136884d9&id=575202
internal static unsafe uint GetFullPathNameW(ref char lpFileName, uint nBufferLength, ref char lpBuffer, IntPtr lpFilePart)
{
fixed (char* pBuffer = &lpBuffer)
fixed (char* pFileName = &lpFileName)
return GetFullPathNameW(pFileName, nBufferLength, pBuffer, lpFilePart);
}
#else
internal static extern uint GetFullPathNameW(ref char lpFileName, uint nBufferLength, ref char lpBuffer, IntPtr lpFilePart);
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ internal partial class Kernel32
/// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper.
/// </summary>
[DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)]
#if PROJECTN
internal static extern unsafe uint GetLongPathNameW(char* lpszShortPath, char* lpszLongPath, uint cchBuffer);

// Works around https://devdiv.visualstudio.com/web/wi.aspx?pcguid=011b8bdf-6d56-4f87-be0d-0092136884d9&id=575202
internal static unsafe uint GetLongPathNameW(ref char lpszShortPath, ref char lpszLongPath, uint cchBuffer)
{
fixed (char* plpszLongPath = &lpszLongPath)
fixed (char* plpszShortPath = &lpszShortPath)
return GetLongPathNameW(plpszShortPath, plpszLongPath, cchBuffer);
}
#else
internal static extern uint GetLongPathNameW(ref char lpszShortPath, ref char lpszLongPath, uint cchBuffer);
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@ internal partial class Interop
internal partial class Kernel32
{
[DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)]
#if PROJECTN
internal static extern unsafe uint GetTempFileNameW(char* lpPathName, string lpPrefixString, uint uUnique, char* lpTempFileName);

// Works around https://devdiv.visualstudio.com/web/wi.aspx?pcguid=011b8bdf-6d56-4f87-be0d-0092136884d9&id=575202
internal static unsafe uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName)
{
fixed (char* plpPathName = &lpPathName)
fixed (char* plpTempFileName = &lpTempFileName)
return GetTempFileNameW(plpPathName, lpPrefixString, uUnique, plpTempFileName);
}
#else
internal static extern uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName);
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ internal partial class Interop
internal partial class Kernel32
{
[DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, BestFitMapping = false)]
#if PROJECTN
internal static extern unsafe uint GetTempPathW(int bufferLen, char* buffer);

// Works around https://devdiv.visualstudio.com/web/wi.aspx?pcguid=011b8bdf-6d56-4f87-be0d-0092136884d9&id=575202
internal static unsafe uint GetTempPathW(int bufferLen, ref char buffer)
{
fixed (char* pbuffer = &buffer)
return GetTempPathW(bufferLen, pbuffer);
}
#else
internal static extern uint GetTempPathW(int bufferLen, ref char buffer);
#endif
}
}

0 comments on commit f3e58aa

Please sign in to comment.