summaryrefslogtreecommitdiff
path: root/sal/systools/win32/uwinapi/GetModuleFileNameExW.cpp
blob: 1f952792241f033fa4b660b88c99a0d44068c1fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}