CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2016
    Posts
    2

    CreateFileMapping + NtExtendSection

    Hi,
    Do someone have an example of CreateFileMapping + NtExtendSection
    I'm create a section with CreateFileMapping (PAGE_READWRITE | SEC_RESERVE) with a handle to a file, I'm trying to extend this section

    Thanks for your help

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: CreateFileMapping + NtExtendSection

    What do you hope to accomplish by using the undocumented NtExtendSection function?

  3. #3
    Join Date
    Jun 2016
    Posts
    2

    Re: CreateFileMapping + NtExtendSection

    I want to extend my section (first allocation of a little size), I don't want to use too much of memory inside my app in fact...
    I don't know if it's possible to use it with CreateFileMapping but if someone have an example it would be cool
    Thanks

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: CreateFileMapping + NtExtendSection

    Another approach that doesn't use an undocumented api is to simply call CreateFileMapping with a -1 as the file handle parameter. This will back the mapping using the page file rather than a physical file. See msdn for details.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured