Rik78
You can use this with SetSystemMemoryDivision() along with GetDiskFreeSpaceExW, so you know how much program memory you can assign to your program.
Here is what works on my WinCe 5.0 device.
These are the declarations:
Declare Function SetSystemMemoryDivision Lib "coredll.dll" (ByVal pages As Integer) As Integer
Declare Function GetDiskFreeSpaceExW Lib "coredll.dll" (ByVal lpRootPathName As String, _
ByRef lpFreeBytesAvailableToCaller As Long, ByRef lpTotalNumberOfBytes _
As Long, ByRef lpTotalNumberOfFreeBytes As Long) As Boolean
How to use:
' 1 Memory Page is 4K.
' To set total storage memory to 4352 KB, it is 4352 / 4 = 1088 memory pages
' 0 - memory division was changes successfully
' 1 - need reboot to accept memory division changes
' 2 - cannot change memory division because the system should be rebooted after the previous call before
' 3 - changes failed. You can call GetLastError to get more detailed information
Dim i As Integer = SetSystemMemoryDivision(1088)
Dim lResult As Boolean
Dim liAvailable As Long
Dim liTotal As Long
Dim liFree As Long
'Determine the Available Space, Total Size and Free Space of a drive
lResult = GetDiskFreeSpaceExW(
"\WINDOWS\", liAvailable, liTotal, liFree)