Re: user32: Implement GetWindowModuleFileName with tests (try 2)

2008-03-31 Thread Dmitry Timoshkov
"Dmitry Timoshkov" <[EMAIL PROTECTED]> wrote: >> This won't work across processes. > > Looks like GetWindowModuleFileName is not supposed to work for other > process windows, at least in the following snippet both GetWindowLongPtr > and GetWindowModuleFileName return 0 but don't change the last e

Re: user32: Implement GetWindowModuleFileName with tests (try 2)

2008-03-31 Thread Dmitry Timoshkov
"Alexandre Julliard" <[EMAIL PROTECTED]> wrote: > "Maarten Lankhorst" <[EMAIL PROTECTED]> writes: > >> @@ -3121,9 +3133,21 @@ UINT WINAPI GetWindowModuleFileNameA( HWND hwnd, >> LPSTR lpszFileName, UINT cchFil >> */ >> UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPWSTR lpszFileName, UINT

Re: user32: Implement GetWindowModuleFileName with tests (try 2)

2008-02-15 Thread Alexandre Julliard
"Maarten Lankhorst" <[EMAIL PROTECTED]> writes: > @@ -3121,9 +3133,21 @@ UINT WINAPI GetWindowModuleFileNameA( HWND hwnd, LPSTR > lpszFileName, UINT cchFil > */ > UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPWSTR lpszFileName, UINT > cchFileNameMax) > { > -FIXME("GetWindowModuleFil

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Dmitry Timoshkov
"Maarten Lankhorst" <[EMAIL PROTECTED]> wrote: > I've tried to do the GetWindowLongPtr GWLP_HINSTANCE thing but it > seems to always return 0 in wine, which according to msdn means error, > but it could just be not set in wine. Perhaps GWLP_HINSTANCE needs to > be set when the window is being crea

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Maarten Lankhorst
Hi folks, 2008/2/8, Dmitry Timoshkov <[EMAIL PROTECTED]>: > "Dmitry Timoshkov" <[EMAIL PROTECTED]> wrote: > > >> +hproc = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid); > > > > After reading MSDN and guessing from the API name shouldn't it > > simply fetch GWL_HINSTANCE and call GetModuleFile

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Reece Dunn
On 08/02/2008, Dmitry Timoshkov <[EMAIL PROTECTED]> wrote: > "Reece Dunn" <[EMAIL PROTECTED]> wrote: > >> What's the point of saving/restoring last error value? If > >> WideCharToMultiByte > >> fails you need to return an error in that case, not silently continue. > > > > The usual model is someth

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Reece Dunn
On 08/02/2008, Dmitry Timoshkov <[EMAIL PROTECTED]> wrote: > "Maarten Lankhorst" <[EMAIL PROTECTED]> wrote: > > > +retval = GetWindowModuleFileNameW(hwnd, filenameW, cchFileNameMax); > > +if (retval) > > +{ > > +DWORD lasterror = GetLastError(); > > +WideCharToMultiByte(

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Dmitry Timoshkov
"Dmitry Timoshkov" <[EMAIL PROTECTED]> wrote: >> +hproc = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid); > > After reading MSDN and guessing from the API name shouldn't it > simply fetch GWL_HINSTANCE and call GetModuleFileName on it? And after looking at GetModuleFileNameW implementation,

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Dmitry Timoshkov
> +hproc = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid); After reading MSDN and guessing from the API name shouldn't it simply fetch GWL_HINSTANCE and call GetModuleFileName on it? -- Dmitry.

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Dmitry Timoshkov
"Reece Dunn" <[EMAIL PROTECTED]> wrote: >> > +retval = GetWindowModuleFileNameW(hwnd, filenameW, cchFileNameMax); >> > +if (retval) >> > +{ >> > +DWORD lasterror = GetLastError(); >> > +WideCharToMultiByte(CP_ACP, 0, filenameW, -1, lpszFileName, >> > cchFileNameMax, NU

Re: user32: Implement GetWindowModuleFileName with tests

2008-02-08 Thread Dmitry Timoshkov
"Maarten Lankhorst" <[EMAIL PROTECTED]> wrote: > UINT WINAPI GetWindowModuleFileNameA( HWND hwnd, LPSTR lpszFileName, UINT > cchFileNameMax) > { > -FIXME("GetWindowModuleFileNameA(hwnd %p, lpszFileName %p, cchFileNameMax > %u) stub!\n", > - hwnd, lpszFileName, cchFileNameMax); > -