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.

326 lines
16 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. // WARNING: 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 VerQueryValueW VerQueryValueWrapW
  112. #ifndef NO_W95_ATL_WRAPS_TBS
  113. // #define NO_W95_ATL_WRAPS_TBS if you use ATL.
  114. #define DefWindowProcW DefWindowProcWrapW
  115. #endif // NO_W95_ATL_WRAPS_TBS
  116. #define DeleteFileW DeleteFileWrapW
  117. #define DispatchMessageW DispatchMessageWrapW
  118. #define DragQueryFileW DragQueryFileWrapW
  119. #define DrawTextExW DrawTextExWrapW
  120. #define DrawTextW DrawTextWrapW
  121. #define EnumFontFamiliesW EnumFontFamiliesWrapW
  122. #define EnumFontFamiliesExW EnumFontFamiliesExWrapW
  123. #define EnumResourceNamesW EnumResourceNamesWrapW
  124. #define ExpandEnvironmentStringsW ExpandEnvironmentStringsWrapW
  125. #define ExtractIconExW ExtractIconExWrapW
  126. #define ExtTextOutW ExtTextOutWrapW
  127. #define FindFirstFileW FindFirstFileWrapW
  128. #define FindResourceW FindResourceWrapW
  129. #define FindNextFileW FindNextFileWrapW
  130. #define FindWindowW FindWindowWrapW
  131. #define FindWindowExW FindWindowExWrapW
  132. #define FormatMessageW FormatMessageWrapW
  133. #ifndef NO_W95_GETCLASSINFO_WRAPS
  134. // #define NO_W95_GETCLASSINFO_WRAPS if one of the objects uses IProvideClassInfo which has a GetClassInfo method.
  135. #define GetClassInfoW GetClassInfoWrapW
  136. #define GetClassInfoExW GetClassInfoExWrapW
  137. #endif // NO_W95_GETCLASSINFO_WRAPS
  138. #define GetClassLongW GetClassLongWrapW
  139. #define GetClassNameW GetClassNameWrapW
  140. #define GetClipboardFormatNameW GetClipboardFormatNameWrapW
  141. #define GetCurrentDirectoryW GetCurrentDirectoryWrapW
  142. #define GetDlgItemTextW GetDlgItemTextWrapW
  143. #define GetFileAttributesW GetFileAttributesWrapW
  144. #define GetFullPathNameW GetFullPathNameWrapW
  145. #define GetLocaleInfoW GetLocaleInfoWrapW
  146. #define GetMenuItemInfoW GetMenuItemInfoWrapW
  147. #define GetMenuStringW GetMenuStringWrapW
  148. #define GetMessageW GetMessageWrapW
  149. #define GetModuleFileNameW GetModuleFileNameWrapW
  150. #define GetNumberFormatW GetNumberFormatWrapW
  151. #define GetSystemDirectoryW GetSystemDirectoryWrapW
  152. #define GetModuleHandleW GetModuleHandleWrapW
  153. #define GetObjectW GetObjectWrapW
  154. #define GetPrivateProfileIntW GetPrivateProfileIntWrapW
  155. #define GetPrivateProfileStringW GetPrivateProfileStringWrapW
  156. #define GetProfileStringW GetProfileStringWrapW
  157. #define GetPropW GetPropWrapW
  158. #define GlobalAddAtomW GlobalAddAtomWrapW
  159. #define GlobalFindAtomW GlobalFindAtomWrapW
  160. #define GetShortPathNameW GetShortPathNameWrapW
  161. #define GetLongPathNameW GetLongPathNameWrapW
  162. #define GetLongPathNameA GetLongPathNameWrapA
  163. #define GetStringTypeExW GetStringTypeExWrapW
  164. #define GetTempFileNameW GetTempFileNameWrapW
  165. #define GetTempPathW GetTempPathWrapW
  166. #define GetTextExtentPoint32W GetTextExtentPoint32WrapW
  167. #define GetTextFaceW GetTextFaceWrapW
  168. #define GetTextMetricsW GetTextMetricsWrapW
  169. #define GetTimeFormatW GetTimeFormatWrapW
  170. #define GetDateFormatW GetDateFormatWrapW
  171. #define GetUserNameW GetUserNameWrapW
  172. #define GetWindowLongW GetWindowLongWrapW
  173. #define GetEnvironmentVariableW GetEnvironmentVariableWrapW
  174. #ifndef NO_W95_ATL_WRAPS_TBS
  175. // #define NO_W95_ATL_WRAPS_TBS if you use ATL.
  176. #define GetWindowTextW GetWindowTextWrapW
  177. #endif // NO_W95_ATL_WRAPS_TBS
  178. #define GetWindowTextLengthW GetWindowTextLengthWrapW
  179. #define GetWindowsDirectoryW GetWindowsDirectoryWrapW
  180. #define InsertMenuW InsertMenuWrapW
  181. #define InsertMenuItemW InsertMenuItemWrapW
  182. #define IsBadStringPtrW IsBadStringPtrWrapW
  183. #define IsDialogMessageW IsDialogMessageWrapW
  184. #define LoadAcceleratorsW LoadAcceleratorsWrapW
  185. #define LoadBitmapW LoadBitmapWrapW
  186. #define LoadCursorW LoadCursorWrapW
  187. #define LoadIconW LoadIconWrapW
  188. #define LoadImageW LoadImageWrapW
  189. #define LoadLibraryW LoadLibraryWrapW
  190. #define LoadLibraryExW LoadLibraryExWrapW
  191. #define LoadMenuW LoadMenuWrapW
  192. #define LoadStringW LoadStringWrapW
  193. #define MessageBoxIndirectW MessageBoxIndirectWrapW
  194. #define MessageBoxW MessageBoxWrapW
  195. #define ModifyMenuW ModifyMenuWrapW
  196. #define GetCharWidth32W GetCharWidth32WrapW
  197. #define GetCharacterPlacementW GetCharacterPlacementWrapW
  198. #define CopyFileW CopyFileWrapW
  199. #define MoveFileW MoveFileWrapW
  200. #define OemToCharW OemToCharWrapW
  201. #define OpenEventW OpenEventWrapW
  202. #define OutputDebugStringW OutputDebugStringWrapW
  203. #define PeekMessageW PeekMessageWrapW
  204. #define PostMessageW PostMessageWrapW
  205. #define PostThreadMessageW PostThreadMessageWrapW
  206. #define RegCreateKeyW RegCreateKeyWrapW
  207. #define RegCreateKeyExW RegCreateKeyExWrapW
  208. #define RegDeleteKeyW RegDeleteKeyWrapW
  209. #define RegDeleteValueW RegDeleteValueWrapW
  210. #define RegEnumKeyW RegEnumKeyWrapW
  211. #define RegEnumKeyExW RegEnumKeyExWrapW
  212. #define RegOpenKeyW RegOpenKeyWrapW
  213. #define RegOpenKeyExW RegOpenKeyExWrapW
  214. #define RegQueryInfoKeyW RegQueryInfoKeyWrapW
  215. #define RegQueryValueW RegQueryValueWrapW
  216. #define RegQueryValueExW RegQueryValueExWrapW
  217. #define RegSetValueW RegSetValueWrapW
  218. #define RegSetValueExW RegSetValueExWrapW
  219. #define RegisterClassW RegisterClassWrapW
  220. #define RegisterClassExW RegisterClassExWrapW
  221. #define RegisterClipboardFormatW RegisterClipboardFormatWrapW
  222. #define RegisterWindowMessageW RegisterWindowMessageWrapW
  223. #define RemoveDirectoryW RemoveDirectoryWrapW
  224. #define RemovePropW RemovePropWrapW
  225. #define SearchPathW SearchPathWrapW
  226. #define SendDlgItemMessageW SendDlgItemMessageWrapW
  227. #define SendMessageW SendMessageWrapW
  228. #define SendMessageTimeoutW SendMessageTimeoutWrapW
  229. #define SetCurrentDirectoryW SetCurrentDirectoryWrapW
  230. #define SetDlgItemTextW SetDlgItemTextWrapW
  231. #define SetMenuItemInfoW SetMenuItemInfoWrapW
  232. #define SetPropW SetPropWrapW
  233. #define SetFileAttributesW SetFileAttributesWrapW
  234. #define SetWindowLongW SetWindowLongWrapW
  235. #ifndef NO_W95_SHELL32_WRAPS
  236. #define ExtractIconW ExtractIconWrapW
  237. #define SHGetFileInfoW SHGetFileInfoWrapW
  238. #define SHBrowseForFolderW SHBrowseForFolderWrapW
  239. #define ShellExecuteExW ShellExecuteExWrapW
  240. #define SHFileOperationW SHFileOperationWrapW
  241. #define SHGetNewLinkInfoW SHGetNewLinkInfoWrapW
  242. #define SHDefExtractIconW SHDefExtractIconWrapW
  243. #define SHChangeNotify SHChangeNotifyWrap
  244. #define SHFlushSFCache SHFlushSFCacheWrap
  245. #define SHGetPathFromIDListW SHGetPathFromIDListWrapW
  246. #endif // NO_W95_SHELL32_WRAPS
  247. #define GetUserNameW GetUserNameWrapW
  248. #define RegEnumValueW RegEnumValueWrapW
  249. #define WritePrivateProfileStructW WritePrivateProfileStructWrapW
  250. #define GetPrivateProfileStructW GetPrivateProfileStructWrapW
  251. #define CreateProcessW CreateProcessWrapW
  252. #define DdeInitializeW DdeInitializeWrapW
  253. #define DdeCreateStringHandleW DdeCreateStringHandleWrapW
  254. #define DdeQueryStringW DdeQueryStringWrapW
  255. #define GetSaveFileNameW GetSaveFileNameWrapW
  256. #define GetOpenFileNameW GetOpenFileNameWrapW
  257. #define PageSetupDlgW PageSetupDlgWrapW
  258. #define PrintDlgW PrintDlgWrapW
  259. #define SetWindowsHookExW SetWindowsHookExWrapW
  260. #define SetWindowTextW SetWindowTextWrapW
  261. #define StartDocW StartDocWrapW
  262. #define CreateColorSpaceW CreateColorSpaceWrapW
  263. #define SystemParametersInfoW SystemParametersInfoWrapW
  264. #ifndef NO_W95_TRANSACCEL_WRAPS_TBS
  265. // #define NO_W95_TRANSACCEL_WRAPS_TBS if one of the objects uses IOleInPlaceActiveObject which has a TranslateAccelerator method.
  266. #define TranslateAcceleratorW TranslateAcceleratorWrapW
  267. #endif // NO_W95_TRANSACCEL_WRAPS_TBS
  268. #define UnregisterClassW UnregisterClassWrapW
  269. #define VkKeyScanW VkKeyScanWrapW
  270. #define WinHelpW WinHelpWrapW
  271. #define WritePrivateProfileStringW WritePrivateProfileStringWrapW
  272. #define WNetRestoreConnectionW WNetRestoreConnectionWrapW
  273. #define WNetGetLastErrorW WNetGetLastErrorWrapW
  274. #endif // NO_W95WRAPS_UNITHUNK
  275. #if !defined(NO_W95WRAPS_UNITHUNK) && !defined(NO_W95WRAPS_MLUI)
  276. #define CreateDialogIndirectParamW CreateDialogIndirectParamWrapW
  277. #define CreateDialogParamW CreateDialogParamWrapW
  278. #define DialogBoxIndirectParamW DialogBoxIndirectParamWrapW // UNICODE, ML
  279. //#ifdef DialogBoxIndirectW
  280. //#undef DialogBoxIndirectW
  281. //#endif
  282. //#define DialogBoxIndirectW(i,h,w,f) DialogBoxIndirectParamWrapW(i,h,w,f,d,0) // UNICODE, ML
  283. #define DialogBoxParamW DialogBoxParamWrapW // UNICODE, ML
  284. //#ifdef DialogBoxW
  285. //#undef DialogBoxW
  286. //#endif
  287. //#define DialogBoxW(i,t,w,f) DialogBoxParamWrapW(i,t,w,f,0) // UNICODE, ML
  288. #define ShellMessageBoxW ShellMessageBoxWrapW
  289. #define TrackPopupMenu TrackPopupMenuWrap
  290. #define TrackPopupMenuEx TrackPopupMenuExWrap
  291. #define DeleteMenu DeleteMenuWrap
  292. #define DestroyMenu DestroyMenuWrap
  293. #endif // !defined(NO_W95WRAPS_UNITHUNK) || !defined(NO_W95WRAPS_MLUI)
  294. #if !defined(NO_OLE32_WRAPS)
  295. #define CLSIDFromString CLSIDFromStringWrap
  296. #define CLSIDFromProgID CLSIDFromProgIDWrap
  297. #endif
  298. #endif // _X86_
  299. #endif // _INC_W95WRAPS