Changeset 21384 for trunk/doc


Ignore:
Timestamp:
Jul 5, 2010, 3:44:51 PM (15 years ago)
Author:
dmik
Message:

SEH: Added some info to Porting.txt and examples to Odin32API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/Porting.txt

    r3990 r21384  
    2020Keep in mind that Odin is still alpha software, so don't expect all apis to
    2121work exactly like those in Windows NT.
    22 If you find bugs, please contact the developers or send an email to the 
     22If you find bugs, please contact the developers or send an email to the
    2323Odin programmers mailinglist (win32os2-wai@egroups.com).
    2424
     
    2626-------------------------------------------------
    2727- IBM VisualAge C++ 3.08
    28 - OS/2 Warp 4 Toolkit (project apparently doesn't compile with 
     28- OS/2 Warp 4 Toolkit (project apparently doesn't compile with
    2929  VAC's OS/2 headers)
    3030  Might also work with EMX headers. (haven't tried this)
     
    9898-----------------------------
    9999Usually you shouldn't have to make many changes to the existing win32
    100 source code. 
     100source code.
    101101However, there might be a few differences between the MS SDK and Odin
    102102headers. If you find such problems, please correct them and notify
     
    105105Complex applications might be hard to port to OS/2 for several reasons:
    106106- Compiler differences (i.e. VAC 3.08 doesn't support unnamed unions)
    107   VAC 3.6.5 should be a better choice for compiling win32 sources, but 
     107  VAC 3.6.5 should be a better choice for compiling win32 sources, but
    108108  it has it's own share of problems (bugs).
    109109- TLS (thread local storage) data; VAC has no facilities to support this,
     
    112112  You can recognize this type of data by the __declspec(thread) keyword.
    113113  Using the TLS apis (i.e. TlsAlloc) is no problem.
    114 - OLE/COM objects. Wine headers aren't exactly built with C++ in mind, 
     114- OLE/COM objects. Wine headers aren't exactly built with C++ in mind,
    115115  so you'll most likely run into a lot of problems if the app uses
    116116  these win32 features.
     
    122122for Odin. This handler is used to support file mappings.
    123123You must make sure that your code doesn't remove this handler from
    124 the chain of exception handlers. 
     124the chain of exception handlers.
    125125To create a thread, use CreateThread; not _beginthread or DosCreateThread.
    126126CreateThread takes care of setting up an exception handler, creates TLS
    127 structures and calls dll entrypoints.
     127structures and calls dll entrypoints.
     128
     129Starting with r21382, Odin also implements the compiler-level support for SEH
     130(structured exception handling) performed using the __try/__except statement in
     131MSVC. Note that this is not a real compiler statement, it is just an emulation
     132of the corresponding MSVC behavior and it has the following limitations:
     133- You should not use goto or longjmp() to jump into or out of the __try or
     134  __except block -- this will most likely screw up the stack.
     135- __try/__finally/__leave functionality is not yet supported.
     136- Only the GCC compiler is supported ATM.
     137
     138In order to enable proper handling of the __try/__except statement, you must
     139call EnableSEH() right before a call to RegisterLXDll() or RegisterLXExe() (as
     140described above). A failure to do so will break the filter expression
     141functionality.
     142
     143Note that you normally don't need to chage the Windows sources that the
     144__try/__except statement themselves (except for the limitations mentioned above)
     145as they should already include <excpt.h> (which is normally provided by a
     146compiler for the windows platform) and the one included in Odin SDK provides
     147the source-level compatible definitions.
    128148
    1291492.6 Sample makefile
     
    145165
    146166# Define project specific macros
    147 PROJ_OBJS  = generic.obj 
    148 BASE_OBJS  = resource.obj odinexe.obj 
     167PROJ_OBJS  = generic.obj
     168BASE_OBJS  = resource.obj odinexe.obj
    149169EXTRA_LIBS = $(PDWIN32_LIB)\version.lib
    150170GLOBAL_DEP = generic.h resource.h
     
    165185# Build rule for resource file
    166186resource.asm: $(PROJ).rc $(RC_DEP)
    167     $(RC) $(RCFLAGS) -o resource.asm $(PROJ).rc 
     187    $(RC) $(RCFLAGS) -o resource.asm $(PROJ).rc
    168188
    169189# Build rule for EXE
     
    184204-------------------------
    185205
    186 As ODIN became an open source project, everybody is kindly invited to 
     206As ODIN became an open source project, everybody is kindly invited to
    187207contribute his/her share to the progress of the project. May it be
    188 active coding, fixing bugs or just providing detailed information about 
     208active coding, fixing bugs or just providing detailed information about
    189209examined problems.
    190210
    191211We suggest you subscribe to win32os2-wai and the corresponsing mailing lists
    192212on http://www.egroups.com.
    193 In case you are interested in participating, every member of the project will 
    194 be happy to give you direction to the right places and to give a personal 
     213In case you are interested in participating, every member of the project will
     214be happy to give you direction to the right places and to give a personal
    195215introduction to further development of the particular modules.
    196216
Note: See TracChangeset for help on using the changeset viewer.