Commit fcf4d071 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Use GetWindowLongPtr for GetWindowModuleFileName implementation.

parent 11657aab
......@@ -1413,20 +1413,17 @@ BOOL WINAPI DragDetect( HWND hwnd, POINT pt )
*/
UINT WINAPI GetWindowModuleFileNameA( HWND hwnd, LPSTR module, UINT size )
{
WND *win;
HINSTANCE hinst;
TRACE( "%p, %p, %u\n", hwnd, module, size );
win = WIN_GetPtr( hwnd );
if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP)
if (!WIN_IsCurrentProcess( hwnd ))
{
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return 0;
}
hinst = win->hInstance;
WIN_ReleasePtr( win );
hinst = (HINSTANCE)GetWindowLongPtrA( hwnd, GWLP_HINSTANCE );
return GetModuleFileNameA( hinst, module, size );
}
......@@ -1435,20 +1432,17 @@ UINT WINAPI GetWindowModuleFileNameA( HWND hwnd, LPSTR module, UINT size )
*/
UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPWSTR module, UINT size )
{
WND *win;
HINSTANCE hinst;
TRACE( "%p, %p, %u\n", hwnd, module, size );
win = WIN_GetPtr( hwnd );
if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP)
if (!WIN_IsCurrentProcess( hwnd ))
{
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return 0;
}
hinst = win->hInstance;
WIN_ReleasePtr( win );
hinst = (HINSTANCE)GetWindowLongPtrW( hwnd, GWLP_HINSTANCE );
return GetModuleFileNameW( hinst, module, size );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment