Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
699 B

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. crc.c
  5. Abstract:
  6. Author:
  7. Thomas J. Dimitri (TommyD) 08-May-1992
  8. Environment:
  9. Kernel Mode - Or whatever is the equivalent on OS/2 and DOS.
  10. Revision History:
  11. --*/
  12. #include "asyncall.h"
  13. // asyncmac.c will define the global parameters.
  14. #include "globals.h"
  15. #include "crctable.h"
  16. USHORT
  17. CalcCRC(
  18. register PUCHAR Frame,
  19. register UINT FrameSize)
  20. {
  21. register USHORT currCRC=0;
  22. // we use a do while for efficiency purposes in loop optimizations
  23. do {
  24. currCRC=crc_table[((currCRC >> 8) ^ *Frame++) & 0xff] ^ (currCRC << 8);
  25. } while(--FrameSize);
  26. return currCRC;
  27. }