Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void iopm_fillRange(BYTE pIopm[IOPM_SIZE], PORTRANGE* pRange) {
- BOOL isBlocked = !pRange->isEnabled; //sanitize
- DWORD i=pRange->first, iAmount=(pRange->last-i)+1;
- DWORD *pdwIopm = (dword*)pdwIopm;
- if (i&31) { //fill unaligned entries
- int iLen = 32-(i&31);
- if (IsBlocked) pdwIopm[i>>5] |= ((DWORD)-1)<<iLen); else pdwIopm[i>>5] &= ~((DWORD)-1)<<iLen);
- i = (i|31)+1 ; iAmount -= iLen;
- }
- i>>=5; //fill bulk entries
- while (iAmount>31) pdwIopm[i++] = (DWORD)(isBlocked?-1:0), iAmount -= 32;
- if (iAmount) { //fill remaining entries
- int iLen = 32-(iAmount);
- if (IsBlocked) pdwIopm(i) |= ((DWORD)-1)>>iLen) else pdwIopm(i) &= ~((DWORD)-1)>>iLen);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement