Two functions allocated in virtual memory

xiaoxiao2021-03-06  46

one is

Virtualallocc, Function prototype:

LPVOID Virtualalloc (LPVOID LPADDRESS, DWORD DWSIZE, DWORD FLALLOCTIONTYPETYPETYPETYPETYPETYPETYPE, DWORD FLPROTECT); if the first parameter is NULL, the allocated memory must be a memory start address of 64K, even if you only assign a word

Section.

the other is

Localalloc, function prototype

Hlocal Localaloc (uint uflags, uint ubytes); this is more user-friendly, and does not assign memory with 64K as a zone, usually use this time

It is better.

After dynamic allocation, don't forget to release, corresponding to the two memory allocation functions, the released functions are VirtualFree, respectively, respectively.

Localfree.

转载请注明原文地址:https://www.9cbs.com/read-55281.html

New Post(0)