lib/win32/process/structs.rb in win32-process-0.7.5 vs lib/win32/process/structs.rb in win32-process-0.8.0

- old
+ new

@@ -106,13 +106,113 @@ :dwPlatformId, :dword, :szCSDVersion, [:char, 128] ) end + class THREADENTRY32 < FFI::Struct + layout( + :dwSize, :dword, + :cntUsage, :dword, + :th32ThreadID, :dword, + :th32OwnerProcessID, :dword, + :tpBasePri, :long, + :tpDeltaPri, :long, + :dwFlags, :dword + ) + end + + class HEAPLIST32 < FFI::Struct + layout( + :dwSize, :size_t, + :th32ProcessID, :dword, + :th32HeapID, :uintptr_t, + :dwFlags, :dword + ) + end + + class HEAPENTRY32 < FFI::Struct + layout( + :dwSize, :size_t, + :hHandle, :handle, + :dwAddress, :uintptr_t, + :dwBlockSize, :size_t, + :dwFlags, :dword, + :dwLockCount, :dword, + :dwResvd, :dword, + :th32ProcessID, :dword, + :th32HeapID, :uintptr_t + ) + end + + class MODULEENTRY32 < FFI::Struct + layout( + :dwSize, :dword, + :th32ModuleID, :dword, + :th32ProcessID, :dword, + :GlblcntUsage, :dword, + :ProccntUsage, :dword, + :modBaseAddr, :pointer, + :modBaseSize, :dword, + :hModule, :handle, + :szModule, [:char, 256], + :szExePath, [:char, 260] + ) + end + + class PROCESSENTRY32 < FFI::Struct + layout( + :dwSize, :dword, + :cntUsage, :dword, + :th32ProcessID, :dword, + :th32DefaultHeapID, :uintptr_t, + :th32ModuleID, :dword, + :cntThreads, :dword, + :th32ParentProcessID, :dword, + :pcPriClassBase, :long, + :dwFlags, :dword, + :szExeFile, [:char, 260] + ) + end + # Used by Process.create + ProcessInfo = Struct.new("ProcessInfo", :process_handle, :thread_handle, :process_id, :thread_id + ) + + # Used by Process.snapshot + + ThreadSnapInfo = Struct.new("ThreadSnapInfo", + :thread_id, + :process_id, + :base_priority + ) + + HeapSnapInfo = Struct.new("HeapSnapInfo", + :address, + :block_size, + :flags, + :process_id, + :heap_id + ) + + ModuleSnapInfo = Struct.new("ModuleSnapInfo", + :process_id, + :address, + :module_size, + :handle, + :name, + :path + ) + + ProcessSnapInfo = Struct.new("ProcessSnapInfo", + :process_id, + :threads, + :parent_process_id, + :priority, + :flags, + :path ) end