Skip to content

Commit 7446517

Browse files
committed
Add type parameter for WinProcess.virtual_alloc
1 parent 1481e9c commit 7446517

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

windows/winobject/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,13 +1106,13 @@ def __repr__(self):
11061106
pass
11071107
return urepr_encode(u'<{0} "{1}" pid {2} at {3}>'.format(self.__class__.__name__, exe_name, self.pid, hex(id(self))))
11081108

1109-
def virtual_alloc(self, size, prot=PAGE_EXECUTE_READWRITE, addr=None):
1109+
def virtual_alloc(self, size, prot=PAGE_EXECUTE_READWRITE, addr=None, type=gdef.MEM_COMMIT):
11101110
"""Allocate memory in the process
11111111
11121112
:return: The address of the allocated memory
11131113
:rtype: :class:`int`
11141114
"""
1115-
return winproxy.VirtualAllocEx(self.handle, lpAddress=addr, dwSize=size, flProtect=prot)
1115+
return winproxy.VirtualAllocEx(self.handle, lpAddress=addr, dwSize=size, flAllocationType=type, flProtect=prot)
11161116

11171117
def virtual_free(self, addr):
11181118
"""Free memory in the process by virtual_alloc"""

0 commit comments

Comments
 (0)