ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

PWIN32HEAP UserCreateHeap ( OUT PSECTION_OBJECT *  SectionObject,
IN OUT PVOID SystemBase,
IN SIZE_T  HeapSize 
)

Definition at line 170 of file usrheap.c.

Referenced by DriverEntry(), and NtUserCreateDesktop().

{
    LARGE_INTEGER SizeHeap;
    PWIN32HEAP pHeap = NULL;
    NTSTATUS Status;

    SizeHeap.QuadPart = HeapSize;

    /* Create the section and map it into session space */
    Status = MmCreateSection((PVOID*)SectionObject,
                             SECTION_ALL_ACCESS,
                             NULL,
                             &SizeHeap,
                             PAGE_EXECUTE_READWRITE, /* Would prefer PAGE_READWRITE, but thanks to RTL heaps... */
                             SEC_RESERVE,
                             NULL,
                             NULL);

    if (!NT_SUCCESS(Status))
    {
        SetLastNtError(Status);
        return FALSE;
    }

    Status = MmMapViewInSystemSpace(*SectionObject,
                                    SystemBase,
                                    &HeapSize);
    if (!NT_SUCCESS(Status))
    {
        ObDereferenceObject(*SectionObject);
        *SectionObject = NULL;

        SetLastNtError(Status);
        return FALSE;
    }

    /* Create the heap */
    pHeap = IntUserHeapCreate(*SectionObject,
                              SystemBase,
                              HeapSize);

    if (pHeap == NULL)
    {
        ObDereferenceObject(*SectionObject);
        *SectionObject = NULL;

        SetLastNtError(STATUS_UNSUCCESSFUL);
    }

    return pHeap;
}

Generated on Fri May 25 2012 06:09:22 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.