summaryrefslogtreecommitdiff
path: root/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp')
-rw-r--r--sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp b/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp
new file mode 100644
index 000000000000..1f952792241f
--- /dev/null
+++ b/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp
@@ -0,0 +1,18 @@
+#include "macros.h"
+#ifdef _MSC_VER
+#pragma warning(push,1) // disable warnings within system headers
+#endif
+#include <psapi.h>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+IMPLEMENT_THUNK( psapi, WINDOWS, DWORD, WINAPI, GetModuleFileNameExW, (HANDLE hProcess, HMODULE hModule, LPWSTR lpFileNameW, DWORD nSize ) )
+{
+ AUTO_STR( lpFileName, 2 * nSize );
+
+ if ( GetModuleFileNameExA( hProcess, hModule, lpFileNameA, 2 * nSize ) )
+ return (DWORD) STR2WSTR( lpFileName, nSize );
+ else
+ return 0;
+} \ No newline at end of file