cpl_win32ce_api.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /******************************************************************************
  2. * $Id: cpl_win32ce_api.h 10645 2007-01-18 02:22:39Z warmerdam $
  3. *
  4. * Name: cpl_win32ce_api.h
  5. * Project: CPL - Common Portability Library
  6. * Purpose: ASCII wrappers around only Unicode Windows CE API.
  7. * Author: Mateusz £oskot, mloskot@taxussi.com.pl
  8. *
  9. ******************************************************************************
  10. * Copyright (c) 2006, Mateusz £oskot
  11. *
  12. * Permission is hereby granted, free of charge, to any person obtaining a
  13. * copy of this software and associated documentation files (the "Software"),
  14. * to deal in the Software without restriction, including without limitation
  15. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  16. * and/or sell copies of the Software, and to permit persons to whom the
  17. * Software is furnished to do so, subject to the following conditions:
  18. *
  19. * The above copyright notice and this permission notice shall be included
  20. * in all copies or substantial portions of the Software.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  23. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  25. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  26. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  27. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  28. * DEALINGS IN THE SOFTWARE.
  29. ****************************************************************************/
  30. #ifndef _CPL_WINCEAPI_H_INCLUDED
  31. #define _CPL_WINCEAPI_H_INCLUDED 1
  32. #define WIN32CE
  33. #if defined(WIN32CE)
  34. #include <windows.h>
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif /* __cplusplus */
  38. /*
  39. * Windows CE API non-Unicode Wrappers
  40. */
  41. HMODULE CE_LoadLibraryA(
  42. LPCSTR lpLibFileName
  43. );
  44. FARPROC CE_GetProcAddressA(
  45. HMODULE hModule,
  46. LPCSTR lpProcName
  47. );
  48. DWORD CE_GetModuleFileNameA(
  49. HMODULE hModule,
  50. LPSTR lpFilename,
  51. DWORD nSize
  52. );
  53. HANDLE CE_CreateFileA(
  54. LPCSTR lpFileName,
  55. DWORD dwDesiredAccess,
  56. DWORD dwShareMode,
  57. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  58. DWORD dwCreationDisposition,
  59. DWORD dwFlagsAndAttributes,
  60. HANDLE hTemplateFile
  61. );
  62. /* Replace Windows CE API calls with our own non-Unicode equivalents. */
  63. /* XXX - mloskot - those defines are quite confusing ! */
  64. /*
  65. #ifdef LoadLibrary
  66. # undef LoadLibrary
  67. # define LoadLibrary CE_LoadLibraryA
  68. #endif
  69. #ifdef GetProcAddress
  70. # undef GetProcAddress
  71. # define GetProcAddress CE_GetProcAddressA
  72. #endif
  73. #ifdef GetModuleFileName
  74. # undef GetModuleFileName
  75. # define GetModuleFileName CE_GetModuleFileNameA
  76. #endif
  77. #ifdef CreateFile
  78. # undef CreateFile
  79. # define CreateFile CE_CreateFileA
  80. #endif
  81. */
  82. #ifdef __cplusplus
  83. }
  84. #endif /* __cplusplus */
  85. #endif /* #ifdef WIN32CE */
  86. #endif /* #ifndef _CPL_WINCEAPI_H_INCLUDED */