[pywin32-checkins] pywin32/win32/src win32apimodule.cpp,1.88,1.89
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-08-10 13:13:18
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5469/win32/src Modified Files: win32apimodule.cpp Log Message: add win32api.GetNativeSystemInfo() Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** win32apimodule.cpp 25 Jul 2008 01:10:10 -0000 1.88 --- win32apimodule.cpp 10 Aug 2008 13:13:21 -0000 1.89 *************** *** 58,61 **** --- 58,63 ---- typedef BOOL (WINAPI *SetSystemPowerStatefunc)(BOOL, BOOL); static SetSystemPowerStatefunc pfnSetSystemPowerState = NULL; + typedef BOOL (WINAPI *GetNativeSystemInfofunc)(LPSYSTEM_INFO); + static GetNativeSystemInfofunc pfnGetNativeSystemInfo = NULL; // from secur32.dll *************** *** 2076,2084 **** GetSystemInfo( &info ); return Py_BuildValue("iiNNNiii(HH)", ! #if !defined(MAINWIN) ! info.dwOemId, ! #else ! 0, ! #endif // MAINWIN info.dwPageSize, PyWinLong_FromVoidPtr(info.lpMinimumApplicationAddress), --- 2078,2082 ---- GetSystemInfo( &info ); return Py_BuildValue("iiNNNiii(HH)", ! info.wProcessorArchitecture, info.dwPageSize, PyWinLong_FromVoidPtr(info.lpMinimumApplicationAddress), *************** *** 2090,2098 **** // @rdesc The return value is a tuple of 9 values, which corresponds // to the Win32 SYSTEM_INFO structure. The element names are: ! // <nl>dwOemId<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl> // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) } // @pymethod int|win32api|GetSystemMetrics|Retrieves various system metrics and system configuration settings. static PyObject * --- 2088,2123 ---- // @rdesc The return value is a tuple of 9 values, which corresponds // to the Win32 SYSTEM_INFO structure. The element names are: ! // <nl>wProcessorArchitecture<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl> // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) } + // @pymethod tuple|win32api|GetNativeSystemInfo|Retrieves information about the current system for a Wow64 process. + static PyObject * + PyGetNativeSystemInfo(PyObject * self, PyObject * args) + { + CHECK_PFN(SetSystemPowerState); + if (!PyArg_ParseTuple(args, ":GetNativeSystemInfo")) + return NULL; + // @pyseeapi GetNativeSystemInfo + SYSTEM_INFO info; + (*pfnGetNativeSystemInfo)( &info ); + return Py_BuildValue("iiNNNiii(HH)", + info.wProcessorArchitecture, + info.dwPageSize, + PyWinLong_FromVoidPtr(info.lpMinimumApplicationAddress), + PyWinLong_FromVoidPtr(info.lpMaximumApplicationAddress), + PyLong_FromUnsignedLongLong(info.dwActiveProcessorMask), + info.dwNumberOfProcessors, + info.dwProcessorType, info.dwAllocationGranularity, + info.wProcessorLevel, info.wProcessorRevision); + // @rdesc The return value is a tuple of 9 values, which corresponds + // to the Win32 SYSTEM_INFO structure. The element names are: + // <nl>wProcessorArchitecture<nl>dwPageSize<nl>lpMinimumApplicationAddress<nl>lpMaximumApplicationAddress<nl> + // dwActiveProcessorMask<nl>dwNumberOfProcessors<nl> + // dwProcessorType<nl>dwAllocationGranularity<nl>(wProcessorLevel,wProcessorRevision) + } + + // @pymethod int|win32api|GetSystemMetrics|Retrieves various system metrics and system configuration settings. static PyObject * *************** *** 6041,6044 **** --- 6066,6070 ---- {"SetSystemFileCacheSize", (PyCFunction)PySetSystemFileCacheSize, METH_KEYWORDS|METH_VARARGS}, // @pymeth SetSystemFileCacheSize|Sets the amount of memory reserved for file cache {"GetSystemInfo", PyGetSystemInfo, 1}, // @pymeth GetSystemInfo|Retrieves information about the current system. + {"GetNativeSystemInfo", PyGetNativeSystemInfo, 1}, // @pymeth GetNativeSystemInfo|Retrieves information about the current system for a Wow64 process. {"GetSystemMetrics", PyGetSystemMetrics, 1}, // @pymeth GetSystemMetrics|Returns the specified system metrics. {"GetSystemTime", PyGetSystemTime, 1}, // @pymeth GetSystemTime|Returns the current system time. *************** *** 6254,6257 **** --- 6280,6284 ---- pfnSetDllDirectory=(SetDllDirectoryfunc)GetProcAddress(hmodule,"SetDllDirectoryW"); pfnSetSystemPowerState=(SetSystemPowerStatefunc)GetProcAddress(hmodule,"SetSystemPowerState"); + pfnGetNativeSystemInfo=(GetNativeSystemInfofunc)GetProcAddress(hmodule,"GetNativeSystemInfo"); } |