首页
社区
课程
招聘
[原创]找bug
发表于: 2015-7-22 16:06 4584

[原创]找bug

2015-7-22 16:06
4584
VOID RFONTOBJ::vMakeInactive()
{
// We will treat this as a NULL terminated array of pointers to RFONTS so
// we need an extra ptr at the end for the NULL termination and
// SystemWide and Default EUDC Rfonts.

    PRFONT aprfnt[QUICK_FACE_NAME_LINKS + 4];
    PRFONT *pprfnt;
    BOOL   bLockEUDC, bScratch, bAllocated;

    if ((prfnt == NULL) || (prfnt->cSelected == 0))
        return;

// if the quick buffer is not enough, just allocate it here.

    if( prfnt->uiNumLinks > QUICK_FACE_NAME_LINKS )
    {
    // we need an extra ptr at the end for the NULL termination and
    // SystemWide and Default EUDC Rfonts.

        pprfnt = (PRFONT *) PALLOCMEM((prfnt->uiNumLinks+4)*sizeof(PRFONT),'flnk');
        bAllocated = TRUE;
    }
     else
    {
        RtlZeroMemory((VOID *)aprfnt, sizeof(aprfnt));
        pprfnt = aprfnt;
        bAllocated = FALSE;
    }

// First deactivate the RFONT itself. vMakeInactiveHelper returns a list of
// linked/EUDC RFONTS which we will then deactivate.  If bLockEUDC is TRUE
// on return from this function it means we've blocked EUDC API's from functioning
// because we are deactivating an EUDC RFONT.  On return from this function
// we should unblock EUDC API's.

    bLockEUDC = bMakeInactiveHelper( pprfnt );

    while( *pprfnt != NULL )
    {

        FLINKMESSAGE(DEBUG_FONTLINK_RFONT,
                     "vMakeInactive() deactivating linked font %x\n");

        RFONTTMPOBJ rfo( *pprfnt );

        rfo.bMakeInactiveHelper( (PRFONT *)NULL );

    // next one..

        pprfnt++;
    }

// free temorary buffer, if it was allocated.

    if( bAllocated ) VFREEMEM( pprfnt );

// possibly unblock EUDC API's

    if( bLockEUDC )
    {
        AcquireGreResource( &gfmEUDC1 );

        if(( --gcEUDCCount == 0 ) && (gbEUDCRequest))
        {
            ReleaseGreResource( &gfmEUDC2 );
        }

        ReleaseGreResource( &gfmEUDC1 );
    }
}

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 599
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
这个bug在微软的操作系统中存在了20几年了,影响xp和2k3系统,之前报给微软,最近发现微软悄悄的补了。。。反正也没危害了,我也悄悄的发出来给新手同学当练习题吧。
2015-7-22 16:07
0
雪    币: 5
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
太弱了,没看懂==|
2015-7-22 16:56
0
雪    币: 296
活跃值: (26)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
大致看了一下

FLINKMESSAGE(DEBUG_FONTLINK_RFONT,
                     "vMakeInactive() deactivating linked font %x\n");

格式化输出%x参数溢出?
2015-7-28 16:54
0
雪    币: 151
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
支持楼主~
2015-7-30 15:05
0
雪    币: 423
活跃值: (102)
能力值: ( LV4,RANK:45 )
在线值:
发帖
回帖
粉丝
6
VFREEMEM释放的内存不是原来的缓冲区了,是pprfnt++
楼主,想问下是哪个补丁把这个洞补上了?
2019-3-8 21:31
0
游客
登录 | 注册 方可回帖
返回
//