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.

94 lines
3.2 KiB

  1. //
  2. // Common.h : Common const and defines
  3. //
  4. // History:
  5. // 14-DEC-2000 CSLim Created
  6. #if !defined (__COMMON_H__INCLUDED_)
  7. #define __COMMON_H__INCLUDED_
  8. // IME6.1 Root reg key location
  9. const TCHAR g_szIMERootKey[] = TEXT("Software\\Microsoft\\IMEKR\\6.1");
  10. const TCHAR g_szIMEDirectoriesKey[] = TEXT("Software\\Microsoft\\IMEKR\\6.1\\Directories");
  11. const TCHAR g_szDictionary[] = TEXT("Dictionary"); // Basic Hanja lex full path with file name "IMEKR.LEX"
  12. const TCHAR g_szDicPath[] = TEXT("DictionaryPath"); // Extended lex path
  13. const TCHAR g_szHelpPath[] = TEXT("HelpPath");
  14. // IME Properties reg values
  15. const TCHAR g_szXWEnable[] = TEXT("ISO10646");
  16. const TCHAR g_szIMEKL[] = TEXT("InputMethod");
  17. const TCHAR g_szCompDel[] = TEXT("CompDel");
  18. const TCHAR g_szStatusPos[] = TEXT("StatusPos");
  19. const TCHAR g_szCandPos[] = TEXT("CandPos");
  20. const TCHAR g_szStatusButtons[] = TEXT("StatusButtons");
  21. const TCHAR g_szLexFileNameKey[] = TEXT("LexFile");
  22. const TCHAR g_szEnableK1Hanja[] = TEXT("KSC5657");
  23. const TCHAR g_szEnableCandUnicodeTT[] = TEXT("CandUnicodeTT");
  24. // IME Main version key
  25. const TCHAR g_szVersionKey[] = TEXT("Software\\Microsoft\\IMEKR");
  26. const TCHAR g_szVersion[] = TEXT("version");
  27. #ifdef _DEBUG
  28. #define SZ_TIPSERVERNAME TEXT("DBGKRCIC")
  29. #define SZ_TIPNAME L"DBGKRCIC"
  30. #define SZ_TIPDISPNAME L"Korean Input System (IME 2002) (Debug)"
  31. #define SZ_TIPMODULENAME L"imekrcic.dll"
  32. #else /* !DEBUG */
  33. #define SZ_TIPSERVERNAME TEXT("IMEKRCIC")
  34. #define SZ_TIPNAME L"IMEKRCIC"
  35. #define SZ_TIPDISPNAME L"Korean Input System (IME 2002)"
  36. #define SZ_TIPMODULENAME L"imekrcic.dll"
  37. #endif /* !DEBUG */
  38. // Korean TIP CLSID
  39. // {766A2C15-B226-4fd6-B52A-867B3EBF38D2}
  40. DEFINE_GUID(CLSID_KorIMX, 0x766A2C15, 0xB226, 0x4FD6, 0xb5, 0x2a, 0x86, 0x7b, 0x3e, 0xbf, 0x38, 0xd2);
  41. // Korean TIP profile
  42. // {83C18F16-5DD8-4157-A34A-3C5AB2089E11}
  43. DEFINE_GUID(GUID_Profile, 0x83c18f16, 0x5dd8, 0x4157, 0xa3, 0x4a, 0x3c, 0x5a, 0xb2, 0x8, 0x9e, 0x11);
  44. //
  45. // generic COM stuff
  46. //
  47. #define SafeRelease(punk) \
  48. { \
  49. if ((punk) != NULL) \
  50. { \
  51. (punk)->Release(); \
  52. } \
  53. }
  54. #define SafeReleaseClear(punk) \
  55. { \
  56. if ((punk) != NULL) \
  57. { \
  58. (punk)->Release(); \
  59. (punk) = NULL; \
  60. } \
  61. }
  62. //
  63. // SAFECAST(obj, type)
  64. //
  65. // This macro is extremely useful for enforcing strong typechecking on other
  66. // macros. It generates no code.
  67. //
  68. // Simply insert this macro at the beginning of an expression list for
  69. // each parameter that must be typechecked. For example, for the
  70. // definition of MYMAX(x, y), where x and y absolutely must be integers,
  71. // use:
  72. //
  73. // #define MYMAX(x, y) (SAFECAST(x, int), SAFECAST(y, int), ((x) > (y) ? (x) : (y)))
  74. //
  75. //
  76. #define SAFECAST(_obj, _type) (((_type)(_obj)==(_obj)?0:0), (_type)(_obj))
  77. #ifndef ARRAYSIZE
  78. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  79. #endif
  80. #endif // !defined (__COMMON_H__INCLUDED_)