'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 31 January 2006 at 6:36:56 pm'! "Change Set: FFIWin Date: 31 January 2006 Author: Boris Gaertner "! ExternalStructure subclass: #Win32ProcessMemoryCounters instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'FFI-Examples-Win32'! !Win32ProcessMemoryCounters commentStamp: 'BG 1/31/2006 18:36' prior: 0! Evaluate this to obtain memory usage information : (for additional information, search the web for these keywords: PROCESS_MEMORY_COUNTERS GetProcessMemoryInfo ) | interface process memRec | interface := Win32Window new. process := interface apiGetCurrentProcess. memRec := Win32ProcessMemoryCounters new. interface apiGetProcessMemoryInfoFor: process into: memRec descriptorSize: memRec class byteSize. memRec inspect! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:20'! PageFaultCount "This method was automatically generated" ^handle signedLongAt: 5! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:22'! PagefileUsage "This method was automatically generated" ^handle signedLongAt: 33! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:22'! PeakPagefileUsage "This method was automatically generated" ^handle signedLongAt: 37! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:21'! PeakWorkingSetSize "This method was automatically generated" ^handle signedLongAt: 9! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:22'! QuotaNonPagedPoolUsage "This method was automatically generated" ^handle signedLongAt: 29! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:21'! QuotaPagedPoolUsage "This method was automatically generated" ^handle signedLongAt: 21! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:22'! QuotaPeakNonPagedPoolUsage "This method was automatically generated" ^handle signedLongAt: 25! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:21'! QuotaPeakPagedPoolUsage "This method was automatically generated" ^handle signedLongAt: 17! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:21'! WorkingSetSize "This method was automatically generated" ^handle signedLongAt: 13! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:18'! cb "This method was automatically generated" ^handle signedLongAt: 1! ! !Win32ProcessMemoryCounters methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:23'! longPrintString ^super longPrintString! ! !Win32ProcessMemoryCounters class methodsFor: 'accessing' stamp: 'BG 1/31/2006 18:12'! fields "POINT defineFields" ^#( (cb 'long') (PageFaultCount 'long') (PeakWorkingSetSize 'ulong') ( WorkingSetSize 'ulong') ( QuotaPeakPagedPoolUsage 'ulong') ( QuotaPagedPoolUsage 'ulong') ( QuotaPeakNonPagedPoolUsage 'ulong') ( QuotaNonPagedPoolUsage 'ulong') ( PagefileUsage 'ulong') ( PeakPagefileUsage 'ulong') )! ! !Win32Window methodsFor: 'api calls' stamp: 'BG 1/31/2006 16:53'! apiGetCurrentProcess ^self externalCallFailed! ! !Win32Window methodsFor: 'api calls' stamp: 'BG 1/31/2006 16:48'! apiGetCurrentProcessId ^self externalCallFailed! ! !Win32Window methodsFor: 'api calls' stamp: 'BG 1/31/2006 17:00'! apiGetGuiResources: h type: int ^self externalCallFailed! ! !Win32Window methodsFor: 'api calls' stamp: 'BG 1/31/2006 17:34'! apiGetProcessMemoryInfoFor: processHnd into: ppsMemCounters descriptorSize: size ^self externalCallFailed! ! !Win32ProcessMemoryCounters class reorganize! ('accessing' fields) ! !Win32ProcessMemoryCounters reorganize! ('accessing' PageFaultCount PagefileUsage PeakPagefileUsage PeakWorkingSetSize QuotaNonPagedPoolUsage QuotaPagedPoolUsage QuotaPeakNonPagedPoolUsage QuotaPeakPagedPoolUsage WorkingSetSize cb longPrintString) !