当前位置: 首页>>代码示例>>C++>>正文


C++ EngFreeMem函数代码示例

本文整理汇总了C++中EngFreeMem函数的典型用法代码示例。如果您正苦于以下问题:C++ EngFreeMem函数的具体用法?C++ EngFreeMem怎么用?C++ EngFreeMem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了EngFreeMem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrvDisablePDEV

VOID DrvDisablePDEV(DHPDEV dhpdev)
{
    PPDEV   ppdev;

    ppdev = (PPDEV) dhpdev;

    DISPDBG((2, "disabling PDEV\n"));

    EngDeletePalette(devinfoVGA.hpalDefault);

// Free the preallocated saved screen bits buffer, if there is one.

    if (ppdev->pjPreallocSSBBuffer != NULL)
    {
        EngFreeMem(ppdev->pjPreallocSSBBuffer);
    }

// Free the conversion table buffer

    if (ppdev->pucDIB4ToVGAConvBuffer != NULL)
    {
        EngFreeMem(ppdev->pucDIB4ToVGAConvBuffer);
    }

// Delete the PDEV

    EngFreeMem(dhpdev);

    DISPDBG((2, "disabled PDEV\n"));

}
开发者ID:Gaikokujin,项目名称:WinNT4,代码行数:31,代码来源:enable.c

示例2: FtfdUnloadFontFile

BOOL
APIENTRY
FtfdUnloadFontFile(
    IN ULONG_PTR iFile)
{
    PFTFD_FILE pfile = (PFTFD_FILE)iFile;
    ULONG i;

    DbgPrint("FtfdUnloadFontFile()\n");

    // HACK!!!
    EngFreeMem(pfile->pvView);

    /* Cleanup faces */
    for (i = 0; i < pfile->cNumFaces; i++)
    {
        FT_Done_Face(pfile->aftface[i]);
    }

    /* Unmap the font file */
    EngUnmapFontFileFD(pfile->iFile);

    /* Free the memory that was allocated for the font */
    EngFreeMem(pfile);

    return TRUE;
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:27,代码来源:font.c

示例3: DrvGetModes

ULONG APIENTRY
DrvGetModes(
   IN HANDLE hDriver,
   IN ULONG cjSize,
   OUT DEVMODEW *pdm)
{
   ULONG ModeCount;
   ULONG ModeInfoSize;
   PVIDEO_MODE_INFORMATION ModeInfo, ModeInfoPtr;
   ULONG OutputSize;

   ModeCount = GetAvailableModes(hDriver, &ModeInfo, &ModeInfoSize);
   if (ModeCount == 0)
   {
      return 0;
   }

   if (pdm == NULL)
   {
      EngFreeMem(ModeInfo);
      return ModeCount * sizeof(DEVMODEW);
   }

   /*
    * Copy the information about supported modes into the output buffer.
    */

   OutputSize = 0;
   ModeInfoPtr = ModeInfo;

   while (ModeCount-- > 0)
   {
      if (ModeInfoPtr->Length == 0)
      {
         ModeInfoPtr = (PVIDEO_MODE_INFORMATION)(((ULONG_PTR)ModeInfoPtr) + ModeInfoSize);
         continue;
      }

      memset(pdm, 0, sizeof(DEVMODEW));
      memcpy(pdm->dmDeviceName, DEVICE_NAME, sizeof(DEVICE_NAME));
      pdm->dmSpecVersion =
      pdm->dmDriverVersion = DM_SPECVERSION;
      pdm->dmSize = sizeof(DEVMODEW);
      pdm->dmDriverExtra = 0;
      pdm->dmBitsPerPel = ModeInfoPtr->NumberOfPlanes * ModeInfoPtr->BitsPerPlane;
      pdm->dmPelsWidth = ModeInfoPtr->VisScreenWidth;
      pdm->dmPelsHeight = ModeInfoPtr->VisScreenHeight;
      pdm->dmDisplayFrequency = ModeInfoPtr->Frequency;
      pdm->dmDisplayFlags = 0;
      pdm->dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT |
                      DM_DISPLAYFREQUENCY | DM_DISPLAYFLAGS;

      ModeInfoPtr = (PVIDEO_MODE_INFORMATION)(((ULONG_PTR)ModeInfoPtr) + ModeInfoSize);
      pdm = (LPDEVMODEW)(((ULONG_PTR)pdm) + sizeof(DEVMODEW));
      OutputSize += sizeof(DEVMODEW);
   }

   EngFreeMem(ModeInfo);
   return OutputSize;
}
开发者ID:GYGit,项目名称:reactos,代码行数:60,代码来源:screen.c

示例4: EngFreeSectionMem

BOOL
APIENTRY
EngFreeSectionMem(
    IN PVOID pvSection OPTIONAL,
    IN PVOID pvMappedBase OPTIONAL)
{
    NTSTATUS Status;
    PENGSECTION pSection = pvSection;
    BOOL bResult = TRUE;

    /* Did the caller give us a mapping base? */
    if (pvMappedBase)
    {
        Status = MmUnmapViewInSessionSpace(pvMappedBase);
        if (!NT_SUCCESS(Status))
        {
            DPRINT1("MmUnmapViewInSessionSpace failed: 0x%lx\n", Status);
            bResult = FALSE;
        }
    }

    /* Check if we should free the section as well */
    if (pSection)
    {
        /* Dereference the kernel section */
        ObDereferenceObject(pSection->pvSectionObject);

        /* Finally free the section memory itself */
        EngFreeMem(pSection);
    }

    return bResult;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:33,代码来源:mapping.c

示例5: GdiPoolDestroy

VOID
NTAPI
GdiPoolDestroy(PGDI_POOL pPool)
{
    PGDI_POOL_SECTION pSection;
    PLIST_ENTRY ple;

    /* Loop all empty sections, removing them */
    while (!IsListEmpty(&pPool->leEmptyList))
    {
        /* Delete the section */
        ple = RemoveHeadList(&pPool->leEmptyList);
        pSection = CONTAINING_RECORD(ple, GDI_POOL_SECTION, leInUseLink);
        GdiPoolDeleteSection(pPool, pSection);
    }

    /* Loop all ready sections, removing them */
    while (!IsListEmpty(&pPool->leInUseList))
    {
        /* Delete the section */
        ple = RemoveHeadList(&pPool->leInUseList);
        pSection = CONTAINING_RECORD(ple, GDI_POOL_SECTION, leInUseLink);
        GdiPoolDeleteSection(pPool, pSection);
    }

    DBG_CLEANUP_EVENT_LIST(&pPool->slhLog);

    EngFreeMem(pPool);
}
开发者ID:RPG-7,项目名称:reactos,代码行数:29,代码来源:gdipool.c

示例6: DrvDisableDriver

VOID
DrvDisableDriver(
    VOID
    )
{
   EngFreeMem(gpgset);
}
开发者ID:Gaikokujin,项目名称:WinNT4,代码行数:7,代码来源:enable.c

示例7: GdiPoolDeleteSection

static
VOID
GdiPoolDeleteSection(PGDI_POOL pPool, PGDI_POOL_SECTION pSection)
{
    NTSTATUS status;
    SIZE_T cjSize = 0;

    /* Should not have any allocations */
    if (pSection->cAllocCount != 0)
    {
        DPRINT1("There are %lu allocations left, section=%p, pool=%p\n",
                pSection->cAllocCount, pSection, pPool);
        DBG_DUMP_EVENT_LIST(&pPool->slhLog);
        ASSERT(FALSE);
    }

    /* Release the virtual memory */
    status = ZwFreeVirtualMemory(NtCurrentProcess(),
                                 &pSection->pvBaseAddress,
                                 &cjSize,
                                 MEM_RELEASE);
    ASSERT(NT_SUCCESS(status));

    /* Free the section object */
    EngFreeMem(pSection);
}
开发者ID:RPG-7,项目名称:reactos,代码行数:26,代码来源:gdipool.c

示例8: DrvDeleteDeviceBitmap

VOID DrvDeleteDeviceBitmap(
DHSURF  dhsurf)
{
    DSURF*   pdsurf;
    PDEV*    ppdev;
    SURFOBJ* psoDib;
    HSURF    hsurfDib;

    pdsurf = (DSURF*) dhsurf;
    ppdev  = pdsurf->ppdev;

    if (pdsurf->dt == DT_SCREEN)
    {
        pohFree(ppdev, pdsurf->poh);
    }
    else
    {
        ASSERTDD(pdsurf->dt == DT_DIB, "Expected DIB type");

        psoDib = pdsurf->pso;

        // Get the hsurf from the SURFOBJ before we unlock it (it's not
        // legal to dereference psoDib when it's unlocked):

        hsurfDib = psoDib->hsurf;
        EngUnlockSurface(psoDib);
        EngDeleteSurface(hsurfDib);
    }

    EngFreeMem(pdsurf);
}
开发者ID:Gaikokujin,项目名称:WinNT4,代码行数:31,代码来源:heap.c

示例9: EngDeleteClip

/*
 * @implemented
 */
VOID
APIENTRY
EngDeleteClip(
    _In_ _Post_ptr_invalid_ CLIPOBJ *pco)
{
    EngFreeMem(ObjToGDI(pco, CLIP));
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:10,代码来源:clip.c

示例10: EBRUSHOBJ_vCleanup

VOID
NTAPI
EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
{
    /* Check if there's a GDI realisation */
    if (pebo->pengbrush)
    {
        /* Unlock the bitmap again */
        SURFACE_ShareUnlockSurface(pebo->pengbrush);
        pebo->pengbrush = NULL;
    }

    /* Check if there's a driver's realisation */
    if (pebo->BrushObject.pvRbrush)
    {
        /* Free allocated driver memory */
        EngFreeMem(pebo->BrushObject.pvRbrush);
        pebo->BrushObject.pvRbrush = NULL;
    }

    if (pebo->psoMask != NULL)
    {
        SURFACE_ShareUnlockSurface(pebo->psoMask);
        pebo->psoMask = NULL;
    }

    /* Dereference the palettes */
    PALETTE_ShareUnlockPalette(pebo->ppalSurf);
    PALETTE_ShareUnlockPalette(pebo->ppalDC);
    if (pebo->ppalDIB) PALETTE_ShareUnlockPalette(pebo->ppalDIB);
}
开发者ID:GYGit,项目名称:reactos,代码行数:31,代码来源:engbrush.c

示例11: IntEngUpdateClipRegion

VOID
FASTCALL
IntEngUpdateClipRegion(
    XCLIPOBJ* Clip,
    ULONG count,
    const RECTL* pRect,
    const RECTL* rcBounds)
{
    if(count > 1)
    {
        RECTL* NewRects = EngAllocMem(0, FIELD_OFFSET(ENUMRECTS, arcl[count]), GDITAG_CLIPOBJ);

        if(NewRects != NULL)
        {
            Clip->RectCount = count;
            Clip->EnumOrder = CD_ANY;
            RtlCopyMemory(NewRects, pRect, count * sizeof(RECTL));

            Clip->ClipObj.iDComplexity = DC_COMPLEX;
            Clip->ClipObj.iFComplexity = ((Clip->RectCount <= 4) ? FC_RECT4 : FC_COMPLEX);
            Clip->ClipObj.iMode = TC_RECTANGLES;
            Clip->ClipObj.rclBounds = *rcBounds;

            if (Clip->Rects != &Clip->ClipObj.rclBounds)
                EngFreeMem(Clip->Rects);
            Clip->Rects = NewRects;
        }
    }
    else
    {
        Clip->EnumOrder = CD_ANY;

        Clip->ClipObj.iDComplexity = (((rcBounds->top == rcBounds->bottom) &&
                                     (rcBounds->left == rcBounds->right))
                                     ? DC_TRIVIAL : DC_RECT);

        Clip->ClipObj.iFComplexity = FC_RECT;
        Clip->ClipObj.iMode = TC_RECTANGLES;
        Clip->ClipObj.rclBounds = *rcBounds;
        Clip->RectCount = 1;
        if (Clip->Rects != &Clip->ClipObj.rclBounds)
            EngFreeMem(Clip->Rects);
        Clip->Rects = &Clip->ClipObj.rclBounds;
    }
}
开发者ID:RPG-7,项目名称:reactos,代码行数:45,代码来源:clip.c

示例12: BmfdDestroyFont

VOID
APIENTRY
BmfdDestroyFont(
    IN FONTOBJ *pfo)
{
    /* Free the font realization info */
    EngFreeMem(pfo->pvProducer);
    pfo->pvProducer = NULL;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:9,代码来源:font.c

示例13: POLYGONFILL_MakeEdgeList

FASTCALL
POLYGONFILL_MakeEdgeList(PPOINT Points, int Count)
{
  int CurPt = 0;
  FILL_EDGE_LIST* list = 0;
  FILL_EDGE* e = 0;

  if ( 0 == Points || 2 > Count )
    return 0;

  list = (FILL_EDGE_LIST*)EngAllocMem(FL_ZERO_MEMORY, sizeof(FILL_EDGE_LIST), FILL_EDGE_ALLOC_TAG);
  if ( 0 == list )
    goto fail;
  list->Count = 0;
  list->Edges = (FILL_EDGE**)EngAllocMem(FL_ZERO_MEMORY, Count*sizeof(FILL_EDGE*), FILL_EDGE_ALLOC_TAG);
  if ( !list->Edges )
    goto fail;
  memset ( list->Edges, 0, Count * sizeof(FILL_EDGE*) );

  for ( CurPt = 1; CurPt < Count; ++CurPt )
  {
    e = POLYGONFILL_MakeEdge ( Points[CurPt-1], Points[CurPt] );
    if ( !e )
      goto fail;
    // if a straight horizontal line - who cares?
    if ( !e->absdy )
      EngFreeMem ( e );
    else
      list->Edges[list->Count++] = e;
  }
  e = POLYGONFILL_MakeEdge ( Points[CurPt-1], Points[0] );
  if ( !e )
    goto fail;
  if ( !e->absdy )
    EngFreeMem ( e );
  else
    list->Edges[list->Count++] = e;
  return list;

fail:
  DPRINT1("Out Of MEMORY!!\n");
  POLYGONFILL_DestroyEdgeList ( list );
  return 0;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:44,代码来源:polytest.cpp

示例14: TestFdUnloadFontFileTE

BOOL
TestFdUnloadFontFileTE (
    HFF hff
    )
{
    if (hff)
        EngFreeMem((PVOID)hff);

    return TRUE;
}
开发者ID:Gaikokujin,项目名称:WinNT4,代码行数:10,代码来源:enable.c

示例15: VBoxDispDrvDisablePDEV

/* Called to free resources allocated for device in VBoxDispDrvEnablePDEV */
VOID APIENTRY VBoxDispDrvDisablePDEV(DHPDEV dhpdev)
{
    LOGF_ENTER();

    VBoxDispDestroyPalette((PVBOXDISPDEV) dhpdev);

    EngFreeMem(dhpdev);

    LOGF_LEAVE();
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:11,代码来源:VBoxDispDriver.cpp


注:本文中的EngFreeMem函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。