18.11.2014 Views

Using Virtual Memory in your application

Using Virtual Memory in your application

Using Virtual Memory in your application

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

論<br />

• , <strong>Virtual</strong>Alloc 來 <br />

• granularity boundary (64KB) <br />

1<br />

void ma<strong>in</strong>(){<br />

64 KB 說 <br />

300 300 ** 64 64 K + 8192 8192<br />

PVOID buffer=<strong>Virtual</strong>Alloc((LPVOID)(300 * 65536+8192),<br />

64*1024,MEM_RESERVE,<br />

PAGE_READWRITE);<br />

if(buffer==NULL)<br />

ShowError();<br />

}<br />

2<br />

300 300 ** 64 64 K <br />

(8192 (8192 ) )

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!