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.

53 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2001, Microsoft Corporation
  3. Module Name:
  4. modebias.cpp
  5. Abstract:
  6. This file implements the CModeBias Class.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #include "private.h"
  12. #include "modebias.h"
  13. #include "msime.h"
  14. #include "setmode.h"
  15. MODE_BIAS_MAP g_ModeBiasMap[] = {
  16. { &GUID_MODEBIAS_FILENAME, MODEBIASMODE_FILENAME },
  17. { &GUID_MODEBIAS_NUMERIC, MODEBIASMODE_DIGIT },
  18. { &GUID_MODEBIAS_URLHISTORY, MODEBIASMODE_URLHISTORY },
  19. { &GUID_MODEBIAS_DEFAULT, MODEBIASMODE_DEFAULT },
  20. { &GUID_MODEBIAS_NONE, MODEBIASMODE_DEFAULT }
  21. };
  22. LPARAM CModeBias::ConvertModeBias(GUID guid)
  23. {
  24. for (int i = 0; i < sizeof(g_ModeBiasMap)/sizeof(MODE_BIAS_MAP); i++)
  25. {
  26. if (IsEqualGUID(guid, *g_ModeBiasMap[i].m_guid))
  27. return g_ModeBiasMap[i].m_mode;
  28. }
  29. return 0L;
  30. }
  31. GUID CModeBias::ConvertModeBias(LPARAM mode)
  32. {
  33. for (int i = 0; i < sizeof(g_ModeBiasMap)/sizeof(MODE_BIAS_MAP); i++)
  34. {
  35. if (mode == g_ModeBiasMap[i].m_mode)
  36. return *g_ModeBiasMap[i].m_guid;
  37. }
  38. return GUID_NULL;
  39. }