What win32 APIs are useful to code a tool as described here:
My goal is a tool that can be used to check/report if a specific part of a file is located/available in-memory (RAM) or in virtual memory (disk) at a moment ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
VirtualQueryQueryWorkingSetEx does that, specifically the Locked bit in PSAPI_WORKING_SET_EX_BLOCK. VirtualQuery as I’ve incorrectly pointed out initially merely lets you tell whether pages are committed and such, not whether they’re actually in physical RAM. For Linux, it would be mincore, which simply returns a byte vector (LSB == 1 for in-core).Note that the information you get is a snapshot, which means the information may in principle already be outdated at the time the function returns (much like GetCurrentProcessorNumber).
So, treat the information as a (probably more or less accurate, but unreliable) hint, not a guarantee.