modified include/reactos/wine/exception.h
authorKJK::Hyperion <hackbunny@reactos.org>
Sun, 21 Dec 2008 03:58:19 +0000 (03:58 +0000)
committerKJK::Hyperion <hackbunny@reactos.org>
Sun, 21 Dec 2008 03:58:19 +0000 (03:58 +0000)
   Farewell Wine exception handling macros. You won't be missed

modified   dll/win32/icmp/icmp_main.c
   Removed gratuitous use of _getpid
   Winsock APIs don't set errno, they set the last error
   As a consequence, icmp.dll no longer depends on msvcrt.dll

modified   tools/rbuild/module.cpp
   Link DLLs to ntdll's CRT instead of msvcrt's by default (most DLLs don't actually need msvcrt)

Everything else:
   Set crt attribute of <module> to "msvcrt" if ntdll isn't good enough
   Link to pseh if necessary

svn path=/trunk/; revision=38221

37 files changed:
reactos/dll/3rdparty/mesa32/mesa32.rbuild
reactos/dll/cpl/desk/desk.rbuild
reactos/dll/cpl/intl/intl.rbuild
reactos/dll/cpl/main/main.rbuild
reactos/dll/cpl/mmsys/mmsys.rbuild
reactos/dll/cpl/usrmgr/usrmgr.rbuild
reactos/dll/directx/ddraw/ddraw.rbuild
reactos/dll/directx/dsound/dsound.rbuild
reactos/dll/directx/wine/wined3d/wined3d.rbuild
reactos/dll/win32/crypt32/crypt32.rbuild
reactos/dll/win32/dbghelp/dbghelp.rbuild
reactos/dll/win32/dnsapi/dnsapi.rbuild
reactos/dll/win32/gdiplus/gdiplus.rbuild
reactos/dll/win32/glu32/glu32.rbuild
reactos/dll/win32/icmp/icmp_main.c
reactos/dll/win32/iphlpapi/iphlpapi.rbuild
reactos/dll/win32/jscript/jscript.rbuild
reactos/dll/win32/msi/msi.rbuild
reactos/dll/win32/msvcrt/msvcrt.rbuild
reactos/dll/win32/msxml3/msxml3.rbuild
reactos/dll/win32/odbc32/odbc32.rbuild
reactos/dll/win32/ole32/ole32.rbuild
reactos/dll/win32/oleaut32/oleaut32.rbuild
reactos/dll/win32/opengl32/opengl32.rbuild
reactos/dll/win32/rpcrt4/rpcrt4.rbuild
reactos/dll/win32/rsaenh/rsaenh.rbuild
reactos/dll/win32/setupapi/setupapi.rbuild
reactos/dll/win32/shell32/shell32.rbuild
reactos/dll/win32/syssetup/syssetup.rbuild
reactos/dll/win32/twain_32/twain_32.rbuild
reactos/dll/win32/winhttp/winhttp.rbuild
reactos/dll/win32/wininet/wininet.rbuild
reactos/dll/win32/winmm/winmm.rbuild
reactos/dll/win32/wintrust/wintrust.rbuild
reactos/include/reactos/wine/exception.h
reactos/lib/3rdparty/libxml2/libxml2.rbuild
reactos/tools/rbuild/module.cpp

index bef9794..051c534 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="mesa32" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_MESA32}" installbase="system32" installname="mesa32.dll" allowwarnings="true">
+<module name="mesa32" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_MESA32}" installbase="system32" installname="mesa32.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="src/drivers/windows/icd/mesa.def" />
        <linkerflag>-enable-stdcall-fixup</linkerflag>
        <library>ntdll</library>
index d62a85f..131e0da 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="desk" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_DESK}" installbase="system32" installname="desk.cpl" unicode="yes">
+<module name="desk" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_DESK}" installbase="system32" installname="desk.cpl" unicode="yes" crt="msvcrt">
        <importlibrary definition="desk.def" />
        <include base="desk">.</include>
        <define name="_WIN32" />
index be1749a..800c9ec 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="intl" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_INTL}" installbase="system32" installname="intl.cpl" unicode="yes">
+<module name="intl" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_INTL}" installbase="system32" installname="intl.cpl" unicode="yes" crt="msvcrt">
     <importlibrary definition="intl.def" />
     <include base="intl">.</include>
     <library>kernel32</library>
index 3353e28..563add0 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="main" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_MAIN}" installbase="system32" installname="main.cpl" unicode="yes">
+<module name="main" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_MAIN}" installbase="system32" installname="main.cpl" unicode="yes" crt="msvcrt">
        <importlibrary definition="main.def" />
        <include base="main">.</include>
        <library>kernel32</library>
index 304feb8..a3c0237 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="mmsys" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_MMSYS}" installbase="system32" installname="mmsys.cpl" unicode="yes">
+<module name="mmsys" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_MMSYS}" installbase="system32" installname="mmsys.cpl" unicode="yes" crt="msvcrt">
        <importlibrary definition="mmsys.spec" />
        <include base="mmsys">.</include>
        <library>kernel32</library>
index 8026fd9..1a612c9 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="usrmgr" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_USRMGR}" installbase="system32" installname="usrmgr.cpl" unicode="yes">
+<module name="usrmgr" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_USRMGR}" installbase="system32" installname="usrmgr.cpl" unicode="yes" crt="msvcrt">
        <importlibrary definition="usrmgr.def" />
        <include base="usrmgr">.</include>
        <library>kernel32</library>
index 14011ee..ab79138 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="ddraw" type="win32dll" installbase="system32" installname="ddraw.dll" allowwarnings ="true" unicode="yes">
+<module name="ddraw" type="win32dll" installbase="system32" installname="ddraw.dll" allowwarnings ="true" unicode="yes" crt="msvcrt">
        <importlibrary definition="ddraw.def" />
        <include base="ddraw">.</include>
        <library>kernel32</library>
index 6370a01..8701cf4 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="dsound" type="win32dll" baseaddress="${BASEADDRESS_DSOUND}" installbase="system32" installname="dsound.dll" allowwarnings ="true">
+<module name="dsound" type="win32dll" baseaddress="${BASEADDRESS_DSOUND}" installbase="system32" installname="dsound.dll" allowwarnings ="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="dsound.spec" />
        <include base="dsound">.</include>
index 6c0faa8..6c74744 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
-<module name="wined3d" type="win32dll" installbase="system32" installname="wined3d.dll" allowwarnings ="true">
+<module name="wined3d" type="win32dll" installbase="system32" installname="wined3d.dll" allowwarnings ="true" crt="msvcrt">
        <importlibrary definition="wined3d.def" />
        <include base="wined3d">.</include>
        <include base="ReactOS">include/reactos/wine</include>
index 1c4eaab..bb613bf 100644 (file)
@@ -1,4 +1,4 @@
-<module name="crypt32" type="win32dll" baseaddress="${BASEADDRESS_CRYPT32}" installbase="system32" installname="crypt32.dll" allowwarnings="true">
+<module name="crypt32" type="win32dll" baseaddress="${BASEADDRESS_CRYPT32}" installbase="system32" installname="crypt32.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="crypt32.spec" />
        <include base="crypt32">.</include>
        <include base="ReactOS">include/reactos/wine</include>
@@ -10,6 +10,7 @@
        <library>kernel32</library>
        <library>ntdll</library>
        <library>imagehlp</library>
+       <library>pseh</library>
        <file>base64.c</file>
        <file>cert.c</file>
        <file>chain.c</file>
@@ -35,4 +36,6 @@
        <file>ctl.c</file>
        <file>message.c</file>
        <file>crypt32.rc</file>
+       <!-- See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38054#c7 -->
+       <compilerflag>-fno-unit-at-a-time</compilerflag>
 </module>
index 13b7157..a0611d6 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="dbghelp" type="win32dll" baseaddress="${BASEADDRESS_DBGHELP}" installbase="system32" installname="dbghelp.dll" allowwarnings="true">
+<module name="dbghelp" type="win32dll" baseaddress="${BASEADDRESS_DBGHELP}" installbase="system32" installname="dbghelp.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="dbghelp.spec" />
        <include base="dbghelp">.</include>
        <include base="ReactOS">include/reactos/wine</include>
@@ -31,5 +31,6 @@
        <library>kernel32</library>
        <library>version</library>
        <library>ntdll</library>
+       <library>pseh</library>
 </module>
 </group>
index ad4b273..559927c 100644 (file)
@@ -1,4 +1,4 @@
-<module name="dnsapi" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_DNSAPI}" installbase="system32" installname="dnsapi.dll">
+<module name="dnsapi" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_DNSAPI}" installbase="system32" installname="dnsapi.dll" crt="msvcrt">
        <importlibrary definition="dnsapi.def" />
        <include base="dnsapi">include</include>
        <include base="adns">src</include>
