Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. virtual memory

virtual memory

Scheduled Pinned Locked Moved Managed C++/CLI
performancehelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mpapeo
    wrote on last edited by
    #1

    Please help me with this. I want to extract the information about subsequent pages using this function VirtualQuertEx()but i don't how i can go about it. PROCESS_INFORMATION pi; STARTUPINFO si; HANDLE hProcess; BYTE buf[20000]; DWORD NumberOfBytesRead = 0; DWORD bufsize = sizeof buf; DWORD baseaddr = 0; DWORD lpAddr = 0; PMEMORY_BASIC_INFORMATION lpBuffer = 0; DWORD dwLength = 200000;/****/ DWORD flNewProtect =0; PDWORD lpflOldProtect = 0; DWORD dwSize =0; LPCVOID lpBaseAddress = 0; DWORD nSize = 0; VirtualQueryEx( hProcess, // handle to process &lpAddr, // address of region buf,// address of information buffer sizeof (MEMORY_BASIC_INFORMATION));// size of buffer VirtualProtectEx( hProcess, // handle to process lpAddr, // address of region of committed pages dwSize, // size of region flNewProtect, // desired access protection lpflOldProtect );// address of variable to get old protection ZeroMemory(buf, sizeof(buf)); if( ReadProcessMemory( hProcess, lpBaseAddress, buf, bufsize, &NumberOfBytesRead ) == FALSE ) { printf("\nProcess ID %d ",pi.dwProcessId); printf (" memory read failed (errcode: %d)", GetLastError()); } else { printf("\nProcess ID %d ",pi.dwProcessId); printf("memory read: \n",buf); GetLastError()); } How can i retrieve the buff size from that function oam

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups