diff options
author | Rama krishnan Raghupathy <ramarag@microsoft.com> | 2016-03-07 16:58:24 -0800 |
---|---|---|
committer | Rama krishnan Raghupathy <ramarag@microsoft.com> | 2016-03-07 16:58:24 -0800 |
commit | be7b9df6252593c918aaf7efa7f57f266349d179 (patch) | |
tree | d02fc71bd0e7c41a18064b8f885d3d1c640afe29 /src/utilcode | |
parent | 968361f43e7ced74d89c09535cac114889cdb39d (diff) | |
parent | a3348ba05a59f731b080bb6ddf23f95ad763db81 (diff) | |
download | coreclr-be7b9df6252593c918aaf7efa7f57f266349d179.tar.gz coreclr-be7b9df6252593c918aaf7efa7f57f266349d179.tar.bz2 coreclr-be7b9df6252593c918aaf7efa7f57f266349d179.zip |
Merge pull request #3441 from ramarag/pal_longfile
Enabling LongFile Support in PAL
Diffstat (limited to 'src/utilcode')
-rw-r--r-- | src/utilcode/longfilepathwrappers.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/utilcode/longfilepathwrappers.cpp b/src/utilcode/longfilepathwrappers.cpp index 2cce3b5272..2b5a8b48a6 100644 --- a/src/utilcode/longfilepathwrappers.cpp +++ b/src/utilcode/longfilepathwrappers.cpp @@ -1230,12 +1230,15 @@ BOOL PAL_GetPALDirectoryWrapper(SString& pbuffer) BOOL PAL_GetPALDirectoryWrapper(SString& pbuffer) { - BOOL retval; - COUNT_T size = MAX_LONGPATH; //Retry once the PAL Api is fixed to return the correct size - WCHAR* buffer = pbuffer.OpenUnicodeBuffer(size - 1); + BOOL retval = FALSE; + COUNT_T size = MAX_LONGPATH; + + if(!(retval = PAL_GetPALDirectoryW(pbuffer.OpenUnicodeBuffer(size - 1), &size))) + { + pbuffer.CloseBuffer(0); + retval = PAL_GetPALDirectoryW(pbuffer.OpenUnicodeBuffer(size - 1), &size); + } - retval = PAL_GetPALDirectoryW(pbuffer.OpenUnicodeBuffer(size - 1), size); - size = (COUNT_T)wcslen(buffer); pbuffer.CloseBuffer(size); return retval; |