1
2
3
4 package org.sirius.server.win32.classes;
5
6 import org.sirius.server.win32.constants.IMEMConsts;
7
8 import com.sun.jna.Structure;
9 import com.sun.jna.platform.win32.WinDef.DWORD;
10
11
12
13
14
15 public class Kernel extends Common implements IMEMConsts {
16
17
18
19
20 public Kernel() {
21
22 }
23
24
25
26
27
28 public void VirtualAllocateMemory(final Structure struct) {
29 getKernel32().VirtualAllocEx(getKernel32().GetCurrentProcess(),
30 struct.getPointer(), struct.size(), new DWORD(MEM_COMMIT),
31 new DWORD(MEM_LARGE_PAGES));
32 }
33
34
35
36
37
38 public void VirtualFreeMemory(final Structure struct) {
39 getKernel32().VirtualFreeEx(getKernel32().GetCurrentProcess(),
40 struct.getPointer(), struct.size(), new DWORD(MEM_DECOMMIT));
41 }
42 }