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.

283 lines
5.8 KiB

  1. #ifndef __ECM_UNICODE_H__
  2. #define __ECM_UNICODE_H__
  3. // necessary defns -- remove?
  4. #include <rpc.h>
  5. #include <rpcdce.h>
  6. #include <wincrypt.h>
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. BOOL WINAPI FIsWinNT(void);
  11. BOOL WINAPI MkMBStrEx(PBYTE pbBuff, DWORD cbBuff, LPCWSTR wsz, int cchW, char ** pszMB, int *pcbConverted);
  12. BOOL WINAPI MkMBStr(PBYTE pbBuff, DWORD cbBuff, LPCWSTR wsz, char ** pszMB);
  13. void WINAPI FreeMBStr(PBYTE pbBuff, char * szMB);
  14. LPWSTR WINAPI MkWStr(char * szMB);
  15. void WINAPI FreeWStr(LPWSTR wsz);
  16. // The following is also needed for non-x86 due to a bug in advapi32 for
  17. // CryptAcquireContextW.
  18. BOOL WINAPI CryptAcquireContextU(
  19. HCRYPTPROV *phProv,
  20. LPCWSTR lpContainer,
  21. LPCWSTR lpProvider,
  22. DWORD dwProvType,
  23. DWORD dwFlags
  24. );
  25. #ifdef _M_IX86
  26. // Reg.cpp
  27. LONG WINAPI RegCreateKeyExU (
  28. HKEY hKey,
  29. LPCWSTR lpSubKey,
  30. DWORD Reserved,
  31. LPWSTR lpClass,
  32. DWORD dwOptions,
  33. REGSAM samDesired,
  34. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  35. PHKEY phkResult,
  36. LPDWORD lpdwDisposition
  37. );
  38. LONG WINAPI RegDeleteKeyU(
  39. HKEY hKey,
  40. LPCWSTR lpSubKey
  41. );
  42. LONG WINAPI RegEnumKeyExU (
  43. HKEY hKey,
  44. DWORD dwIndex,
  45. LPWSTR lpName,
  46. LPDWORD lpcbName,
  47. LPDWORD lpReserved,
  48. LPWSTR lpClass,
  49. LPDWORD lpcbClass,
  50. PFILETIME lpftLastWriteTime
  51. );
  52. LONG WINAPI RegEnumValueU (
  53. HKEY hKey,
  54. DWORD dwIndex,
  55. LPWSTR lpValueName,
  56. LPDWORD lpcbValueName,
  57. LPDWORD lpReserved,
  58. LPDWORD lpType,
  59. LPBYTE lpData,
  60. LPDWORD lpcbData
  61. );
  62. LONG RegQueryValueExU(
  63. HKEY hKey,
  64. LPCWSTR lpValueName,
  65. LPDWORD lpReserved,
  66. LPDWORD lpType,
  67. LPBYTE lpData,
  68. LPDWORD lpcbData
  69. );
  70. LONG WINAPI RegSetValueExU (
  71. HKEY hKey,
  72. LPCWSTR lpValueName,
  73. DWORD Reserved,
  74. DWORD dwType,
  75. CONST BYTE* lpData,
  76. DWORD cbData
  77. );
  78. LONG WINAPI RegDeleteValueU (
  79. HKEY hKey,
  80. LPCWSTR lpValueName
  81. );
  82. LONG WINAPI RegQueryInfoKeyU (
  83. HKEY hKey,
  84. LPWSTR lpClass,
  85. LPDWORD lpcbClass,
  86. LPDWORD lpReserved,
  87. LPDWORD lpcSubKeys,
  88. LPDWORD lpcbMaxSubKeyLen,
  89. LPDWORD lpcbMaxClassLen,
  90. LPDWORD lpcValues,
  91. LPDWORD lpcbMaxValueNameLen,
  92. LPDWORD lpcbMaxValueLen,
  93. LPDWORD lpcbSecurityDescriptor,
  94. PFILETIME lpftLastWriteTime
  95. );
  96. LONG WINAPI RegOpenKeyExU(
  97. HKEY hKey,
  98. LPCWSTR lpSubKey,
  99. DWORD ulOptions,
  100. REGSAM samDesired,
  101. PHKEY phkResult
  102. );
  103. // File.cpp
  104. HANDLE WINAPI CreateFileU (
  105. LPCWSTR lpFileName,
  106. DWORD dwDesiredAccess,
  107. DWORD dwShareMode,
  108. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  109. DWORD dwCreationDisposition,
  110. DWORD dwFlagsAndAttributes,
  111. HANDLE hTemplateFile
  112. );
  113. HINSTANCE WINAPI LoadLibraryU(
  114. LPCWSTR lpLibFileName
  115. );
  116. HINSTANCE WINAPI LoadLibraryExU(
  117. LPCWSTR lpLibFileName,
  118. HANDLE hFile,
  119. DWORD dwFlags
  120. );
  121. DWORD
  122. WINAPI
  123. ExpandEnvironmentStringsU(
  124. LPCWSTR lpSrc,
  125. LPWSTR lpDst,
  126. DWORD nSize
  127. );
  128. // capi.cpp
  129. BOOL WINAPI CryptSignHashU(
  130. HCRYPTHASH hHash,
  131. DWORD dwKeySpec,
  132. LPCWSTR lpDescription,
  133. DWORD dwFlags,
  134. BYTE *pbSignature,
  135. DWORD *pdwSigLen
  136. );
  137. BOOL WINAPI CryptVerifySignatureU(
  138. HCRYPTHASH hHash,
  139. CONST BYTE *pbSignature,
  140. DWORD dwSigLen,
  141. HCRYPTKEY hPubKey,
  142. LPCWSTR lpDescription,
  143. DWORD dwFlags
  144. );
  145. BOOL WINAPI CryptSetProviderU(
  146. LPCWSTR lpProvName,
  147. DWORD dwProvType
  148. );
  149. // Ole.cpp
  150. RPC_STATUS RPC_ENTRY UuidToStringU(
  151. UUID * Uuid,
  152. WCHAR * * StringUuid
  153. );
  154. // nt.cpp
  155. BOOL WINAPI GetUserNameU(
  156. LPWSTR lpBuffer,
  157. LPDWORD nSize
  158. );
  159. DWORD WINAPI GetModuleFileNameU(
  160. HMODULE hModule,
  161. LPWSTR lpFilename,
  162. DWORD nSize
  163. );
  164. HMODULE WINAPI GetModuleHandleU(
  165. LPCWSTR lpModuleName // address of module name to return handle for
  166. );
  167. // user.cpp
  168. int WINAPI LoadStringU(
  169. HINSTANCE hInstance,
  170. UINT uID,
  171. LPWSTR lpBuffer,
  172. int nBufferMax
  173. );
  174. DWORD WINAPI FormatMessageU(
  175. DWORD dwFlags,
  176. LPCVOID lpSource,
  177. DWORD dwMessageId,
  178. DWORD dwLanguageId,
  179. LPWSTR lpBuffer,
  180. DWORD nSize,
  181. va_list *Arguments
  182. );
  183. BOOL WINAPI SetWindowTextU(
  184. HWND hWnd,
  185. LPCWSTR lpString
  186. );
  187. UINT WINAPI GetDlgItemTextU(
  188. HWND hDlg,
  189. int nIDDlgItem,
  190. LPWSTR lpString,
  191. int nMaxCount
  192. );
  193. int WINAPI MessageBoxU(
  194. HWND hWnd ,
  195. LPCWSTR lpText,
  196. LPCWSTR lpCaption,
  197. UINT uType
  198. );
  199. int WINAPI LCMapStringU(
  200. LCID Locale,
  201. DWORD dwMapFlags,
  202. LPCWSTR lpSrcStr,
  203. int cchSrc,
  204. LPWSTR lpDestStr,
  205. int cchDest
  206. );
  207. #else
  208. #define RegQueryValueExU RegQueryValueExW
  209. #define RegCreateKeyExU RegCreateKeyExW
  210. #define RegDeleteKeyU RegDeleteKeyW
  211. #define RegEnumKeyExU RegEnumKeyExW
  212. #define RegEnumValueU RegEnumValueW
  213. #define RegSetValueExU RegSetValueExW
  214. #define RegQueryInfoKeyU RegQueryInfoKeyW
  215. #define RegDeleteValueU RegDeleteValueW
  216. #define RegOpenKeyExU RegOpenKeyExW
  217. #define ExpandEnvironmentStringsU ExpandEnvironmentStringsW
  218. #define CreateFileU CreateFileW
  219. #define LoadLibraryU LoadLibraryW
  220. #define LoadLibraryExU LoadLibraryExW
  221. #define CryptSignHashU CryptSignHashW
  222. #define CryptVerifySignatureU CryptVerifySignatureW
  223. #define CryptSetProviderU CryptSetProviderW
  224. #define UuidToStringU UuidToStringW
  225. #define GetUserNameU GetUserNameW
  226. #define GetModuleFileNameU GetModuleFileNameW
  227. #define GetModuleHandleU GetModuleHandleW
  228. #define LoadStringU LoadStringW
  229. #define FormatMessageU FormatMessageW
  230. #define SetWindowTextU SetWindowTextW
  231. #define GetDlgItemTextU GetDlgItemTextW
  232. #define MessageBoxU MessageBoxW
  233. #define LCMapStringU LCMapStringW
  234. #endif // _M_IX86
  235. #ifdef __cplusplus
  236. } // Balance extern "C" above
  237. #endif
  238. #endif