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.

216 lines
5.7 KiB

  1. /*
  2. * M A P I N L S . H
  3. *
  4. * Internationalization Support Utilities
  5. *
  6. * Copyright 1986-1999 Microsoft Corporation. All Rights Reserved.
  7. */
  8. #ifndef _MAPINLS_H_
  9. #define _MAPINLS_H_
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #if defined (WIN32) && !defined (_WIN32)
  14. #define _WIN32
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* We don't want to include windows.h in case that conflicts with an */
  20. /* earlier inclusion of compobj.h */
  21. #if !defined(WINAPI)
  22. #if defined(_WIN32) && (_MSC_VER >= 800)
  23. #define WINAPI __stdcall
  24. #elif defined(WIN16)
  25. #define WINAPI _far _pascal
  26. #else
  27. #define WINAPI _far _pascal
  28. #endif
  29. #endif
  30. #if defined(DOS) || defined(_MAC)
  31. #include <string.h>
  32. #endif
  33. #ifndef FAR
  34. #define FAR
  35. #endif
  36. typedef unsigned char BYTE;
  37. typedef unsigned short WORD;
  38. typedef unsigned long DWORD;
  39. typedef unsigned int UINT;
  40. typedef int BOOL;
  41. #ifndef __CHAR_DEFINED__
  42. typedef char CHAR;
  43. #endif
  44. #ifdef UNICODE
  45. typedef WCHAR TCHAR;
  46. #else
  47. typedef char TCHAR;
  48. #endif
  49. #if !defined(_NATIVE_WCHAR_T_DEFINED)
  50. typedef unsigned short WCHAR;
  51. #endif
  52. typedef WCHAR FAR * LPWSTR;
  53. typedef const WCHAR FAR * LPCWSTR;
  54. typedef CHAR FAR * LPSTR;
  55. typedef const CHAR FAR * LPCSTR;
  56. typedef TCHAR FAR * LPTSTR;
  57. typedef const TCHAR FAR * LPCTSTR;
  58. typedef DWORD LCID;
  59. typedef const void FAR * LPCVOID;
  60. #ifndef _MAC
  61. #ifndef LPOLESTR
  62. #if !defined (_WIN32)
  63. #define LPOLESTR LPSTR
  64. #define LPCOLESTR LPCSTR
  65. #define OLECHAR char
  66. #define OLESTR(str) str
  67. #else /* Win32 */
  68. #define LPOLESTR LPWSTR
  69. #define LPCOLESTR LPCWSTR
  70. #define OLECHAR WCHAR
  71. #define OLESTR(str) L##str
  72. #endif /* !_WIN32 */
  73. #endif /* LPOLESTR */
  74. #endif /* _MAC */
  75. #define NORM_IGNORECASE 0x00000001 /* ignore case */
  76. #define NORM_IGNORENONSPACE 0x00000002 /* ignore diacritics */
  77. #define NORM_IGNORESYMBOLS 0x00000004 /* ignore symbols */
  78. #if defined (_WIN32) /* from winnls.h */
  79. #define NORM_IGNOREKANATYPE 0x00010000 /* ignore kanatype */
  80. #define NORM_IGNOREWIDTH 0x00020000 /* ignore width */
  81. #elif defined (WIN16) /* from olenls.h */
  82. #define NORM_IGNOREWIDTH 0x00000008 /* ignore width */
  83. #define NORM_IGNOREKANATYPE 0x00000040 /* ignore kanatype */
  84. #endif
  85. #if defined(WIN16)
  86. #define lstrcpyA lstrcpy
  87. #define lstrlenA lstrlen
  88. #define lstrcmpA lstrcmp
  89. #define lstrcmpiA lstrcmpi
  90. #define LoadStringA LoadString
  91. #define IsBadStringPtrA(a1, a2) IsBadStringPtr(a1, a2)
  92. #define wvsprintfA wvsprintf
  93. #define MessageBoxA MessageBox
  94. #define GetModuleHandleA GetModuleHandle
  95. #define CreateWindowA CreateWindow
  96. #define RegisterClassA RegisterClass
  97. #define CharToOemBuff AnsiToOemBuff
  98. #define CharToOem AnsiToOem
  99. #define CharUpperBuff AnsiUpperBuff
  100. #define CharUpper AnsiUpper
  101. #elif defined(DOS) || defined(_MAC)
  102. #define IsBadReadPtr(lp, cb) (FALSE)
  103. #define IsBadWritePtr(lp, cb) (FALSE)
  104. #define IsBadHugeReadPtr(lp, cb) (FALSE)
  105. #define IsBadHugeWritePtr(lp, cb) (FALSE)
  106. #define IsBadCodePtr(lpfn) (FALSE)
  107. #ifdef _MAC
  108. #undef IsBadStringPtr
  109. #endif
  110. #define IsBadStringPtr(lpsz, cchMax) (FALSE)
  111. #define IsBadStringPtrA(lpsz, cchMax) (FALSE)
  112. #if defined(DOS)
  113. #define lstrcpyA strcpy
  114. #define lstrlenA strlen
  115. #define lstrcmpA strcmp
  116. #define lstrcmp strcmp
  117. #define lstrcmpi strcmpi
  118. #define lstrcpy strcpy
  119. #define lstrcat strcat
  120. #define lstrlen strlen
  121. #define wsprintf sprintf
  122. #endif
  123. #endif
  124. #if defined(DOS) || defined(WIN16)
  125. /* Simulate effect of afx header */
  126. #define __T(x) x
  127. #define _T(x) __T(x)
  128. #define TEXT _T
  129. #endif
  130. #define CP_ACP 0 /* default to ANSI code page */
  131. #define CP_OEMCP 1 /* default to OEM code page */
  132. LCID WINAPI MNLS_GetUserDefaultLCID(void);
  133. UINT WINAPI MNLS_GetACP(void);
  134. int WINAPI MNLS_CompareStringA(LCID Locale, DWORD dwCmpFlags,
  135. LPCSTR lpString1, int cchCount1, LPCSTR lpString2,
  136. int cchCount2);
  137. int WINAPI MNLS_CompareStringW(LCID Locale, DWORD dwCmpFlags,
  138. LPCWSTR lpString1, int cchCount1, LPCWSTR lpString2,
  139. int cchCount2);
  140. int WINAPI MNLS_MultiByteToWideChar(UINT uCodePage, DWORD dwFlags,
  141. LPCSTR lpMultiByteStr, int cchMultiByte,
  142. LPWSTR lpWideCharStr, int cchWideChar);
  143. int WINAPI MNLS_WideCharToMultiByte(UINT uCodePage, DWORD dwFlags,
  144. LPCWSTR lpWideCharStr, int cchWideChar,
  145. LPSTR lpMultiByteStr, int cchMultiByte,
  146. LPCSTR lpDefaultChar, BOOL FAR *lpfUsedDefaultChar);
  147. int WINAPI MNLS_lstrlenW(LPCWSTR lpString);
  148. int WINAPI MNLS_lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2);
  149. LPWSTR WINAPI MNLS_lstrcpyW(LPWSTR lpString1, LPCWSTR lpString2);
  150. BOOL WINAPI MNLS_IsBadStringPtrW(LPCWSTR lpsz, UINT ucchMax);
  151. #if defined(_WIN32) && !defined(_WINNT) && !defined(_WIN95) && !defined(_MAC)
  152. #define _WINNT
  153. #endif
  154. #if !defined(_WINNT) && !defined(_WIN95)
  155. #define GetUserDefaultLCID MNLS_GetUserDefaultLCID
  156. #define GetACP MNLS_GetACP
  157. #define MultiByteToWideChar MNLS_MultiByteToWideChar
  158. #define WideCharToMultiByte MNLS_WideCharToMultiByte
  159. #define CompareStringA MNLS_CompareStringA
  160. #endif
  161. #if !defined(MAPI_NOWIDECHAR)
  162. #define lstrlenW MNLS_lstrlenW
  163. #define lstrcmpW MNLS_lstrcmpW
  164. #define lstrcpyW MNLS_lstrcpyW
  165. #define CompareStringW MNLS_CompareStringW
  166. #if defined(WIN16) || defined(_WINNT) || defined(_WIN95)
  167. #define IsBadStringPtrW MNLS_IsBadStringPtrW
  168. #elif defined(_MAC)
  169. #define IsBadStringPtrW(lpsz, cchMax) (FALSE)
  170. #else
  171. #define IsBadStringPtrW (FALSE)
  172. #endif
  173. #endif /* ! MAPI_NOWIDECHAR */
  174. #ifdef __cplusplus
  175. }
  176. #endif
  177. #endif /* _MAPINLS_H_ */