![]() |
|
QA: How can I change memory allocated between storage and program programmatically?
By Vassili Philippov, September 17, 2001.
QuestionI need to change memory division between storage and RAM like in the Main applet of the Control Panel. How it can be done? AnswerThere is a SetSystemMemoryDivision function in coredll.dll library for that. This function sets number of memory pages for storage. Use GetSystemMemoryDivision function to get memory page size. Here are signatures of these two functions: SetSystemMemoryDivisionThis function takes one argument - size of storage in memory pages. It returns result code that could be:
GetSystemMemoryDivisionThis function returns 3 DWORD values and result code. The first parameter is a pointer to a variable that will contain number of memory pages allocated for storage. The second parameter is a pointer to a variable that will contain number of memory pages allocated for RAM. The third parameter is a pointer to a variable that will contain size of one memory page in bytes. coredll.dllTo use these two functions you should load coredll.dll library using LoadLibrary function and get functions addresses using GetProcAddress function. Here is a sample code for that: EmulatorNote: SetSystemMemoryDivision function does not work on Pocket PC Emulator. Sample applicationYou can download a sample application (42 Kb) that shows working with SetSystemMemoryDivision and GetSystemMemoryDivision functions. Related resources:
DiscussDiscuss this article. Here you can write your comments and read comments of other developers. |
|||||||||||||||||||||