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.

38 lines
563 B

  1. //
  2. // imeutil.c
  3. //
  4. #include "imeutil.h"
  5. #include "debug.h"
  6. DWORD HexStrToDWORD(TCHAR *pStr)
  7. {
  8. DWORD dw;
  9. TCHAR c;
  10. dw = 0;
  11. while (c = *pStr++)
  12. {
  13. dw *= 16;
  14. if (c >= '0' && c <= '9')
  15. {
  16. dw += c - '0';
  17. }
  18. else if (c >= 'a' && c <= 'f')
  19. {
  20. dw += c - 'a' + 10;
  21. }
  22. else if (c >= 'A' && c <= 'F')
  23. {
  24. dw += c - 'A' + 10;
  25. }
  26. else
  27. {
  28. break;
  29. }
  30. }
  31. return dw;
  32. }