(Currently with 6.12 LTS Version, X64, Threadsafe):
I have a shared module using a DataSection, that I use for multiple projects with different info. Today on an older project, i get an error when error trying to write to the data. I tried other projects using the same code, no issues. I manually added code to change access mode to read+write, and it works now:
Code: Select all
Procedure DALAPI_LoadAll(*ptrData)
Define.MEMORY_BASIC_INFORMATION MBI
If VirtualQuery_(*ptrData, @MBI, SizeOf(MEMORY_BASIC_INFORMATION))
Define.i xLong1
If MBI\Protect = #PAGE_READONLY ; Or MBI\Protect = PAGE_WRITECOPY
; Debug "Setting Memory Protection to read-write"
VirtualProtect_(MBI\BaseAddress, MBI\RegionSize, #PAGE_READWRITE, @xLong1)
ElseIf MBI\Protect = #PAGE_EXECUTE_READ ; Or MBI\Protect = PAGE_EXECUTE_WRITECOPY
; Debug "Setting Memory Protection to read-write"
VirtualProtect_(MBI\BaseAddress, MBI\RegionSize, #PAGE_EXECUTE_READWRITE, @xLong1)
EndIf
EndIf
(previous unmodified code)
