summaryrefslogtreecommitdiff
path: root/src/utilcode
diff options
context:
space:
mode:
authorDDCloud <ramarag@microsoft.com>2016-02-29 20:24:42 -0800
committerDDCloud <ramarag@microsoft.com>2016-03-07 13:26:54 -0800
commita3348ba05a59f731b080bb6ddf23f95ad763db81 (patch)
tree6f9d1a64019f216b816550744d92a48ddcf1a706 /src/utilcode
parent34e1fad44ec969a85db8464eaab3c13b406cb5a2 (diff)
downloadcoreclr-a3348ba05a59f731b080bb6ddf23f95ad763db81.tar.gz
coreclr-a3348ba05a59f731b080bb6ddf23f95ad763db81.tar.bz2
coreclr-a3348ba05a59f731b080bb6ddf23f95ad763db81.zip
Enabling LongFile Support in PAL
Diffstat (limited to 'src/utilcode')
-rw-r--r--src/utilcode/longfilepathwrappers.cpp13
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;