Advertisement
Mysoft

Untitled

Nov 11th, 2020 (edited)
1,484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void iopm_fillRange(BYTE pIopm[IOPM_SIZE], PORTRANGE* pRange) {
  2.         int i=pRange->first, iAmount=(pRange->last-i)+1;
  3.         DWORD *pdwIopm = (DWORD*)pIopm;
  4.        
  5.         #define __FillRange__(_OP,_V) \
  6.         DWORD dwMask = (((i|31)+1)-i)>iAmount?((DWORD)-1)>>((((i|31)+1)-i)-iAmount):-1; \
  7.         if (i&31) { pdwIopm[i>>5] _OP ((-1<<(i&31))&dwMask); iAmount -= 32-(i&1) ; i = (i|31)+1; } \
  8.         for ( i>>=5 ; iAmount>31 ; iAmount-=32 ) pdwIopm[i++] = _V; \
  9.         if (iAmount>0) pdwIopm[i] _OP (((DWORD)-1)>>(32-iAmount));
  10.        
  11.         if (!pRange->isEnabled) { __FillRange__(|=,-1); } else { __FillRange__(&=~,0); }       
  12.        
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement