[python-win32] Calling random Windows function?

Christopher Nilsson chris at slort.org
Fri Oct 23 05:12:24 CEST 2009


Yep, that will give you an AttributeError...

You want to be looking in "ntdll", not kernel32.

eg. ctypes.windll.ntdll.NtQuerySystemInformation

But that's only to get you partway there.  Next you'll need to
implement the SYSTEM_INFORMATION_CLASS structures, to provide as
parameters.

MSDN has some info on this function:
http://msdn.microsoft.com/en-us/library/ms724509(VS.85).aspx

But, wow... Just starting with windows programming, and jumping right
into the semi-documented territory.  Brave. :)


2009/10/23 Aahz <aahz at pythoncraft.com>:
> I'm just getting into Windows programming for the first time, and I need
> to list all open files.  Windows has a convenient function for that
> (NtQuerySystemInformation), but I can't figure out how I am supposed to
> call it.  I bought of copy of the Win32 book and I can't find anything
> about accessing random API calls;
> ctypes.windll.kernel32.NtQuerySystemInformation gives an AttributeError.
>
> Where should I be looking to figure this out?
> --
> Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/
>
> Member of the Groucho Marx Fan Club
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>


More information about the python-win32 mailing list