index f889096..ca5b7c3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="gdiplus" type="win32dll" baseaddress="${BASEADDRESS_GDIPLUS}" installbase="system32" installname="gdiplus.dll" allowwarnings="true">
+<module name="gdiplus" type="win32dll" baseaddress="${BASEADDRESS_GDIPLUS}" installbase="system32" installname="gdiplus.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="gdiplus.spec" />
        <include base="gdiplus">.</include>
        <include base="ReactOS">include/reactos/wine</include>
index d52231d..9ce9837 100644 (file)
@@ -1,4 +1,4 @@
-<module name="glu32" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_GLU32}" installbase="system32" installname="glu32.dll" allowwarnings="true">
+<module name="glu32" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_GLU32}" installbase="system32" installname="glu32.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="glu32.def" />
        <include base="glu32">include</include>
        <include base="glu32">libnurbs/internals</include>
index 3d7af0c..d9f2658 100644 (file)
@@ -231,7 +231,7 @@ DWORD WINAPI IcmpSendEcho(
     /* check the request size against SO_MAX_MSG_SIZE using getsockopt */
 
     /* Prepare the request */
-    id=_getpid() & 0xFFFF;
+    id=GetCurrentProcessId() & 0xFFFF;
     seq=InterlockedIncrement(&icmp_sequence) & 0xFFFF;
 
     reqsize=ICMP_MINLEN+RequestSize;
@@ -319,18 +319,18 @@ DWORD WINAPI IcmpSendEcho(
     res=sendto(icp->sid, reqbuf, reqsize, 0, (struct sockaddr*)&addr, sizeof(addr));
     HeapFree(GetProcessHeap (), 0, reqbuf);
     if (res<0) {
-        if (errno==EMSGSIZE)
+        if (WSAGetLastError()==WSAEMSGSIZE)
             SetLastError(IP_PACKET_TOO_BIG);
         else {
-            switch (errno) {
-            case ENETUNREACH:
+            switch (WSAGetLastError()) {
+            case WSAENETUNREACH:
                 SetLastError(IP_DEST_NET_UNREACHABLE);
                 break;
-            case EHOSTUNREACH:
+            case WSAEHOSTUNREACH:
                 SetLastError(IP_DEST_HOST_UNREACHABLE);
                 break;
             default:
-                TRACE("unknown error: errno=%d\n",errno);
+                TRACE("unknown error: errno=%d\n",WSAGetLastError());
                 SetLastError(IP_GENERAL_FAILURE);
             }
         }
index 94b3d31..7e6919c 100644 (file)
@@ -1,4 +1,4 @@
-<module name="iphlpapi" type="win32dll" baseaddress="${BASEADDRESS_IPHLPAPI}" installbase="system32" installname="iphlpapi.dll" allowwarnings="true" unicode="yes">
+<module name="iphlpapi" type="win32dll" baseaddress="${BASEADDRESS_IPHLPAPI}" installbase="system32" installname="iphlpapi.dll" allowwarnings="true" unicode="yes" crt="msvcrt">
        <importlibrary definition="iphlpapi.spec" />
        <include base="iphlpapi">include</include>
        <include base="ReactOS">include/reactos/wine</include>
index 880339d..88aa973 100644 (file)
@@ -1,5 +1,5 @@
 <group>
-<module name="jscript" type="win32dll" baseaddress="${BASEADDRESS_JSCRIPT}" installbase="system32" installname="jscript.dll" allowwarnings="true">
+<module name="jscript" type="win32dll" baseaddress="${BASEADDRESS_JSCRIPT}" installbase="system32" installname="jscript.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="jscript.spec" />
        <include base="jscript">.</include>
index 08880b7..c85f170 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="msi" type="win32dll" baseaddress="${BASEADDRESS_MSI}" installbase="system32" installname="msi.dll" allowwarnings="true">
+<module name="msi" type="win32dll" baseaddress="${BASEADDRESS_MSI}" installbase="system32" installname="msi.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="msi.spec" />
        <include base="msi">.</include>
@@ -69,6 +69,7 @@
        <library>kernel32</library>
        <library>odbccp32</library>
        <library>ntdll</library>
+       <library>pseh</library>
        <dependency>msiserver</dependency>
        <dependency>msiheader</dependency>
 </module>
index 863904e..1e05811 100644 (file)
@@ -20,6 +20,7 @@
        <library>wine</library>
        <library>kernel32</library>
        <library>ntdll</library>
+       <library>pseh</library>
        <pch>precomp.h</pch>
        <file>dllmain.c</file>
        <file>msvcrt.rc</file>
index da71855..e5553f4 100644 (file)
@@ -1,5 +1,5 @@
 <group>
-<module name="msxml3" type="win32dll" baseaddress="${BASEADDRESS_MSXML3}" installbase="system32" installname="msxml3.dll" allowwarnings="true">
+<module name="msxml3" type="win32dll" baseaddress="${BASEADDRESS_MSXML3}" installbase="system32" installname="msxml3.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="msxml3.spec" />
        <include base="msxml3">.</include>
index 6a71d3d..5417986 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="odbc32" type="win32dll" baseaddress="${BASEADDRESS_ODBC32}" installbase="system32" installname="odbc32.dll" allowwarnings="true" >
+<module name="odbc32" type="win32dll" baseaddress="${BASEADDRESS_ODBC32}" installbase="system32" installname="odbc32.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="odbc32.spec" />
        <include base="odbc32">.</include>
        <include base="ReactOS">include/reactos/wine</include>
index 2bcc797..c2ce4d3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="ole32" type="win32dll" baseaddress="${BASEADDRESS_OLE32}" installbase="system32" installname="ole32.dll" allowwarnings="true">
+<module name="ole32" type="win32dll" baseaddress="${BASEADDRESS_OLE32}" installbase="system32" installname="ole32.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="ole32.spec" />
        <include base="ole32">.</include>
@@ -61,6 +61,8 @@
        <file>dcom.idl</file>
        <file>irot.idl</file>
        <include base="ole32" root="intermediate">.</include>
+       <!-- See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38054#c7 -->
+       <compilerflag>-fno-unit-at-a-time</compilerflag>
 </module>
 <module name="ole32_irot_server" type="rpcserver">
        <file>irot.idl</file>
index 1cc9243..fe1a201 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="oleaut32" type="win32dll" baseaddress="${BASEADDRESS_OLEAUT32}" installbase="system32" installname="oleaut32.dll" allowwarnings="true">
+<module name="oleaut32" type="win32dll" baseaddress="${BASEADDRESS_OLEAUT32}" installbase="system32" installname="oleaut32.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="oleaut32.spec" />
        <include base="oleaut32">.</include>
index f201ddd..7f40023 100644 (file)
@@ -1,4 +1,4 @@
-<module name="opengl32" type="win32dll" baseaddress="${BASEADDRESS_OPENGL32}" installbase="system32" installname="opengl32.dll" unicode="yes">
+<module name="opengl32" type="win32dll" baseaddress="${BASEADDRESS_OPENGL32}" installbase="system32" installname="opengl32.dll" unicode="yes" crt="msvcrt">
        <importlibrary definition="opengl32.def" />
        <define name="_DISABLE_TIDENTS" />
        <library>ntdll</library>
index ae4cb6a..a608292 100644 (file)
@@ -1,4 +1,4 @@
-<module name="rpcrt4" type="win32dll" baseaddress="${BASEADDRESS_RPCRT4}" installbase="system32" installname="rpcrt4.dll" allowwarnings="true">
+<module name="rpcrt4" type="win32dll" baseaddress="${BASEADDRESS_RPCRT4}" installbase="system32" installname="rpcrt4.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="rpcrt4.spec" />
        <include base="rpcrt4">.</include>
@@ -39,6 +39,8 @@
        <file>rpcrt4.rc</file>
        <file>epm.idl</file>
        <include base="rpcrt4" root="intermediate">.</include>
+       <!-- See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38054#c7 -->
+       <compilerflag>-fno-unit-at-a-time</compilerflag>
 </module>
 <module name="rpcrt4_epm_client" type="rpcclient">
        <file>epm.idl</file>
index e68a6cf..d7d6b24 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="rsaenh" type="win32dll" baseaddress="${BASEADDRESS_RSAENH}" installbase="system32" installname="rsaenh.dll" allowwarnings="true">
+<module name="rsaenh" type="win32dll" baseaddress="${BASEADDRESS_RSAENH}" installbase="system32" installname="rsaenh.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="rsaenh.spec" />
        <include base="rsaenh">.</include>
index 785e57f..ac8cbf4 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="setupapi" type="win32dll" baseaddress="${BASEADDRESS_SETUPAPI}" installbase="system32" installname="setupapi.dll" allowwarnings="true" unicode="yes">
+<module name="setupapi" type="win32dll" baseaddress="${BASEADDRESS_SETUPAPI}" installbase="system32" installname="setupapi.dll" allowwarnings="true" unicode="yes" crt="msvcrt">
        <importlibrary definition="setupapi.spec" />
        <include base="setupapi">.</include>
        <include base="ReactOS">include/reactos/wine</include>
index c9b1a32..4c0dc6b 100644 (file)
@@ -1,4 +1,4 @@
-<module name="shell32" type="win32dll" baseaddress="${BASEADDRESS_SHELL32}" installbase="system32" installname="shell32.dll">
+<module name="shell32" type="win32dll" baseaddress="${BASEADDRESS_SHELL32}" installbase="system32" installname="shell32.dll" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="Both" />
        <importlibrary definition="shell32.spec" />
        <include base="shell32">.</include>
index 6dc1bcf..6b13019 100644 (file)
@@ -1,4 +1,4 @@
-<module name="syssetup" type="win32dll" baseaddress="${BASEADDRESS_SYSSETUP}" installbase="system32" installname="syssetup.dll" unicode="yes" allowwarnings="true">
+<module name="syssetup" type="win32dll" baseaddress="${BASEADDRESS_SYSSETUP}" installbase="system32" installname="syssetup.dll" unicode="yes" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="syssetup.def" />
        <include base="syssetup">.</include>
        <library>pseh</library>
index 716e87a..00eea41 100644 (file)
@@ -1,4 +1,4 @@
-<module name="twain_32" type="win32dll" baseaddress="${BASEADDRESS_TWAIN_32}" installbase="system32" installname="twain_32.dll" allowwarnings="true">
+<module name="twain_32" type="win32dll" baseaddress="${BASEADDRESS_TWAIN_32}" installbase="system32" installname="twain_32.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="twain_32.def" />
        <include base="twain_32">.</include>
        <define name="_DISABLE_TIDENTS" />
index 687d752..1cb28a7 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="winhttp" type="win32dll" baseaddress="${BASEADDRESS_WINHTTP}" installbase="system32" installname="winhttp.dll" allowwarnings="true">
+<module name="winhttp" type="win32dll" baseaddress="${BASEADDRESS_WINHTTP}" installbase="system32" installname="winhttp.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="winhttp.spec" />
        <include base="winhttp">.</include>
index 434373e..cf00643 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="wininet" type="win32dll" baseaddress="${BASEADDRESS_WININET}" installbase="system32" installname="wininet.dll" allowwarnings="true">
+<module name="wininet" type="win32dll" baseaddress="${BASEADDRESS_WININET}" installbase="system32" installname="wininet.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllInstall" />
        <importlibrary definition="wininet.spec" />
        <include base="wininet">.</include>
index fb8023f..58185cd 100644 (file)
@@ -7,7 +7,7 @@
 <directory name="wavemap">
        <xi:include href="wavemap/wavemap.rbuild" />
 </directory>
-<module name="winmm" type="win32dll" baseaddress="${BASEADDRESS_WINMM}" installbase="system32" installname="winmm.dll" allowwarnings="true">
+<module name="winmm" type="win32dll" baseaddress="${BASEADDRESS_WINMM}" installbase="system32" installname="winmm.dll" allowwarnings="true" crt="msvcrt">
        <importlibrary definition="winmm.spec" />
        <include base="winmm">.</include>
        <include base="ReactOS">include/reactos/wine</include>
index 1cab0d0..0cea3a8 100644 (file)
@@ -1,4 +1,4 @@
-<module name="wintrust" type="win32dll" baseaddress="${BASEADDRESS_WINTRUST}" installbase="system32" installname="wintrust.dll" allowwarnings="true">
+<module name="wintrust" type="win32dll" baseaddress="${BASEADDRESS_WINTRUST}" installbase="system32" installname="wintrust.dll" allowwarnings="true" crt="msvcrt">
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="wintrust.spec" />
        <include base="wintrust">.</include>
        <library>kernel32</library>
        <library>imagehlp</library>
        <library>ntdll</library>
+       <library>pseh</library>
        <file>crypt.c</file>
        <file>register.c</file>
        <file>wintrust_main.c</file>
        <file>asn.c</file>
        <file>softpub.c</file>
        <file>version.rc</file>
+       <!-- See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38054#c7 -->
+       <compilerflag>-fno-unit-at-a-time</compilerflag>
 </module>
index 9b28d69..af39050 100644 (file)
-/*
- * Wine exception handling
- *
- * Copyright (c) 1999 Alexandre Julliard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
 #ifndef __WINE_WINE_EXCEPTION_H
 #define __WINE_WINE_EXCEPTION_H
 
-#include <setjmp.h>
-#include <windef.h>
-#include <excpt.h>
+#include <intrin.h>
+#include <pseh/pseh2.h>
+#include <pseh/excpt.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* The following definitions allow using exceptions in Wine and Winelib code
- *
- * They should be used like this:
- *
- * __TRY
- * {
- *     do some stuff that can raise an exception
- * }
- * __EXCEPT(filter_func,param)
- * {
- *     handle the exception here
- * }
- * __ENDTRY
- *
- * or
- *
- * __TRY
- * {
- *     do some stuff that can raise an exception
- * }
- * __FINALLY(finally_func,param)
- *
- * The filter_func must be defined with the WINE_EXCEPTION_FILTER
- * macro, and return one of the EXCEPTION_* code; it can use
- * GetExceptionInformation and GetExceptionCode to retrieve the
- * exception info.
- *
- * The finally_func must be defined with the WINE_FINALLY_FUNC macro.
- *
- * Warning: inside a __TRY or __EXCEPT block, 'break' or 'continue' statements
- *          break out of the current block. You cannot use 'return', 'goto'
- *          or 'longjmp' to leave a __TRY block, as this will surely crash.
- *          You can use them to leave a __EXCEPT block though.
- *
- * -- AJ
- */
+struct _EXCEPTION_REGISTRATION_RECORD;
+typedef struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
 
-typedef struct _EXCEPTION_REGISTRATION_RECORD
+struct _EXCEPTION_REGISTRATION_RECORD
 {
-    struct _EXCEPTION_REGISTRATION_RECORD *Prev;
+    struct _EXCEPTION_REGISTRATION_RECORD * Prev;
     PEXCEPTION_HANDLER Handler;
-} EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
-
-/* Define this if you want to use your compiler built-in __try/__except support.
- * This is only useful when compiling to a native Windows binary, as the built-in
- * compiler exceptions will most certainly not work under Winelib.
- */
-#ifdef USE_COMPILER_EXCEPTIONS
+};
 
-#define __TRY __try
-#define __EXCEPT(func) __except((func)(GetExceptionInformation()))
-#define __FINALLY(func) __finally { (func)(!AbnormalTermination()); }
-#define __ENDTRY /*nothing*/
-#define __EXCEPT_PAGE_FAULT __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
-#define __EXCEPT_ALL __except(EXCEPTION_EXECUTE_HANDLER)
+#define __TRY _SEH2_TRY
+#define __EXCEPT(func) _SEH2_EXCEPT(func(_SEH2_GetExceptionInformation()))
+#define __EXCEPT_PAGE_FAULT _SEH2_EXCEPT(_SEH2_GetExceptionCode() == STATUS_ACCESS_VIOLATION)
+#define __EXCEPT_ALL _SEH2_EXCEPT(_SEH_EXECUTE_HANDLER)
+#define __ENDTRY _SEH2_END
+#define __FINALLY(func) _SEH2_FINALLY { func(!_SEH2_AbnormalTermination()); }
 
-#else  /* USE_COMPILER_EXCEPTIONS */
-
-#ifndef __GNUC__
-#define __attribute__(x) /* nothing */
+#ifndef GetExceptionCode
+#define GetExceptionCode() _SEH2_GetExceptionCode()
 #endif
 
-#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__REACTOS__)
-#define sigjmp_buf jmp_buf
-#define sigsetjmp(buf,sigs) setjmp(buf)
-#define siglongjmp(buf,val) longjmp(buf,val)
+#ifndef GetExceptionInformation
+#define GetExceptionInformation() _SEH2_GetExceptionInformation()
 #endif
 
-#define __TRY \
-    do { __WINE_FRAME __f; \
-         int __first = 1; \
-         for (;;) if (!__first) \
-         { \
-             do {
-
-#define __EXCEPT(func) \
-             } while(0); \
-             __wine_pop_frame( &__f.frame ); \
-             break; \
-         } else { \
-             __f.frame.Handler = __wine_exception_handler; \
-             __f.u.filter = (func); \
-             if (sigsetjmp( __f.jmp, 0 )) { \
-                 const __WINE_FRAME * const __eptr __attribute__((unused)) = &__f; \
-                 do {
-
-/* convenience handler for page fault exceptions */
-#define __EXCEPT_PAGE_FAULT \
-             } while(0); \
-             __wine_pop_frame( &__f.frame ); \
-             break; \
-         } else { \
-             __f.frame.Handler = __wine_exception_handler_page_fault; \
-             if (sigsetjmp( __f.jmp, 0 )) { \
-                 const __WINE_FRAME * const __eptr __attribute__((unused)) = &__f; \
-                 do {
-
-/* convenience handler for all exception */
-#define __EXCEPT_ALL \
-             } while(0); \
-             __wine_pop_frame( &__f.frame ); \
-             break; \
-         } else { \
-             __f.frame.Handler = __wine_exception_handler_all; \
-             if (sigsetjmp( __f.jmp, 0 )) { \
-                 const __WINE_FRAME * const __eptr __attribute__((unused)) = &__f; \
-                 do {
-
-#define __ENDTRY \
-                 } while (0); \
-                 break; \
-             } \
-             __wine_push_frame( &__f.frame ); \
-             __first = 0; \
-         } \
-    } while (0);
-
-#define __FINALLY(func) \
-             } while(0); \
-             __wine_pop_frame( &__f.frame ); \
-             (func)(1); \
-             break; \
-         } else { \
-             __f.frame.Handler = __wine_finally_handler; \
-             __f.u.finally_func = (func); \
-             __wine_push_frame( &__f.frame ); \
-             __first = 0; \
-         } \
-    } while (0);
-
-
-typedef LONG (CALLBACK *__WINE_FILTER)(PEXCEPTION_POINTERS);
-typedef void (CALLBACK *__WINE_FINALLY)(BOOL);
-
-#define GetExceptionInformation() (__eptr)
-#define GetExceptionCode()        (__eptr->ExceptionRecord->ExceptionCode)
-
-#undef AbnormalTermination
-#define AbnormalTermination()     (!__normal)
+#ifndef AbnormalTermination
+#define AbnormalTermination() _SEH2_AbnormalTermination()
+#endif
 
-typedef struct __tagWINE_FRAME
-{
-    EXCEPTION_REGISTRATION_RECORD frame;
-    union
-    {
-        /* exception data */
-        __WINE_FILTER filter;
-        /* finally data */
-        __WINE_FINALLY finally_func;
-    } u;
-    sigjmp_buf jmp;
-    /* hack to make GetExceptionCode() work in handler */
-    DWORD ExceptionCode;
-    const struct __tagWINE_FRAME *ExceptionRecord;
-} __WINE_FRAME;
+#define EXCEPTION_WINE_STUB       0x80000100
+#define EXCEPTION_WINE_ASSERTION  0x80000101
 
-#endif /* USE_COMPILER_EXCEPTIONS */
+#define EXCEPTION_VM86_INTx       0x80000110
+#define EXCEPTION_VM86_STI        0x80000111
+#define EXCEPTION_VM86_PICRETURN  0x80000112
 
 static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame( EXCEPTION_REGISTRATION_RECORD *frame )
 {
-#if defined(__GNUC__) && defined(__i386__)
-    EXCEPTION_REGISTRATION_RECORD *prev;
-    __asm__ __volatile__(".byte 0x64\n\tmovl (0),%0"
-                         "\n\tmovl %0,(%1)"
-                         "\n\t.byte 0x64\n\tmovl %1,(0)"
-                         : "=&r" (prev) : "r" (frame) : "memory" );
-    return prev;
-#else
-    NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
-    frame->Prev = teb->ExceptionList;
-    teb->ExceptionList = frame;
+    frame->Prev = (struct _EXCEPTION_REGISTRATION_RECORD *)__readfsdword(0);
+       __writefsdword(0, (unsigned long)frame);
     return frame->Prev;
-#endif
 }
 
 static inline EXCEPTION_REGISTRATION_RECORD *__wine_pop_frame( EXCEPTION_REGISTRATION_RECORD *frame )
 {
-#if defined(__GNUC__) && defined(__i386__)
-    __asm__ __volatile__(".byte 0x64\n\tmovl %0,(0)"
-                         : : "r" (frame->Prev) : "memory" );
+       __writefsdword(0, (unsigned long)frame->Prev);
     return frame->Prev;
-
-#else
-    NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
-    teb->ExceptionList = frame->Prev;
-    return frame->Prev;
-#endif
 }
 
-/* Exception handling flags - from OS/2 2.0 exception handling */
-
-/* Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD */
-#define EH_NONCONTINUABLE   0x01
-#define EH_UNWINDING        0x02
-#define EH_EXIT_UNWIND      0x04
-#define EH_STACK_INVALID    0x08
-#define EH_NESTED_CALL      0x10
-
-/* Wine-specific exceptions codes */
-
-#define EXCEPTION_WINE_STUB       0x80000100  /* stub entry point called */
-#define EXCEPTION_WINE_ASSERTION  0x80000101  /* assertion failed */
-
-/* unhandled return status from vm86 mode */
-#define EXCEPTION_VM86_INTx       0x80000110
-#define EXCEPTION_VM86_STI        0x80000111
-#define EXCEPTION_VM86_PICRETURN  0x80000112
-
 extern void __wine_enter_vm86( CONTEXT *context );
 
-#ifndef USE_COMPILER_EXCEPTIONS
-
-/* wrapper for RtlUnwind since it clobbers registers on Windows */
-static inline void __wine_rtl_unwind( EXCEPTION_REGISTRATION_RECORD* frame, EXCEPTION_RECORD *record )
-{
-#if defined(__GNUC__) && defined(__i386__)
-    int dummy1, dummy2, dummy3;
-    __asm__ __volatile__("pushl %%ebp\n\t"
-                         "pushl %%ebx\n\t"
-                         "pushl $0\n\t"
-                         "pushl %2\n\t"
-                         "pushl $0\n\t"
-                         "pushl %1\n\t"
-                         "call *%0\n\t"
-                         "popl %%ebx\n\t"
-                         "popl %%ebp"
-                         : "=a" (dummy1), "=S" (dummy2), "=D" (dummy3)
-                         : "0" (RtlUnwind), "1" (frame), "2" (record)
-                         : "ecx", "edx", "memory" );
-#else
-    RtlUnwind( frame, 0, record, 0 );
-#endif
-}
-
-static inline void DECLSPEC_NORETURN __wine_unwind_frame( EXCEPTION_RECORD *record,
-                                                          EXCEPTION_REGISTRATION_RECORD *frame )
-{
-    __WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
-
-    /* hack to make GetExceptionCode() work in handler */
-    wine_frame->ExceptionCode   = record->ExceptionCode;
-    wine_frame->ExceptionRecord = wine_frame;
-
-    __wine_rtl_unwind( frame, record );
-    __wine_pop_frame( frame );
-    siglongjmp( wine_frame->jmp, 1 );
-}
-static inline EXCEPTION_DISPOSITION
-__wine_exception_handler( struct _EXCEPTION_RECORD *record, void *frame,
-                          struct _CONTEXT *context, void *pdispatcher )
-{
-    __WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
-    EXCEPTION_POINTERS ptrs;
-
-    if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
-        return ExceptionContinueSearch;
-
-    ptrs.ExceptionRecord = record;
-    ptrs.ContextRecord = context;
-    switch(wine_frame->u.filter( &ptrs ))
-    {
-    case EXCEPTION_CONTINUE_SEARCH:
-        return ExceptionContinueSearch;
-    case EXCEPTION_CONTINUE_EXECUTION:
-        return ExceptionContinueExecution;
-    case EXCEPTION_EXECUTE_HANDLER:
-        break;
-    }
-    __wine_unwind_frame( record, frame );
-}
-
-static inline EXCEPTION_DISPOSITION
-__wine_exception_handler_page_fault( struct _EXCEPTION_RECORD *record, void *frame,
-                          struct _CONTEXT *context, void *pdispatcher )
-{
-    if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
-        return ExceptionContinueSearch;
-    if (record->ExceptionCode != STATUS_ACCESS_VIOLATION)
-        return ExceptionContinueSearch;
-    __wine_unwind_frame( record, frame );
-}
-
-static inline EXCEPTION_DISPOSITION
-__wine_exception_handler_all( struct _EXCEPTION_RECORD *record, void *frame,
-                          struct _CONTEXT *context, void *pdispatcher )
-{
-    if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
-        return ExceptionContinueSearch;
-    __wine_unwind_frame( record, frame );
-}
-
-static inline EXCEPTION_DISPOSITION
-__wine_finally_handler( struct _EXCEPTION_RECORD *record, void *frame,
-                        struct _CONTEXT *context, void *pdispatcher )
-{
-    if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND))
-    {
-        __WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
-        wine_frame->u.finally_func( FALSE );
-    }
-    return ExceptionContinueSearch;
-}
-
-#endif /* USE_COMPILER_EXCEPTIONS */
-
 #ifdef __cplusplus
 }
 #endif
 
-#endif  /* __WINE_WINE_EXCEPTION_H */
+#endif
index 822f8b5..e68ac79 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<module name="libxml2" type="staticlibrary" allowwarnings="true" crt="dll">
+<module name="libxml2" type="staticlibrary" allowwarnings="true" crt="dll" crt="msvcrt">
        <define name="HAVE_CONFIG_H" />
        <define name="WIN32" />
        <define name="_WINDOWS" />
index 8766f8b..6f71b95 100644 (file)
@@ -1185,7 +1185,7 @@ Module::GetDefaultModuleCRT () const
                        return "static";
                case Win32DLL:
                case Win32OCX:
-                       return "msvcrt";
+                       return "ntdll";
                case NativeDLL:
                case NativeCUI:
                        return "ntdll";