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.

329 lines
15 KiB

  1. /*****************************************************************************\
  2. * *
  3. * w95wraps.h - Unicode wrappers for ANSI functions on Win95 *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * Copyright (c) Microsoft Corporation. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. //
  11. // This file is for internal use only. Do not put it in the SDK.
  12. //
  13. #ifndef _INC_W95WRAPS
  14. #define _INC_W95WRAPS
  15. // no wrappers are needed for non x86, since win9x only runs on x86!
  16. #ifdef _X86_
  17. //
  18. // Users of this header may define any number of these constants to avoid
  19. // the definitions of each functional group.
  20. //
  21. // NO_W95WRAPS_UNITHUNK Unicode wrapper functions
  22. // NO_W95WRAPS_TPS Thread Pool Services
  23. // NO_W95WRAPS_MLUI MLUI wrapper functions
  24. //
  25. // You are expected to have done a #include <shlwapi.h> before including
  26. // this file.
  27. //
  28. // BUGBUG: you can't include shlwapi.h before this, as ATL templates
  29. // require things like TranlsateAccelerator which, due to munging, get
  30. // turned into TranslateAcceleratorWrapW at compile time. So w95wraps.h
  31. // pretty much needs to be included FIRST so all the interface definitions
  32. // get munged too.
  33. //#ifndef _INC_SHLWAPI
  34. //#error "You must include shlwapi.h *before* w95wraps.h
  35. //#endif
  36. //=============== Unicode Wrapper Routines ===================================
  37. #ifndef NO_W95WRAPS_UNITHUNK
  38. //
  39. // If you #include this file, then calls to many UNICODE functions
  40. // are re-routed through wrapper functions in SHLWAPI which will
  41. // either call the UNICODE version (on NT) or thunk the parameters
  42. // to ANSI and call the ANSI version (on 9x).
  43. //
  44. // Note that these wrapper functions must be used with care, because
  45. //
  46. // * They do not account for subtle differences between UNICODE and
  47. // ANSI versions of the same API. Examples:
  48. //
  49. // - RegisterClassW register a UNICODE window class, whereas
  50. // RegisterClassA registers an ANSI window class. Consequently,
  51. // if you use RegisterClassWrapW, your WNDPROC will receive
  52. // *ANSI* WM_SETTEXT messages on Windows 9x.
  53. //
  54. // - SetWindowLongW(GWL_WNDPROC) and CallWindowProcW behave
  55. // very differently from their ANSI counterparts.
  56. //
  57. // - DialogBoxW will send your dialog procedure UNICODE window
  58. // messages, whereas DialogBoxA will send ANSI window messages.
  59. //
  60. // - Anything that manipulates window messages or MSG structures
  61. // will be subtly affected by character set discrepancies.
  62. //
  63. // * Not all features of the underlying API are always supported,
  64. // or are supported with restrictions. Examples:
  65. //
  66. // - DialogBoxWrapW does not support named dialog resources.
  67. //
  68. // - AppendMenuWrapW does not support bitmap or owner-draw
  69. // menu items.
  70. //
  71. // - FormatMessageWrapW does not support insertions.
  72. //
  73. // - If you use RegQueryValueExWrapW with a NULL output buffer to
  74. // query the size of a buffer, you must also pass *lpcbData = 0.
  75. //
  76. // - SendMessageWrapW requires that the window message not conflict
  77. // with messages used by any of the Windows common controls.
  78. //
  79. #define IsCharAlphaW IsCharAlphaWrapW
  80. #define IsCharUpperW IsCharUpperWrapW
  81. #define IsCharLowerW IsCharLowerWrapW
  82. #define IsCharAlphaNumericW IsCharAlphaNumericWrapW
  83. #define AppendMenuW AppendMenuWrapW
  84. #define CallMsgFilterW CallMsgFilterWrapW
  85. #define CallWindowProcW CallWindowProcWrapW
  86. #define CharLowerW CharLowerWrapW
  87. #define CharLowerBuffW CharLowerBuffWrapW
  88. #define CharNextW CharNextWrapW
  89. #define CharPrevW CharPrevWrapW
  90. #define CharToOemW CharToOemWrapW
  91. #define CharUpperW CharUpperWrapW
  92. #define CharUpperBuffW CharUpperBuffWrapW
  93. #define CompareStringW CompareStringWrapW
  94. #define CopyAcceleratorTableW CopyAcceleratorTableWrapW
  95. #define CreateAcceleratorTableW CreateAcceleratorTableWrapW
  96. #define CreateDCW CreateDCWrapW
  97. #define CreateDirectoryW CreateDirectoryWrapW
  98. #define CreateEventW CreateEventWrapW
  99. #define CreateFileW CreateFileWrapW
  100. #define CreateFontW CreateFontWrapW
  101. #define CreateFontIndirectW CreateFontIndirectWrapW
  102. #define CreateMetaFileW CreateMetaFileWrapW
  103. #define CreateMutexW CreateMutexWrapW
  104. #define CreateICW CreateICWrapW
  105. #define CreateSemaphoreW CreateSemaphoreWrapW
  106. #define CreateWindowExW CreateWindowExWrapW
  107. #define GetFileVersionInfoSizeW GetFileVersionInfoSizeWrapW
  108. #define GetFileVersionInfoW GetFileVersionInfoWrapW
  109. #define lstrcmpiW StrCmpIW
  110. #define lstrcmpW StrCmpW
  111. #define lstrcpyW StrCpyW
  112. #define lstrcpynW StrCpyNW
  113. #define VerQueryValueW VerQueryValueWrapW
  114. #ifndef NO_W95_ATL_WRAPS_TBS
  115. // #define NO_W95_ATL_WRAPS_TBS if you use ATL.
  116. #define DefWindowProcW DefWindowProcWrapW
  117. #endif // NO_W95_ATL_WRAPS_TBS
  118. #define DeleteFileW DeleteFileWrapW
  119. #define DispatchMessageW DispatchMessageWrapW
  120. #define DragQueryFileW DragQueryFileWrapW
  121. #define DrawTextExW DrawTextExWrapW
  122. #define DrawTextW DrawTextWrapW
  123. #define EnumFontFamiliesW EnumFontFamiliesWrapW
  124. #define EnumFontFamiliesExW EnumFontFamiliesExWrapW
  125. #define EnumResourceNamesW EnumResourceNamesWrapW
  126. #define ExpandEnvironmentStringsW ExpandEnvironmentStringsWrapW
  127. #define ExtractIconExW ExtractIconExWrapW
  128. #define ExtTextOutW ExtTextOutWrapW
  129. #define FindFirstFileW FindFirstFileWrapW
  130. #define FindResourceW FindResourceWrapW
  131. #define FindNextFileW FindNextFileWrapW
  132. #define FindWindowW FindWindowWrapW
  133. #define FindWindowExW FindWindowExWrapW
  134. #define FormatMessageW FormatMessageWrapW
  135. #ifndef NO_W95_GETCLASSINFO_WRAPS
  136. // #define NO_W95_GETCLASSINFO_WRAPS if one of the objects uses IProvideClassInfo which has a GetClassInfo method.
  137. #define GetClassInfoW GetClassInfoWrapW
  138. #define GetClassInfoExW GetClassInfoExWrapW
  139. #endif // NO_W95_GETCLASSINFO_WRAPS
  140. #define GetClassLongW GetClassLongWrapW
  141. #define GetClassNameW GetClassNameWrapW
  142. #define GetClipboardFormatNameW GetClipboardFormatNameWrapW
  143. #define GetCurrentDirectoryW GetCurrentDirectoryWrapW
  144. #define GetDlgItemTextW GetDlgItemTextWrapW
  145. #define GetFileAttributesW GetFileAttributesWrapW
  146. #define GetFullPathNameW GetFullPathNameWrapW
  147. #define GetLocaleInfoW GetLocaleInfoWrapW
  148. #define GetMenuItemInfoW GetMenuItemInfoWrapW
  149. #define GetMenuStringW GetMenuStringWrapW
  150. #define GetMessageW GetMessageWrapW
  151. #define GetModuleFileNameW GetModuleFileNameWrapW
  152. #define GetNumberFormatW GetNumberFormatWrapW
  153. #define GetSystemDirectoryW GetSystemDirectoryWrapW
  154. #define GetModuleHandleW GetModuleHandleWrapW
  155. #define GetObjectW GetObjectWrapW
  156. #define GetPrivateProfileIntW GetPrivateProfileIntWrapW
  157. #define GetPrivateProfileStringW GetPrivateProfileStringWrapW
  158. #define GetProfileStringW GetProfileStringWrapW
  159. #define GetPropW GetPropWrapW
  160. #define GlobalAddAtomW GlobalAddAtomWrapW
  161. #define GlobalFindAtomW GlobalFindAtomWrapW
  162. #define GetShortPathNameW GetShortPathNameWrapW
  163. #define GetLongPathNameW GetLongPathNameWrapW
  164. #define GetLongPathNameA GetLongPathNameWrapA
  165. #define GetStringTypeExW GetStringTypeExWrapW
  166. #define GetTempFileNameW GetTempFileNameWrapW
  167. #define GetTempPathW GetTempPathWrapW
  168. #define GetTextExtentPoint32W GetTextExtentPoint32WrapW
  169. #define GetTextFaceW GetTextFaceWrapW
  170. #define GetTextMetricsW GetTextMetricsWrapW
  171. #define GetTimeFormatW GetTimeFormatWrapW
  172. #define GetDateFormatW GetDateFormatWrapW
  173. #define GetUserNameW GetUserNameWrapW
  174. #define GetWindowLongW GetWindowLongWrapW
  175. #define GetEnvironmentVariableW GetEnvironmentVariableWrapW
  176. #ifndef NO_W95_ATL_WRAPS_TBS
  177. // #define NO_W95_ATL_WRAPS_TBS if you use ATL.
  178. #define GetWindowTextW GetWindowTextWrapW
  179. #endif // NO_W95_ATL_WRAPS_TBS
  180. #define GetWindowTextLengthW GetWindowTextLengthWrapW
  181. #define GetWindowsDirectoryW GetWindowsDirectoryWrapW
  182. #define InsertMenuW InsertMenuWrapW
  183. #define InsertMenuItemW InsertMenuItemWrapW
  184. #define IsBadStringPtrW IsBadStringPtrWrapW
  185. #define IsDialogMessageW IsDialogMessageWrapW
  186. #define LoadAcceleratorsW LoadAcceleratorsWrapW
  187. #define LoadBitmapW LoadBitmapWrapW
  188. #define LoadCursorW LoadCursorWrapW
  189. #define LoadIconW LoadIconWrapW
  190. #define LoadImageW LoadImageWrapW
  191. #define LoadLibraryW LoadLibraryWrapW
  192. #define LoadLibraryExW LoadLibraryExWrapW
  193. #define LoadMenuW LoadMenuWrapW
  194. #define LoadStringW LoadStringWrapW
  195. #define MessageBoxIndirectW MessageBoxIndirectWrapW
  196. #define MessageBoxW MessageBoxWrapW
  197. #define ModifyMenuW ModifyMenuWrapW
  198. #define GetCharWidth32W GetCharWidth32WrapW
  199. #define GetCharacterPlacementW GetCharacterPlacementWrapW
  200. #define CopyFileW CopyFileWrapW
  201. #define MoveFileW MoveFileWrapW
  202. #define OemToCharW OemToCharWrapW
  203. #define OpenEventW OpenEventWrapW
  204. #define OutputDebugStringW OutputDebugStringWrapW
  205. #define PeekMessageW PeekMessageWrapW
  206. #define PostMessageW PostMessageWrapW
  207. #define PostThreadMessageW PostThreadMessageWrapW
  208. #define RegCreateKeyW RegCreateKeyWrapW
  209. #define RegCreateKeyExW RegCreateKeyExWrapW
  210. #define RegDeleteKeyW RegDeleteKeyWrapW
  211. #define RegDeleteValueW RegDeleteValueWrapW
  212. #define RegEnumKeyW RegEnumKeyWrapW
  213. #define RegEnumKeyExW RegEnumKeyExWrapW
  214. #define RegOpenKeyW RegOpenKeyWrapW
  215. #define RegOpenKeyExW RegOpenKeyExWrapW
  216. #define RegQueryInfoKeyW RegQueryInfoKeyWrapW
  217. #define RegQueryValueW RegQueryValueWrapW
  218. #define RegQueryValueExW RegQueryValueExWrapW
  219. #define RegSetValueW RegSetValueWrapW
  220. #define RegSetValueExW RegSetValueExWrapW
  221. #define RegisterClassW RegisterClassWrapW
  222. #define RegisterClassExW RegisterClassExWrapW
  223. #define RegisterClipboardFormatW RegisterClipboardFormatWrapW
  224. #define RegisterWindowMessageW RegisterWindowMessageWrapW
  225. #define RemoveDirectoryW RemoveDirectoryWrapW
  226. #define RemovePropW RemovePropWrapW
  227. #define SearchPathW SearchPathWrapW
  228. #define SendDlgItemMessageW SendDlgItemMessageWrapW
  229. #define SendMessageW SendMessageWrapW
  230. #define SendMessageTimeoutW SendMessageTimeoutWrapW
  231. #define SetCurrentDirectoryW SetCurrentDirectoryWrapW
  232. #define SetDlgItemTextW SetDlgItemTextWrapW
  233. #define SetMenuItemInfoW SetMenuItemInfoWrapW
  234. #define SetPropW SetPropWrapW
  235. #define SetFileAttributesW SetFileAttributesWrapW
  236. #define SetWindowLongW SetWindowLongWrapW
  237. #ifndef NO_W95_SHELL32_WRAPS
  238. #define ExtractIconW ExtractIconWrapW
  239. #define SHGetFileInfoW SHGetFileInfoWrapW
  240. #define SHBrowseForFolderW SHBrowseForFolderWrapW
  241. #define ShellExecuteExW ShellExecuteExWrapW
  242. #define SHFileOperationW SHFileOperationWrapW
  243. #define SHGetNewLinkInfoW SHGetNewLinkInfoWrapW
  244. #define SHDefExtractIconW SHDefExtractIconWrapW
  245. #define SHChangeNotify SHChangeNotifyWrap
  246. #define SHFlushSFCache SHFlushSFCacheWrap
  247. #define SHGetPathFromIDListW SHGetPathFromIDListWrapW
  248. #endif // NO_W95_SHELL32_WRAPS
  249. #define GetUserNameW GetUserNameWrapW
  250. #define RegEnumValueW RegEnumValueWrapW
  251. #define WritePrivateProfileStructW WritePrivateProfileStructWrapW
  252. #define GetPrivateProfileStructW GetPrivateProfileStructWrapW
  253. #define CreateProcessW CreateProcessWrapW
  254. #define DdeInitializeW DdeInitializeWrapW
  255. #define DdeCreateStringHandleW DdeCreateStringHandleWrapW
  256. #define DdeQueryStringW DdeQueryStringWrapW
  257. #define GetSaveFileNameW GetSaveFileNameWrapW
  258. #define GetOpenFileNameW GetOpenFileNameWrapW
  259. #define PageSetupDlgW PageSetupDlgWrapW
  260. #define PrintDlgW PrintDlgWrapW
  261. #define SetWindowsHookExW SetWindowsHookExWrapW
  262. #define SetWindowTextW SetWindowTextWrapW
  263. #define StartDocW StartDocWrapW
  264. #define CreateColorSpaceW CreateColorSpaceWrapW
  265. #define SystemParametersInfoW SystemParametersInfoWrapW
  266. #ifndef NO_W95_TRANSACCEL_WRAPS_TBS
  267. // #define NO_W95_TRANSACCEL_WRAPS_TBS if one of the objects uses IOleInPlaceActiveObject which has a TranslateAccelerator method.
  268. #define TranslateAcceleratorW TranslateAcceleratorWrapW
  269. #endif // NO_W95_TRANSACCEL_WRAPS_TBS
  270. #define UnregisterClassW UnregisterClassWrapW
  271. #define VkKeyScanW VkKeyScanWrapW
  272. #define WinHelpW WinHelpWrapW
  273. #define WritePrivateProfileStringW WritePrivateProfileStringWrapW
  274. #define wvsprintfW wvsprintfWrapW
  275. #define WNetRestoreConnectionW WNetRestoreConnectionWrapW
  276. #define WNetGetLastErrorW WNetGetLastErrorWrapW
  277. #endif // NO_W95WRAPS_UNITHUNK
  278. #if !defined(NO_W95WRAPS_UNITHUNK) && !defined(NO_W95WRAPS_MLUI)
  279. #define CreateDialogIndirectParamW CreateDialogIndirectParamWrapW
  280. #define CreateDialogParamW CreateDialogParamWrapW
  281. #define DialogBoxIndirectParamW DialogBoxIndirectParamWrapW // UNICODE, ML
  282. //#ifdef DialogBoxIndirectW
  283. //#undef DialogBoxIndirectW
  284. //#endif
  285. //#define DialogBoxIndirectW(i,h,w,f) DialogBoxIndirectParamWrapW(i,h,w,f,d,0) // UNICODE, ML
  286. #define DialogBoxParamW DialogBoxParamWrapW // UNICODE, ML
  287. //#ifdef DialogBoxW
  288. //#undef DialogBoxW
  289. //#endif
  290. //#define DialogBoxW(i,t,w,f) DialogBoxParamWrapW(i,t,w,f,0) // UNICODE, ML
  291. #define ShellMessageBoxW ShellMessageBoxWrapW
  292. #define TrackPopupMenu TrackPopupMenuWrap
  293. #define TrackPopupMenuEx TrackPopupMenuExWrap
  294. #define DeleteMenu DeleteMenuWrap
  295. #define DestroyMenu DestroyMenuWrap
  296. #endif // !defined(NO_W95WRAPS_UNITHUNK) || !defined(NO_W95WRAPS_MLUI)
  297. #if !defined(NO_OLE32_WRAPS)
  298. #define CLSIDFromString CLSIDFromStringWrap
  299. #define CLSIDFromProgID CLSIDFromProgIDWrap
  300. #endif
  301. #endif // _X86_
  302. #endif // _INC_W95WRAPS