Skip to content

Commit

Permalink
Merge pull request #4739 from hangshao0/master
Browse files Browse the repository at this point in the history
Use port_file_get_unicode_path() to covert cache file path to Unicode.
  • Loading branch information
pshipton authored Feb 14, 2019
2 parents b9bb3c0 + f9d53e3 commit 8905442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/port/win32/j9shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ j9shmem_stat(struct J9PortLibrary *portLibrary, const char* cacheDirName, uintpt
sharedMemoryFullPath = getSharedMemoryPathandFileName(portLibrary, cacheDirName, name);

/* Convert the filename from UTF8 to Unicode */
unicodePath = port_convertFromUTF8(OMRPORTLIB, sharedMemoryFullPath, unicodeBuffer, UNICODE_BUFFER_SIZE);
unicodePath = port_file_get_unicode_path(OMRPORTLIB, sharedMemoryFullPath, unicodeBuffer, UNICODE_BUFFER_SIZE);
if (NULL == unicodePath) {
omrmem_free_memory(sharedMemoryFullPath);
Trc_PRT_shmem_j9shmem_stat_unicodePathNull();
Expand Down Expand Up @@ -647,7 +647,7 @@ createMappedFile(struct J9PortLibrary* portLibrary, const char* cacheDirName , s
Trc_PRT_shmem_createMappedFile_fileCreateSucceeded();

/* Convert the filename from UTF8 to Unicode */
unicodePath = port_convertFromUTF8(OMRPORTLIB, shareMemoryFileName, unicodeBuffer, UNICODE_BUFFER_SIZE);
unicodePath = port_file_get_unicode_path(OMRPORTLIB, shareMemoryFileName, unicodeBuffer, UNICODE_BUFFER_SIZE);
if (NULL != unicodePath) {
/* MoveFileEx allows us to delete the share cache after the next reboot */
MoveFileExW(unicodePath, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
Expand Down

0 comments on commit 8905442

Please sign in to comment.