Всем доброго времени суток. Нужно воспроизвести функциональность обёртки GetObjectType для его системного вызова. Ни у кого нет готового псевдокода?
Код (Text): DWORD GetObjectType(HGDIOBJ h) { DWORD dwRet = 0; UINT uiIndex; FIXUP_HANDLE(h); uiIndex = HANDLE_TO_INDEX(h); if (uiIndex < MAX_HANDLE_COUNT) { PENTRY pentry = &pGdiSharedHandleTable[uiIndex]; if ( (pentry->FullUnique == ((ULONG)h >> 16)) && ((pentry->ObjectOwner.Share.Pid == gW32PID) || (pentry->ObjectOwner.Share.Pid == 0)) ) { switch (LO_TYPE(h)) { case LO_BRUSH_TYPE: dwRet = OBJ_BRUSH; break; case LO_REGION_TYPE: dwRet = OBJ_REGION; break; case LO_PEN_TYPE: dwRet = OBJ_PEN; break; case LO_EXTPEN_TYPE: dwRet = OBJ_EXTPEN; break; case LO_FONT_TYPE: dwRet = OBJ_FONT; break; case LO_BITMAP_TYPE: dwRet = OBJ_BITMAP; break; case LO_PALETTE_TYPE: dwRet = OBJ_PAL; break; case LO_METAFILE16_TYPE: dwRet = OBJ_METAFILE; break; case LO_METAFILE_TYPE: dwRet = OBJ_ENHMETAFILE; break; case LO_METADC16_TYPE: dwRet = OBJ_METADC; break; case LO_DC_TYPE: if( GetDCDWord( h, DDW_ISMEMDC, FALSE ) ) { dwRet = OBJ_MEMDC; } else { dwRet = OBJ_DC; } break; case LO_ALTDC_TYPE: { PLDC pldc; DC_PLDC(h,pldc,0); dwRet = alPublicTypes[pldc->iType]; } break; default: GdiSetLastError(ERROR_INVALID_HANDLE); break; } } } return(dwRet); }