Source code of Windows XP (NT5)
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.

127 lines
2.5 KiB

  1. /**************************************************************************
  2. *
  3. * - WIFEMAN.DLL -
  4. *
  5. * Windows Intelligent Font Environment Maneger for Win32 and NT
  6. *
  7. * Author : Hideyuki Nagase [hideyukn]
  8. *
  9. * History :
  10. *
  11. * 11.Aug.1993 -By- Hideyuki Nagase [hideyukn]
  12. * Create it.
  13. *
  14. *************************************************************************/
  15. #include <windows.h>
  16. #define WIFEMAN_VERSION 0x0109 // Version 1.09
  17. #define EUDC_RANGE_SECTION "System EUDC"
  18. #define EUDC_RANGE_KEY "SysEUDCRange"
  19. HINSTANCE hInst;
  20. /************************************************************************
  21. *
  22. * MiscGetVersion()
  23. *
  24. * Return WIFE driver version
  25. *
  26. ************************************************************************/
  27. unsigned long FAR PASCAL
  28. MiscGetVersion
  29. (
  30. VOID
  31. )
  32. {
  33. return( (long)WIFEMAN_VERSION );
  34. }
  35. /************************************************************************
  36. *
  37. * MiscIsDbcsLeadByte()
  38. *
  39. * Return SBCS/DBCS status
  40. *
  41. ************************************************************************/
  42. unsigned char FAR PASCAL
  43. MiscIsDbcsLeadByte
  44. (
  45. unsigned short usCharSet ,
  46. unsigned short usChar
  47. )
  48. {
  49. unsigned char ch;
  50. unsigned short LangID;
  51. LangID = GetSystemDefaultLangID();
  52. if (LangID == 0x404 && usCharSet != CHINESEBIG5_CHARSET)
  53. return( 0 );
  54. else if (LangID == 0x804 && usCharSet != GB2312_CHARSET)
  55. return( 0 );
  56. else if (LangID == 0x411 && usCharSet != SHIFTJIS_CHARSET)
  57. return( 0 );
  58. else if (LangID == 0x412 && usCharSet != HANGEUL_CHARSET)
  59. return( 0 );
  60. // CHP
  61. else if (LangID == 0xC04 && (usCharSet != GB2312_CHARSET) && (usCharSet != CHINESEBIG5_CHARSET))
  62. return( 0 );
  63. else
  64. return( 0 );
  65. if (usChar == 0xffff)
  66. return( 1 );
  67. ch = (unsigned char)((unsigned short)(usChar >> 8) & 0xff);
  68. if (ch == 0) {
  69. ch = (unsigned char)((unsigned short)(usChar) & 0xff);
  70. }
  71. return((unsigned char)(IsDBCSLeadByte( ch )));
  72. }
  73. /**********************************************************************
  74. *
  75. * WEP()
  76. *
  77. * Called by Windows when this DLL in unloaded
  78. *
  79. **********************************************************************/
  80. int FAR PASCAL
  81. WEP
  82. (
  83. int nParam
  84. )
  85. {
  86. int iRet;
  87. switch( nParam )
  88. {
  89. case WEP_SYSTEM_EXIT :
  90. case WEP_FREE_DLL :
  91. default :
  92. iRet = 1;
  93. }
  94. return( iRet );
  95. }
  96. int NEAR PASCAL LibMain(
  97. HANDLE hInstance,
  98. WORD wDataSeg,
  99. WORD wHeapSize,
  100. LPSTR lpCmdLine
  101. )
  102. {
  103. hInst = hInstance;
  104. return 1;
  105. }
  106.