Re: Acquiring process handle and convert it into PID

[email protected] Wed, 30 Nov 2016 18:42:02 -0800
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
ok!

Sent from my iPhone

> On Nov 30, 2016, at 6:10 PM, eryk sun <[email protected]> wrote:
> 
> On Wed, Nov 30, 2016 at 11:13 PM, Michael C
> <[email protected]> wrote:
>> I get it now! Reading MSDN is a merit on its own!
>> 
>> So this is the same thing right?
> 
> [...]
> 
>> # this part
>> pid = ctypes.c_ulong()
> 
> Yes, a DWORD is a c_ulong (i.e. C unsigned long):
> 
>>>> from ctypes import wintypes
>>>> wintypes.DWORD
>    <class 'ctypes.c_ulong'>
> 
> When in doubt, refer to the following MSDN page that lists common
> Windows data types:
> 
> https://msdn.microsoft.com/en-us/library/aa383751
> 
> In C, DWORD is defined as follows:
> 
>    typedef unsigned long DWORD;

------------------------------------------------------------------------------