diff options
author | Rama Krishnan Raghupathy <ramarag@microsoft.com> | 2016-02-18 18:21:18 -0800 |
---|---|---|
committer | Rama Krishnan Raghupathy <ramarag@microsoft.com> | 2016-02-19 18:09:11 -0800 |
commit | f98fb85e72d0f24c58d9e54b8b3bff2c67f985fb (patch) | |
tree | a532e7803fbbe420807eb7d9390108554b02c46d /src/ilasm | |
parent | 01ffa08a2e4748e9826956ea961eacb227b6ee87 (diff) | |
download | coreclr-f98fb85e72d0f24c58d9e54b8b3bff2c67f985fb.tar.gz coreclr-f98fb85e72d0f24c58d9e54b8b3bff2c67f985fb.tar.bz2 coreclr-f98fb85e72d0f24c58d9e54b8b3bff2c67f985fb.zip |
This Change Adds initial Support for LongFiles in the VM,
They are:
1. Wrappers for OS APIs which take or return PATHS
2. Fixing the usage of following Api's:
GetEnvironmentVariableW
SearchPathW
GetShortPathNameW
GetLongPathNameW
GetModuleFileName
Work remaining:
Remove fixed size buffers in the VM
Diffstat (limited to 'src/ilasm')
-rw-r--r-- | src/ilasm/grammar_after.cpp | 26 | ||||
-rw-r--r-- | src/ilasm/main.cpp | 10 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/ilasm/grammar_after.cpp b/src/ilasm/grammar_after.cpp index 61de517e0e..c8634801c7 100644 --- a/src/ilasm/grammar_after.cpp +++ b/src/ilasm/grammar_after.cpp @@ -858,23 +858,19 @@ Its_An_Id: if((parser->wzIncludePath != NULL) &&(wcschr(wzFile,'\\')==NULL)&&(wcschr(wzFile,':')==NULL)) { - WCHAR* wzFullName = new WCHAR[MAX_FILENAME_LENGTH+1]; - if(wzFullName != NULL) + PathString wzFullName; + + WCHAR* pwz; + DWORD dw = WszSearchPath(parser->wzIncludePath,wzFile,NULL, + TRUE, wzFullName,&pwz); + if(dw != 0) { - WCHAR* pwz; - DWORD dw = WszSearchPath(parser->wzIncludePath,wzFile,NULL, - MAX_FILENAME_LENGTH+1,wzFullName,&pwz); - if(dw != 0) - { - wzFullName[dw] = 0; - delete [] wzFile; - wzFile = wzFullName; - } - else - { - delete [] wzFullName; - } + wzFullName.CloseBuffer((COUNT_T)(dw)); + delete [] wzFile; + + wzFile = wzFullName.GetCopyOfUnicodeString(); } + } if(PASM->m_fReportProgress) parser->msg("\nIncluding '%S'\n",wzFile); diff --git a/src/ilasm/main.cpp b/src/ilasm/main.cpp index 50131b2b01..811c65640e 100644 --- a/src/ilasm/main.cpp +++ b/src/ilasm/main.cpp @@ -95,7 +95,7 @@ WCHAR *pwzDeltaFiles[1024]; char szInputFilename[MAX_FILENAME_LENGTH*3]; WCHAR wzInputFilename[MAX_FILENAME_LENGTH]; WCHAR wzOutputFilename[MAX_FILENAME_LENGTH]; -WCHAR wzIncludePathBuffer[MAX_FILENAME_LENGTH]; + #ifdef _PREFAST_ #pragma warning(push) @@ -628,8 +628,12 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) } if(wzIncludePath == NULL) { - if(0!=WszGetEnvironmentVariable(W("ILASM_INCLUDE"),wzIncludePathBuffer,MAX_FILENAME_LENGTH)) - wzIncludePath = wzIncludePathBuffer; + PathString wzIncludePathBuffer; + if (0 != WszGetEnvironmentVariable(W("ILASM_INCLUDE"), wzIncludePathBuffer)) + { + wzIncludePath = wzIncludePathBuffer.GetCopyOfUnicodeString(); + + } } //------------ Assembler initialization done. Now, to business ----------------------- if((pParser = new AsmParse(NULL, pAsm))) |