Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-03-11 00:09:13 +0300
committerJan Vorlicek <janvorli@microsoft.com>2016-03-11 20:44:47 +0300
commit096c82deabf1e3fbe6b5f794b7a2e5c250b48ead (patch)
treec7143265a9f093eacf4c16867411294c5ab5e00b /src/Native/Runtime/windows
parent654002d3cd76aa9f302257cb47791f1c806819a6 (diff)
Implement PalGetModuleFileName for Unix
This change implements PalGetModuleFileName for Unix. Since the module name passed to us is a utf-8 string, I have modified the signature of the function to use TCHAR and then modified managed RhGetModuleFileName interop signature to use byte* for Unix instead of char*. And I have also modified the called of this function, the TryGetFullPathToApplicationModule, to perform conversion of that to regular string.
Diffstat (limited to 'src/Native/Runtime/windows')
-rw-r--r--src/Native/Runtime/windows/PalRedhawkCommon.cpp2
-rw-r--r--src/Native/Runtime/windows/PalRedhawkMinWin.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Native/Runtime/windows/PalRedhawkCommon.cpp b/src/Native/Runtime/windows/PalRedhawkCommon.cpp
index 9d09379d0..151e00968 100644
--- a/src/Native/Runtime/windows/PalRedhawkCommon.cpp
+++ b/src/Native/Runtime/windows/PalRedhawkCommon.cpp
@@ -378,7 +378,7 @@ typedef struct _TEB {
//NOTE: This implementation exists because calling GetModuleFileName is not wack compliant. if we later decide
// that the framework package containing mrt100_app no longer needs to be wack compliant, this should be
// removed and the windows implementation of GetModuleFileName should be substitued on windows.
-REDHAWK_PALEXPORT Int32 PalGetModuleFileName(_Out_ wchar_t** pModuleNameOut, HANDLE moduleBase)
+REDHAWK_PALEXPORT Int32 PalGetModuleFileName(_Out_ const TCHAR** pModuleNameOut, HANDLE moduleBase)
{
TEB* pTEB = NtCurrentTeb();
LIST_ENTRY* pStartLink = &(pTEB->ProcessEnvironmentBlock->Ldr->InMemoryOrderModuleList);
diff --git a/src/Native/Runtime/windows/PalRedhawkMinWin.cpp b/src/Native/Runtime/windows/PalRedhawkMinWin.cpp
index 86ad38de7..1ead83c13 100644
--- a/src/Native/Runtime/windows/PalRedhawkMinWin.cpp
+++ b/src/Native/Runtime/windows/PalRedhawkMinWin.cpp
@@ -190,7 +190,7 @@ extern "C" UInt64 PalGetCurrentThreadIdForLogging()
} \
WHILE_0;
-extern "C" int __stdcall PalGetModuleFileName(_Out_ wchar_t** pModuleNameOut, HANDLE moduleBase);
+extern "C" int __stdcall PalGetModuleFileName(_Out_ const TCHAR** pModuleNameOut, HANDLE moduleBase);
HRESULT STDMETHODCALLTYPE AllocateThunksFromTemplate(
_In_ HANDLE hTemplateModule,
@@ -204,7 +204,7 @@ HRESULT STDMETHODCALLTYPE AllocateThunksFromTemplate(
bool success = false;
HANDLE hMap = NULL, hFile = INVALID_HANDLE_VALUE;
- WCHAR * wszModuleFileName = NULL;
+ const WCHAR * wszModuleFileName = NULL;
if (PalGetModuleFileName(&wszModuleFileName, hTemplateModule) == 0 || wszModuleFileName == NULL)
return E_FAIL;