Bug 64950 - Fix _win32_check_running_pid on natvie windows
Summary: Fix _win32_check_running_pid on natvie windows
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on:
Blocks: 48728
  Show dependency treegraph
 
Reported: 2011-07-21 08:28 PDT by Patrick R. Gansterer
Modified: 2011-08-02 07:11 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2011-07-21 08:34 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff
Patch (1.74 KB, patch)
2011-07-31 12:04 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick R. Gansterer 2011-07-21 08:28:14 PDT
Fix _win32_check_running_pid on natvie windows
Comment 1 Patrick R. Gansterer 2011-07-21 08:34:21 PDT
Created attachment 101595 [details]
Patch
Comment 2 Adam Roben (:aroben) 2011-07-27 05:09:56 PDT
Comment on attachment 101595 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101595&action=review

> Tools/Scripts/webkitpy/common/system/executive.py:254
> -                        ("szExeFile", ctypes.c_char * 260)]
> +                        ("szExeFile", ctypes.c_char * 260),
> +                        ("th32MemoryBase", ctypes.c_long),
> +                        ("th32AccessKey", ctypes.c_long)]

I don't see these new members mentioned here: <http://msdn.microsoft.com/en-us/library/ms684839(v=vs.85).aspx>. Looks like they only exist in the WinCE version of the struct. So I think we need to detect whether we're on WinCE or not. Otherwise won't this break non-CE builds?
Comment 3 Patrick R. Gansterer 2011-07-27 05:49:42 PDT
Comment on attachment 101595 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101595&action=review

>> Tools/Scripts/webkitpy/common/system/executive.py:254
>> +                        ("th32AccessKey", ctypes.c_long)]
> 
> I don't see these new members mentioned here: <http://msdn.microsoft.com/en-us/library/ms684839(v=vs.85).aspx>. Looks like they only exist in the WinCE version of the struct. So I think we need to detect whether we're on WinCE or not. Otherwise won't this break non-CE builds?

This is not related to WinCE!
I try the get the native windows python test all pass on my windows box (german Windwos 7 Professional SP1 64bit).
I tried different versions of this patch, but this is the only one which workded for me. :-/
Any idea why the function fails on my box without the two additional members?
Comment 4 Adam Roben (:aroben) 2011-07-27 05:54:40 PDT
Comment on attachment 101595 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101595&action=review

>>> Tools/Scripts/webkitpy/common/system/executive.py:254
>>> +                        ("th32AccessKey", ctypes.c_long)]
>> 
>> I don't see these new members mentioned here: <http://msdn.microsoft.com/en-us/library/ms684839(v=vs.85).aspx>. Looks like they only exist in the WinCE version of the struct. So I think we need to detect whether we're on WinCE or not. Otherwise won't this break non-CE builds?
> 
> This is not related to WinCE!
> I try the get the native windows python test all pass on my windows box (german Windwos 7 Professional SP1 64bit).
> I tried different versions of this patch, but this is the only one which workded for me. :-/
> Any idea why the function fails on my box without the two additional members?

Hm, I wonder if we need to be using ctypes.c_wchar instead of ctypes.c_char for the szExeFile parameter? I can't tell from the code whether we're calling Process32FirstW or Process32FirstA.
Comment 5 Patrick R. Gansterer 2011-07-27 06:04:42 PDT
Comment on attachment 101595 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101595&action=review

>>>> Tools/Scripts/webkitpy/common/system/executive.py:254

>>> 
>>> I don't see these new members mentioned here: <http://msdn.microsoft.com/en-us/library/ms684839(v=vs.85).aspx>. Looks like they only exist in the WinCE version of the struct. So I think we need to detect whether we're on WinCE or not. Otherwise won't this break non-CE builds?
>> 
>> This is not related to WinCE!
>> I try the get the native windows python test all pass on my windows box (german Windwos 7 Professional SP1 64bit).
>> I tried different versions of this patch, but this is the only one which workded for me. :-/
>> Any idea why the function fails on my box without the two additional members?
> 
> Hm, I wonder if we need to be using ctypes.c_wchar instead of ctypes.c_char for the szExeFile parameter? I can't tell from the code whether we're calling Process32FirstW or Process32FirstA.

There is no Process32FirstA:
Form http://msdn.microsoft.com/en-us/library/ms684834%28v=vs.85%29.aspx:
Process32FirstW (Unicode) and Process32First (ANSI)

So I think we call the ansi version here. A ctypes.sizeof PROCESSENTRY32 also returns the same size as in C code.
Does this code work on your box with "natvie python"?
Comment 6 Patrick R. Gansterer 2011-07-31 12:04:53 PDT
Created attachment 102461 [details]
Patch

Seams to be a problem of 64bit python, not windows :-)
Comment 7 WebKit Review Bot 2011-08-02 07:11:17 PDT
Comment on attachment 102461 [details]
Patch

Clearing flags on attachment: 102461

Committed r92188: <http://trac.webkit.org/changeset/92188>
Comment 8 WebKit Review Bot 2011-08-02 07:11:22 PDT
All reviewed patches have been landed.  Closing bug.