readme-winceapi-port 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. I.Introduction
  2. Main goal of these files is to make available wince api under FPC.
  3. Even if wince5.0 informations are available since end of 2004, wince 4.2
  4. second edition api have been used -main reason is that i can't find on the
  5. market any Pocket PC wince5 based -.
  6. Of course, any constructive comments will be appreciated
  7. Sincerely Yours
  8. [email protected]
  9. II.Remarks on how this have been done
  10. a)Row materials :
  11. -existing FPC win32api files from latest FPC 2.X.1 snapshot :
  12. windows.pp
  13. base.inc
  14. defines.inc
  15. errors.inc
  16. func.inc
  17. messages.inc
  18. redef.inc
  19. struct.inc
  20. unidef.inc
  21. - sdk provided .h
  22. - sdk provided .lib wich are :
  23. authhlp.lib, aygshell.lib, btd.lib, bthguid.lib, bthlink.lib,
  24. bthutil.lib, cecap.lib, CellCore.lib, cemapi.lib,
  25. ceosutil.lib, ceshell.lib, commctrl.lib, commdlg.lib,
  26. conncfg.lib, coredll.lib, crypt32.lib, cxport.lib,
  27. dmoguids.lib, doclist.lib, grognard.lib,
  28. gx.lib, htmlview.lib, httpd.lib, imaging.lib, imgdecmp.lib,
  29. inkx.lib, iphlpapi.lib, mmtimer.lib, mqoa.lib, msdmo.lib,
  30. msmqrt.lib, msscript.lib, msxml.lib, msxmlguid.lib,
  31. ndis.lib, note_prj.lib, ntcompat.lib, ole32.lib,
  32. oleaut32.lib, phone.lib, pimstore.lib, pndtapi.lib,
  33. pushprxy.lib, richink.lib, secur32.lib, sms.lib,
  34. strmiids.lib, toolhelp.lib, urlmon.lib, uuid.lib,
  35. VBarCall.lib, VoiceCtl.lib, WAP.lib, webview.lib,
  36. wininet.lib, winsock.lib, wmlview.lib, ws2.lib,
  37. wsp.lib, wvuuid.lib.
  38. one problem was to be sure to use the right function name (with or without W)
  39. and the right corresponding wince dll name (wich is not same as win32) for each lib.
  40. Text extraction list of dll exported functions have been made.
  41. //with this kind of cmd script file:
  42. //FOR %%a in (*.lib) do arm-pe-objdump -p %aa >%aa-txt
  43. looking at lib imported, because some functions are implemented
  44. directly in the lib and not from the dll.
  45. b-Tools
  46. extensive use SciTE editor (based on Scintilla project, www.scintilla.org),
  47. particularly 'find in file' function.
  48. c-How porting ?
  49. .discussing in ng, Florian and Yuri think that for several reasons(including automatic win32
  50. file genaration), dedicatd winceapi files were better solution instead of {$ifdef} approach
  51. in order to have only one set of files for all windows plateforms.
  52. I remain persuated that with so big amount of stuff will be less time consuming to maintain
  53. if there is only one set of files for all windows plateforms at least for common base pritimives.
  54. ..Also, it was important to be able to compile at any time, checking (struct type and syntax errors) of
  55. added functions and also to be able to stop at any time beeing sure that no function was forgotten
  56. or unckecked.
  57. So until now changes are win32-i386 compilable.
  58. 2 differents rules have been retained for porting depending of file kind :
  59. 1°) concerning const, records and all stuff located in :
  60. base.inc, defines.inc, errors.inc, messages.inc, struct.inc
  61. Win32 actual files have been reused 'as this', just added traceability informations
  62. at end of lines concerning changes or updates :
  63. //xxxxx : just checked no changes
  64. //+xxxxx : added
  65. //-xxxxx : removed
  66. //~xxxxx : updated
  67. xxxxx is the corresponding sdk .h filename
  68. defines were reused exactly as they are used in sdk .h files
  69. 2°) concerning functions and procedures :
  70. func.inc,redef.inc,unidef.inc
  71. 4 kinds of zone have been created using ifdef and/or comments
  72. x1.common win32 & wince
  73. x2.win32 only
  74. x3.win32 or wince not checked
  75. x4.wince only
  76. Starting, every existing win32 functions are moved in the x3 zone, then for each function
  77. using 'find in file', i search corresponding dll name and .h definition to update.
  78. Then - if required - the function header is updated and moved in the appropriate zone
  79. x1, x2 or x4.
  80. Actually unidef.inc has been done, there is no more x3 zone but func.inc and redef.inc
  81. have all zones.
  82. If an error is made, and an unexisting external function is declared in an existing dll then you'll
  83. get an error message saying 'not a valid PocketPC application'. That said, if you plan to add a new
  84. api, make a simple 'hello world' prg with just the new-api unit in uses clause, and check running prog
  85. every 10 or 20 functions, better than testing directly a new 200 functions block.
  86. III.Install
  87. windows.pp -> fpcroot\rtl\wince
  88. *.inc -> fpcroot\rtl\wince\wininc
  89. IV.Changes
  90. 2005-08-17 :
  91. consts and structs related files :
  92. defines added _PPC_ was (__PPC__), _MIPS_,_MIPS64, _X86_,_MPPC_,_IA64_,SHx,SH3,SH4,SH3e,ARM
  93. several consts and struct added
  94. functions related files :
  95. {$ifdef} created
  96. 2005-08-22 :
  97. consts and structs related files :
  98. several consts and struct added
  99. functions related files :
  100. unidef.inc : 100% done
  101. func.inc : 2% done
  102. redef.inc : 0% done
  103. .several header habe been updated because type was longint and was 'int' in api doc.
  104. on 32bits plateforms there's no difference but on 64 bits there is,
  105. so according to api doc i updated longint to Integer when it was the case for .h definition.