Re: Acquiring process handle and convert it into PID

eryk sun <[email protected]> Thu, 1 Dec 2016 02:10:45 +0000
Newsgroups gmane.comp.python.ctypes
Message-ID <CACL+1avDFX-DZiJPvVbaTkdrxwBRC7zQmaGHG9b_oYv1BE6JGQ@mail.gmail.com>
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;

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